diff --git a/CHANGELOG.md b/CHANGELOG.md index be03af0fe..7f1a27f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ ## Release (2026-MM-DD) + +- `mongodbflex`: + - [v1.11.0](services/mongodbflex/CHANGELOG.md#v1110) + - `v1api`: + - **Breaking change:** Introduce validators for `name`, `database` and `username` + - `v2api`: + - **Breaking change:** Introduce validators for `name`, `database` and `username` +- `postgresflex`: + - [v1.10.0](services/postgresflex/CHANGELOG.md#v1100) + - `v3alpha1api`: Align package to latest API specification + +## Release (2026-06-18) - `core`: - [v0.25.0](core/CHANGELOG.md#v0250) - Minimal go version is now Go 1.25 @@ -252,6 +264,14 @@ - `v1api`: **Improvement**: Use new `WaiterHandler` struct in the LogMe WaitHandler - [v0.30.0](services/logme/CHANGELOG.md#v0300) - **Feature:** Introduce enums for various attributes + - [v1.0.0](services/logme/CHANGELOG.md#v100) + - `v2api`: + - New package which can be used for communication with the logme v2 API + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Deprecation:** `FluentdTls`, `FluentdTlsCiphers`, `FluentdTlsMaxVersion`, `FluentdTlsMinVersion`, `FluentdTlsVersion`, `OpensearchTlsCiphers`, `OpensearchTlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. + - `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `FluentdTls`, `FluentdTlsCiphers`, `FluentdTlsMaxVersion`, `FluentdTlsMinVersion`, `FluentdTlsVersion`, `OpensearchTlsCiphers`, `OpensearchTlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. - `logs`: - [v0.7.3](services/logs/CHANGELOG.md#v073) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` @@ -278,9 +298,18 @@ - **Improvement:** Use new WaiterHelper for Logs waiters - [v0.30.0](services/mariadb/CHANGELOG.md#v0300) - **Feature:** Introduce enums for various attributes + - [v1.0.0](services/mariadb/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v2api`: + - New package which can be used for communication with the mariadb v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. - `modelexperiments`: - [v0.1.0](services/modelexperiments/CHANGELOG.md#v010) - **New**: API for STACKIT modelexperiments + - [v0.2.0](services/modelexperiments/CHANGELOG.md#v020) + - **New**: STACKIT Model Experiments module wait handler added. - `modelserving`: - [v0.8.3](services/modelserving/CHANGELOG.md#v083) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` @@ -348,6 +377,14 @@ - **Improvement:** Use new WaiterHelper for opensearch waiters - [v0.29.0](services/opensearch/CHANGELOG.md#v0290) - **Feature:** Introduce enums for various attributes + - [v1.0.0](services/opensearch/CHANGELOG.md#v100) + - `v2api`: + - New package which can be used for communication with the opensearch v2 API + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Deprecation:** `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. + - `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. - `postgresflex`: - [v1.6.3](services/postgresflex/CHANGELOG.md#v163) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` @@ -376,6 +413,14 @@ - `v1api`: **Improvement**: Use new `WaiterHandler` struct in the RabbitMQ WaitHandler - [v0.31.0](services/rabbitmq/CHANGELOG.md#v0310) - **Feature:** Introduce enums for various attributes + - [v1.0.0](services/rabbitmq/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v2api`: + - New package which can be used for communication with the rabbitmq v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `Roles`, `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-11. - `redis`: - [v0.27.3](services/redis/CHANGELOG.md#v0273) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` @@ -389,6 +434,14 @@ - **Feature:** Introduce enums for various attributes - [v0.30.0](services/redis/CHANGELOG.md#v0300) - `v1api`: **Improvement**: Use new `WaiterHandler` struct in the Redis WaitHandler + - [v1.0.0](services/redis/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v2api`: + - New package which can be used for communication with the redis v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `TlsCiphers`, `TlsCiphersuites`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-10. - `resourcemanager`: - [v0.21.2](services/resourcemanager/CHANGELOG.md#v0212) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` @@ -549,6 +602,10 @@ - **Feature:** Introduce enums for various attributes - [v1.17.0](services/ske/CHANGELOG.md#v1170) - **Feature:** New field `ServiceAccountIssuer` for `ClusterStatus` model struct + - [v1.18.0](services/ske/CHANGELOG.md#v1180) + - `v2api`: + - **Improvement:** Use new WaiterHelper for ske waiters + - **Deprecation:** `CreateOrUpdateClusterWaitHandler` will be removed after 2026-12-08. Use the `CreateClusterWaitHandler` or `UpdateClusterWaitHandler` instead. - `sqlserverflex`: - [v1.6.3](services/sqlserverflex/CHANGELOG.md#v163) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/modelexperiments/go.mod b/examples/modelexperiments/go.mod new file mode 100644 index 000000000..7b5fb9fbf --- /dev/null +++ b/examples/modelexperiments/go.mod @@ -0,0 +1,14 @@ +module github.com/stackitcloud/stackit-sdk-go/examples/modelexperiments + +go 1.25 + +// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub. +replace github.com/stackitcloud/stackit-sdk-go/services/modelexperiments => ../../services/modelexperiments + +require github.com/stackitcloud/stackit-sdk-go/services/modelexperiments v0.2.0 + +require ( + github.com/golang-jwt/jwt/v5 v5.3.1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/stackitcloud/stackit-sdk-go/core v0.26.0 // indirect +) diff --git a/examples/modelexperiments/go.sum b/examples/modelexperiments/go.sum new file mode 100644 index 000000000..3712a0c87 --- /dev/null +++ b/examples/modelexperiments/go.sum @@ -0,0 +1,8 @@ +github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= +github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/stackitcloud/stackit-sdk-go/core v0.26.0 h1:jQEb9gkehfp6VCP6TcYk7BI10cz4l0KM2L6hqYBH2QA= +github.com/stackitcloud/stackit-sdk-go/core v0.26.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= diff --git a/examples/modelexperiments/modelexperiments.go b/examples/modelexperiments/modelexperiments.go new file mode 100644 index 000000000..9ea937c73 --- /dev/null +++ b/examples/modelexperiments/modelexperiments.go @@ -0,0 +1,149 @@ +package main + +import ( + "context" + "log" + + modelexperiments "github.com/stackitcloud/stackit-sdk-go/services/modelexperiments/v1api" + "github.com/stackitcloud/stackit-sdk-go/services/modelexperiments/v1api/wait" +) + +func main() { + projectId := "PROJECT_ID" // the uuid of your STACKIT project + region := "eu01" + instanceName := "instance" + newInstanceName := "newInstance" + newTokenName := "newTokenName" + description := "description" + ctx := context.Background() + + modelexperimentsClient, err := modelexperiments.NewAPIClient() + if err != nil { + log.Fatalf("[Model Experiments] Creating API client: %v\n", err) + } + + // Create a Model Experiments Instance + log.Printf("[Model Experiments] Creating Model Experiments Instance.\n") + createInstancePayload := modelexperiments.CreateInstancePayload{ + Name: instanceName, + Description: &description, + } + createInstanceResp, err := modelexperimentsClient.DefaultAPI.CreateInstance(ctx, projectId, region).CreateInstancePayload(createInstancePayload).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `CreateInstance`: %v\n", err) + } + log.Printf("[Model Experiments] Triggered creation of Model Experiments Instance with ID: %q.\n", createInstanceResp.Instance.Id) + + // Wait for the Model Experiments Instance to be ready + log.Printf("[Model Experiments] Waiting for Model Experiments Instance to be created.\n") + _, err = wait.CreateInstanceWaitHandler(ctx, modelexperimentsClient.DefaultAPI, region, projectId, createInstanceResp.Instance.Id).WaitWithContext(ctx) + if err != nil { + log.Fatalf("[Model Experiments] Error when waiting for creation: %v\n", err) + } + log.Printf("[Model Experiments] Model Experiments Instance %q has been successfully created.\n", createInstanceResp.Instance.Id) + + // Get the created Model Experiments Instance + log.Printf("[Model Experiments] Retrieving Model Experiments Instance.\n") + getInstanceResp, err := modelexperimentsClient.DefaultAPI.GetInstance(ctx, projectId, region, createInstanceResp.Instance.Id).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `GetInstance`: %v\n", err) + } + log.Printf("[Model Experiments] Retrieved Model Experiments Instance with ID: %q and display name: %q\n", getInstanceResp.Instance.Id, getInstanceResp.Instance.Name) + + // List Model Experiments Instances + log.Printf("[Model Experiments] Listing Model Experiments Instances.\n") + listInstanceResp, err := modelexperimentsClient.DefaultAPI.ListInstances(ctx, projectId, region).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `ListInstances`: %v\n", err) + } + log.Printf("[Model Experiments] Retrieved %d instances\n", len(listInstanceResp.Instances)) + + // Update a Model Experiments Instance + log.Printf("[Model Experiments] Updating Model Experiments Instance.\n") + partialUpdateInstancePayload := modelexperiments.PartialUpdateInstancePayload{ + Name: &newInstanceName, + } + partialUpdateInstanceResp, err := modelexperimentsClient.DefaultAPI.PartialUpdateInstance(ctx, projectId, region, getInstanceResp.Instance.Id).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `PartialUpdateInstance`: %v\n", err) + } + log.Printf("[Model Experiments] Updated Model Experiments Instance with ID: %q and display name: %q\n", partialUpdateInstanceResp.Instance.Id, partialUpdateInstanceResp.Instance.Name) + + // Create a Model Experiments Instance Token + log.Printf("[Model Experiments] Creating Model Experiments Instance Token.\n") + createTokenPayload := modelexperiments.CreateInstanceTokenPayload{ + Name: "token-name", + } + createTokenResp, err := modelexperimentsClient.DefaultAPI.CreateInstanceToken(ctx, projectId, region, createInstanceResp.Instance.Id).CreateInstanceTokenPayload(createTokenPayload).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `CreateToken`: %v\n", err) + } + log.Printf("[Model Experiments] Triggered creation of Model Experiments Instance Token: %+v\n", createTokenResp.Token) + + // Wait for the Model Experiments Instance Token to be ready + log.Printf("[Model Experiments] Waiting for Model Experiments Instance Token to be created.\n") + _, err = wait.CreateInstanceTokenWaitHandler(ctx, modelexperimentsClient.DefaultAPI, region, projectId, getInstanceResp.Instance.Id, createTokenResp.Token.Id).WaitWithContext(ctx) + if err != nil { + log.Fatalf("[Model Experiments] Error when waiting for creation: %v\n", err) + } + log.Printf("[Model Experiments] Model Experiments Instance Token %q has been successfully created.\n", createTokenResp.Token.Id) + + // Get the created Model Experiments Instance Token + log.Printf("[Model Experiments] Retrieving Model Experiments Instance Token.\n") + getTokenResp, err := modelexperimentsClient.DefaultAPI.GetInstanceToken(ctx, projectId, region, createTokenResp.Token.Id, getInstanceResp.Instance.Id).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `GetInstanceToken`: %v\n", err) + } + log.Printf("[Model Experiments] Retrieved Model Experiments Instance Token with ID: %q and display name: %q\n", getTokenResp.Token.Id, getTokenResp.Token.Name) + + // List Model Experiments Instance Tokens + log.Printf("[Model Experiments] Listing Model Experiments Instance Tokens.\n") + listTokenResp, err := modelexperimentsClient.DefaultAPI.ListInstanceTokens(ctx, projectId, region, getInstanceResp.Instance.Id).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `ListInstanceTokens`: %v\n", err) + } + log.Printf("[Model Experiments] Retrieved %d Instance tokens\n", len(listTokenResp.Tokens)) + + // Update a Model Experiments Instance Token + log.Printf("[Model Experiments] Updating Model Experiments Instance Token.\n") + partialUpdateInstanceTokenPayload := modelexperiments.PartialUpdateInstanceTokenPayload{ + Name: &newTokenName, + } + partialUpdateTokenResp, err := modelexperimentsClient.DefaultAPI.PartialUpdateInstanceToken(ctx, projectId, region, getTokenResp.Token.Id, getInstanceResp.Instance.Id).PartialUpdateInstanceTokenPayload(partialUpdateInstanceTokenPayload).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `PartialUpdateInstanceToken`: %v\n", err) + } + log.Printf("[Model Experiments] Updated Model Experiments Instance Token with ID: %q and display name: %q\n", partialUpdateTokenResp.Token.Id, partialUpdateTokenResp.Token.Name) + + // Delete a Model Experiments Instance Token + log.Printf("[Model Experiments] Deleting Model Experiments Instance Token.\n") + deleteTokenResp, err := modelexperimentsClient.DefaultAPI.DeleteInstanceToken(ctx, projectId, region, getTokenResp.Token.Id, getInstanceResp.Instance.Id).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `DeleteInstanceToken`: %v\n", err) + } + log.Printf("[Model Experiments] Triggered deletion of Model Experiments Instance Token with ID: %q and display name: %q\n", deleteTokenResp.Token.Id, deleteTokenResp.Token.Name) + + // Wait for the Model Experiments Instance Token to be deleted + log.Printf("[Model Experiments] Waiting for Model Experiments Instance Token to be deleted.\n") + _, err = wait.DeleteInstanceTokenWaitHandler(ctx, modelexperimentsClient.DefaultAPI, region, projectId, getInstanceResp.Instance.Id, deleteTokenResp.Token.Id).WaitWithContext(ctx) + if err != nil { + log.Fatalf("[Model Experiments] Error when waiting for deletion: %v\n", err) + } + log.Printf("[Model Experiments] Model Experiments Instance Token %q has been successfully deleted.\n", deleteTokenResp.Token.Id) + + // Delete a Model Experiments Instance + log.Printf("[Model Experiments] Deleting Model Experiments Instance.\n") + deleteInstanceResp, err := modelexperimentsClient.DefaultAPI.DeleteInstance(ctx, projectId, region, getInstanceResp.Instance.Id).Execute() + if err != nil { + log.Fatalf("[Model Experiments] Error when calling `DeleteInstance`: %v\n", err) + } + log.Printf("[Model Experiments] Triggered deletion of Model Experiments Instance with ID: %q and display name: %q\n", deleteInstanceResp.Instance.Id, deleteInstanceResp.Instance.Name) + + // Wait for the Model Experiments Instance to be deleted + log.Printf("[Model Experiments] Waiting for Model Experiments Instance to be deleted.\n") + _, err = wait.DeleteInstanceWaitHandler(ctx, modelexperimentsClient.DefaultAPI, region, projectId, getInstanceResp.Instance.Id).WaitWithContext(ctx) + if err != nil { + log.Fatalf("[Model Experiments] Error when waiting for deletion: %v\n", err) + } + log.Printf("[Model Experiments] Model Experiments Instance %q has been successfully deleted.\n", deleteInstanceResp.Instance.Id) +} diff --git a/examples/ske/ske.go b/examples/ske/ske.go index a79580a02..22fe56f47 100644 --- a/examples/ske/ske.go +++ b/examples/ske/ske.go @@ -84,7 +84,7 @@ func main() { } // Wait for cluster creation to complete - _, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient.DefaultAPI, projectId, region, clusterName).WaitWithContext(context.Background()) + _, err = wait.CreateClusterWaitHandler(context.Background(), skeClient.DefaultAPI, projectId, region, clusterName).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateOrUpdateCluster`: %v\n", err) } else { diff --git a/go.work b/go.work index 9d64b69f9..7c0013e6d 100644 --- a/go.work +++ b/go.work @@ -20,6 +20,7 @@ use ( ./examples/logs ./examples/mariadb ./examples/middleware + ./examples/modelexperiments ./examples/mongodbflex ./examples/objectstorage ./examples/observability diff --git a/services/cdn/v1api/wait/wait.go b/services/cdn/v1api/wait/wait.go index 7373c87b2..8f4fcf353 100644 --- a/services/cdn/v1api/wait/wait.go +++ b/services/cdn/v1api/wait/wait.go @@ -3,138 +3,112 @@ package wait import ( "context" "errors" - "fmt" - "net/http" "time" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" cdn "github.com/stackitcloud/stackit-sdk-go/services/cdn/v1api" ) func CreateDistributionPoolWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - distribution, err = api.GetDistribution(ctx, projectId, distributionId).Execute() - if err != nil { - return false, distribution, err - } - if distribution == nil { - return false, nil, fmt.Errorf("create failed for distribution with id %s, the response is nil", distributionId) - } - if distribution.Distribution.Id == distributionId { - switch distribution.Distribution.Status { - case cdn.DISTRIBUTIONSTATUS_ACTIVE: - return true, distribution, nil - case cdn.DISTRIBUTIONSTATUS_CREATING, cdn.DISTRIBUTIONSTATUS_UPDATING: - return false, nil, nil - case cdn.DISTRIBUTIONSTATUS_DELETING: - return true, nil, fmt.Errorf("creating CDN distribution failed") - case cdn.DISTRIBUTIONSTATUS_ERROR: - return true, nil, fmt.Errorf("creating CDN distribution failed") - default: - return true, nil, fmt.Errorf("CDNDistributionWaitHandler: unexpected status %s", distribution.Distribution.Status) + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: api.GetDistribution(ctx, projectId, distributionId).Execute, + GetState: func(c *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if c == nil { + return "", errors.New("empty response") } - } - return false, nil, nil - }) + return c.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ACTIVE}, + ErrorState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ERROR, cdn.DISTRIBUTIONSTATUS_DELETING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } func UpdateDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - distribution, err = api.GetDistribution(ctx, projectId, distributionId).Execute() - if err != nil { - return false, distribution, err - } - if distribution == nil { - return false, nil, fmt.Errorf("update failed for distribution with id %s, the response is nil", distributionId) - } - if distribution.Distribution.Id == distributionId { - switch distribution.Distribution.Status { - case cdn.DISTRIBUTIONSTATUS_ACTIVE: - return true, distribution, err - case cdn.DISTRIBUTIONSTATUS_UPDATING: - return false, nil, nil - case cdn.DISTRIBUTIONSTATUS_DELETING: - return true, nil, fmt.Errorf("updating CDN distribution failed") - case cdn.DISTRIBUTIONSTATUS_ERROR: - return true, nil, fmt.Errorf("updating CDN distribution failed") - default: - return true, nil, fmt.Errorf("UpdateDistributionWaitHandler: unexpected status %s", distribution.Distribution.Status) + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: api.GetDistribution(ctx, projectId, distributionId).Execute, + GetState: func(c *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if c == nil { + return "", errors.New("empty response") } - } - - return false, nil, nil - }) + return c.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ACTIVE}, + ErrorState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ERROR, cdn.DISTRIBUTIONSTATUS_DELETING, cdn.DISTRIBUTIONSTATUS_CREATING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } -func DeleteDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - _, err = api.GetDistribution(ctx, projectId, distributionId).Execute() - // the distribution is still gettable, e.g. not deleted - if err == nil { - return false, nil, nil - } - var oapiError *oapierror.GenericOpenAPIError - if errors.As(err, &oapiError) { - if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { - return true, nil, nil +func DeleteDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: api.GetDistribution(ctx, projectId, distributionId).Execute, + GetState: func(c *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if c == nil { + return "", errors.New("empty response") } - } - - return false, nil, err - }) + return c.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{}, + ErrorState: []cdn.DistributionStatus{}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } func CreateCDNCustomDomainWaitHandler(ctx context.Context, a cdn.DefaultAPI, projectId, distributionId, domain string) *wait.AsyncActionHandler[cdn.CustomDomain] { - handler := wait.New(func() (waitFinished bool, response *cdn.CustomDomain, err error) { - resp, err := a.GetCustomDomain(ctx, projectId, distributionId, domain).Execute() - if err != nil { - return false, nil, err - } - if resp == nil { - return false, nil, errors.New("CDNDistributionWaitHandler: response is nil") - } - - switch resp.CustomDomain.Status { - case cdn.DOMAINSTATUS_ACTIVE: - return true, &resp.CustomDomain, nil - case cdn.DOMAINSTATUS_CREATING, cdn.DOMAINSTATUS_UPDATING: - return false, nil, nil - case cdn.DOMAINSTATUS_DELETING: - return true, nil, fmt.Errorf("creating CDN custom domain failed") - case cdn.DOMAINSTATUS_ERROR: - return true, nil, fmt.Errorf("creating CDN custom domain failed") - default: - return true, nil, fmt.Errorf("CDNCustomDomainWaitHandler: unexpected status %s", resp.CustomDomain.Status) - } - }) + waitConfig := wait.WaiterHelper[cdn.CustomDomain, cdn.DomainStatus]{ + FetchInstance: func() (*cdn.CustomDomain, error) { + resp, err := a.GetCustomDomain(ctx, projectId, distributionId, domain).Execute() + if err != nil { + return nil, err + } + if resp == nil { + return nil, errors.New("CDNDistributionWaitHandler: response is nil") + } + return &resp.CustomDomain, err + }, + GetState: func(c *cdn.CustomDomain) (cdn.DomainStatus, error) { + if c == nil { + return "", errors.New("empty response") + } + return c.Status, nil + }, + ActiveState: []cdn.DomainStatus{cdn.DOMAINSTATUS_ACTIVE}, + ErrorState: []cdn.DomainStatus{cdn.DOMAINSTATUS_ERROR, cdn.DOMAINSTATUS_DELETING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } func DeleteCDNCustomDomainWaitHandler(ctx context.Context, a cdn.DefaultAPI, projectId, distributionId, domain string) *wait.AsyncActionHandler[cdn.CustomDomain] { - handler := wait.New(func() (waitFinished bool, response *cdn.CustomDomain, err error) { - _, err = a.GetCustomDomain(ctx, projectId, distributionId, domain).Execute() - - // the custom domain is still gettable, e.g. not deleted - if err == nil { - return false, nil, nil - } - var oapiError *oapierror.GenericOpenAPIError - if errors.As(err, &oapiError) { - if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { - return true, nil, nil + waitConfig := wait.WaiterHelper[cdn.CustomDomain, cdn.DomainStatus]{ + FetchInstance: func() (*cdn.CustomDomain, error) { + resp, err := a.GetCustomDomain(ctx, projectId, distributionId, domain).Execute() + if err != nil { + return nil, err + } + if resp == nil { + return nil, errors.New("CDNDistributionWaitHandler: response is nil") + } + return &resp.CustomDomain, err + }, + GetState: func(c *cdn.CustomDomain) (cdn.DomainStatus, error) { + if c == nil { + return "", errors.New("empty response") } - } - return false, nil, err - }) + return c.Status, nil + }, + ActiveState: []cdn.DomainStatus{}, + ErrorState: []cdn.DomainStatus{}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } diff --git a/services/cdn/v1api/wait/wait_test.go b/services/cdn/v1api/wait/wait_test.go index 6dd42e1f7..243bde951 100644 --- a/services/cdn/v1api/wait/wait_test.go +++ b/services/cdn/v1api/wait/wait_test.go @@ -146,11 +146,17 @@ func TestCreateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.distribution.Status = statusDeleting }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: cdn.Distribution{ + Id: distributionId, + ProjectId: projectId, + Status: statusDeleting, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN distribution failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -160,11 +166,17 @@ func TestCreateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.distribution.Status = statusError }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: cdn.Distribution{ + Id: distributionId, + ProjectId: projectId, + Status: statusError, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN distribution failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) @@ -365,11 +377,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.distribution.Status = statusCreating }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: cdn.Distribution{ + Id: distributionId, + ProjectId: projectId, + Status: statusCreating, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "unexpected status CREATING") { + if strings.Contains(err.Error(), "state is CREATING") { return } t.Fatalf("Unexpected error: %v", err) @@ -379,11 +397,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.distribution.Status = statusDeleting }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: cdn.Distribution{ + Id: distributionId, + ProjectId: projectId, + Status: statusDeleting, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "updating CDN distribution failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -393,11 +417,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.distribution.Status = statusError }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: cdn.Distribution{ + Id: distributionId, + ProjectId: projectId, + Status: statusError, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "updating CDN distribution failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) @@ -480,12 +510,15 @@ func TestCreateCustomDomainWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.customDomain.Status = cdn.DOMAINSTATUS_DELETING }), - projectId: projectId, - distributionId: distributionId, - customDomain: customDomain, - expectedCustomDomain: nil, + projectId: projectId, + distributionId: distributionId, + customDomain: customDomain, + expectedCustomDomain: &cdn.CustomDomain{ + Name: customDomain, + Status: cdn.DOMAINSTATUS_DELETING, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN custom domain failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -495,12 +528,15 @@ func TestCreateCustomDomainWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(settings *mockSettings) { settings.customDomain.Status = cdn.DOMAINSTATUS_ERROR }), - projectId: projectId, - distributionId: distributionId, - customDomain: customDomain, - expectedCustomDomain: nil, + projectId: projectId, + distributionId: distributionId, + customDomain: customDomain, + expectedCustomDomain: &cdn.CustomDomain{ + Name: customDomain, + Status: cdn.DOMAINSTATUS_ERROR, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN custom domain failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) diff --git a/services/cdn/wait/wait.go b/services/cdn/wait/wait.go index f16a8f601..65e681e45 100644 --- a/services/cdn/wait/wait.go +++ b/services/cdn/wait/wait.go @@ -3,28 +3,12 @@ package wait import ( "context" "errors" - "fmt" - "net/http" "time" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/cdn" ) -const ( - // Deprecated: DistributionStatusCreating is deprecated and will be removed after 14th November 2025. Use [cdn.DISTRIBUTIONSTATUS_CREATING] instead. - DistributionStatusCreating = "CREATING" - // Deprecated: DistributionStatusActive is deprecated and will be removed after 14th November 2025. Use [cdn.DISTRIBUTIONSTATUS_ACTIVE] instead. - DistributionStatusActive = "ACTIVE" - // Deprecated: DistributionStatusUpdating is deprecated and will be removed after 14th November 2025. Use [cdn.DISTRIBUTIONSTATUS_UPDATING] instead. - DistributionStatusUpdating = "UPDATING" - // Deprecated: DistributionStatusDeleting is deprecated and will be removed after 14th November 2025. Use [cdn.DISTRIBUTIONSTATUS_DELETING] instead. - DistributionStatusDeleting = "DELETING" - // Deprecated: DistributionStatusError is deprecated and will be removed after 14th November 2025. Use [cdn.DISTRIBUTIONSTATUS_ERROR] instead. - DistributionStatusError = "ERROR" -) - // Interfaces needed for tests // // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -35,67 +19,52 @@ type APIClientInterface interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateDistributionPoolWaitHandler(ctx context.Context, api APIClientInterface, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - distribution, err = api.GetDistributionExecute(ctx, projectId, distributionId) - if err != nil { - return false, distribution, err - } - if distribution == nil || - distribution.Distribution == nil || - distribution.Distribution.Id == nil || - distribution.Distribution.Status == nil { - return false, distribution, fmt.Errorf("create failed for distribution with id %s, the response is not valid (state missing)", distributionId) - } - if *distribution.Distribution.Id == distributionId { - switch *distribution.Distribution.Status { - case cdn.DISTRIBUTIONSTATUS_ACTIVE: - return true, distribution, nil - case cdn.DISTRIBUTIONSTATUS_CREATING, cdn.DISTRIBUTIONSTATUS_UPDATING: - return false, nil, nil - case cdn.DISTRIBUTIONSTATUS_DELETING: - return true, nil, fmt.Errorf("creating CDN distribution failed") - case cdn.DISTRIBUTIONSTATUS_ERROR: - return true, nil, fmt.Errorf("creating CDN distribution failed") - default: - return true, nil, fmt.Errorf("CDNDistributionWaitHandler: unexpected status %s", *distribution.Distribution.Status) + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: func() (*cdn.GetDistributionResponse, error) { + return api.GetDistributionExecute(ctx, projectId, distributionId) + }, + GetState: func(response *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if response == nil { + return "", errors.New("empty response") + } + if response.Distribution == nil { + return "", errors.New("empty distribution") } - } - return false, nil, nil - }) + if response.Distribution.Status == nil { + return "", errors.New("empty status") + } + return *response.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ACTIVE}, + ErrorState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ERROR, cdn.DISTRIBUTIONSTATUS_DELETING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func UpdateDistributionWaitHandler(ctx context.Context, api APIClientInterface, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - distribution, err = api.GetDistributionExecute(ctx, projectId, distributionId) - if err != nil { - return false, distribution, err - } - if distribution == nil || - distribution.Distribution == nil || - distribution.Distribution.Id == nil || - distribution.Distribution.Status == nil { - return false, distribution, fmt.Errorf("update failed for distribution with id %s, the response is not valid (state missing)", distributionId) - } - if *distribution.Distribution.Id == distributionId { - switch *distribution.Distribution.Status { - case cdn.DISTRIBUTIONSTATUS_ACTIVE: - return true, distribution, err - case cdn.DISTRIBUTIONSTATUS_UPDATING: - return false, nil, nil - case cdn.DISTRIBUTIONSTATUS_DELETING: - return true, nil, fmt.Errorf("updating CDN distribution failed") - case cdn.DISTRIBUTIONSTATUS_ERROR: - return true, nil, fmt.Errorf("updating CDN distribution failed") - default: - return true, nil, fmt.Errorf("UpdateDistributionWaitHandler: unexpected status %s", *distribution.Distribution.Status) + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: func() (*cdn.GetDistributionResponse, error) { + return api.GetDistributionExecute(ctx, projectId, distributionId) + }, + GetState: func(response *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if response == nil { + return "", errors.New("empty response") } - } - - return false, nil, nil - }) + if response.Distribution == nil { + return "", errors.New("empty distribution") + } + if response.Distribution.Status == nil { + return "", errors.New("empty status") + } + return *response.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ACTIVE}, + ErrorState: []cdn.DistributionStatus{cdn.DISTRIBUTIONSTATUS_ERROR, cdn.DISTRIBUTIONSTATUS_DELETING, cdn.DISTRIBUTIONSTATUS_CREATING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler @@ -103,71 +72,80 @@ func UpdateDistributionWaitHandler(ctx context.Context, api APIClientInterface, // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DeleteDistributionWaitHandler(ctx context.Context, api APIClientInterface, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { - handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { - _, err = api.GetDistributionExecute(ctx, projectId, distributionId) - - // the distribution is still gettable, e.g. not deleted - if err == nil { - return false, nil, nil - } - var oapiError *oapierror.GenericOpenAPIError - if errors.As(err, &oapiError) { - if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { - return true, nil, nil + waitConfig := wait.WaiterHelper[cdn.GetDistributionResponse, cdn.DistributionStatus]{ + FetchInstance: func() (*cdn.GetDistributionResponse, error) { + return api.GetDistributionExecute(ctx, projectId, distributionId) + }, + GetState: func(response *cdn.GetDistributionResponse) (cdn.DistributionStatus, error) { + if response == nil { + return "", errors.New("empty response") } - } - - return false, nil, err - }) + if response.Distribution == nil { + return "", errors.New("empty distribution") + } + if response.Distribution.Status == nil { + return "", errors.New("empty status") + } + return *response.Distribution.Status, nil + }, + ActiveState: []cdn.DistributionStatus{}, + ErrorState: []cdn.DistributionStatus{}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateCDNCustomDomainWaitHandler(ctx context.Context, a APIClientInterface, projectId, distributionId, domain string) *wait.AsyncActionHandler[cdn.CustomDomain] { - handler := wait.New(func() (waitFinished bool, response *cdn.CustomDomain, err error) { - resp, err := a.GetCustomDomainExecute(ctx, projectId, distributionId, domain) - if err != nil { - return false, nil, err - } - if resp == nil || resp.CustomDomain == nil || resp.CustomDomain.Status == nil { - return false, nil, errors.New("CDNDistributionWaitHandler: status or custom domain missing in response") - } - - switch *resp.CustomDomain.Status { - case cdn.DOMAINSTATUS_ACTIVE: - return true, resp.CustomDomain, nil - case cdn.DOMAINSTATUS_CREATING, cdn.DOMAINSTATUS_UPDATING: - return false, nil, nil - case cdn.DOMAINSTATUS_DELETING: - return true, nil, fmt.Errorf("creating CDN custom domain failed") - case cdn.DOMAINSTATUS_ERROR: - return true, nil, fmt.Errorf("creating CDN custom domain failed") - default: - return true, nil, fmt.Errorf("CDNCustomDomainWaitHandler: unexpected status %s", *resp.CustomDomain.Status) - } - }) + waitConfig := wait.WaiterHelper[cdn.CustomDomain, cdn.DomainStatus]{ + FetchInstance: func() (*cdn.CustomDomain, error) { + resp, err := a.GetCustomDomainExecute(ctx, projectId, distributionId, domain) + if err != nil || resp == nil || resp.CustomDomain == nil { + return nil, err + } + return resp.CustomDomain, nil + }, + GetState: func(response *cdn.CustomDomain) (cdn.DomainStatus, error) { + if response == nil { + return "", errors.New("empty response") + } + if response.Status == nil { + return "", errors.New("empty status") + } + return *response.Status, nil + }, + ActiveState: []cdn.DomainStatus{cdn.DOMAINSTATUS_ACTIVE}, + ErrorState: []cdn.DomainStatus{cdn.DOMAINSTATUS_ERROR, cdn.DOMAINSTATUS_DELETING}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DeleteCDNCustomDomainWaitHandler(ctx context.Context, a APIClientInterface, projectId, distributionId, domain string) *wait.AsyncActionHandler[cdn.CustomDomain] { - handler := wait.New(func() (waitFinished bool, response *cdn.CustomDomain, err error) { - _, err = a.GetCustomDomainExecute(ctx, projectId, distributionId, domain) - - // the custom domain is still gettable, e.g. not deleted - if err == nil { - return false, nil, nil - } - var oapiError *oapierror.GenericOpenAPIError - if errors.As(err, &oapiError) { - if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound || statusCode == http.StatusGone { - return true, nil, nil + waitConfig := wait.WaiterHelper[cdn.CustomDomain, cdn.DomainStatus]{ + FetchInstance: func() (*cdn.CustomDomain, error) { + resp, err := a.GetCustomDomainExecute(ctx, projectId, distributionId, domain) + if err != nil || resp == nil || resp.CustomDomain == nil { + return nil, err + } + return resp.CustomDomain, nil + }, + GetState: func(response *cdn.CustomDomain) (cdn.DomainStatus, error) { + if response == nil { + return "", errors.New("empty response") + } + if response.Status == nil { + return "", errors.New("empty status") } - } - return false, nil, err - }) + return *response.Status, nil + }, + ActiveState: []cdn.DomainStatus{}, + ErrorState: []cdn.DomainStatus{}, + } + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } diff --git a/services/cdn/wait/wait_test.go b/services/cdn/wait/wait_test.go index 47168fb68..c5dd18c26 100644 --- a/services/cdn/wait/wait_test.go +++ b/services/cdn/wait/wait_test.go @@ -142,11 +142,17 @@ func TestCreateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.distributions[0].Status = &statusDeleting }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: &cdn.Distribution{ + Id: &distributionId, + ProjectId: &projectId, + Status: &statusDeleting, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN distribution failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -156,11 +162,17 @@ func TestCreateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.distributions[0].Status = &statusError }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: &cdn.Distribution{ + Id: &distributionId, + ProjectId: &projectId, + Status: &statusError, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN distribution failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) @@ -377,11 +389,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.distributions[0].Status = &statusCreating }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: &cdn.Distribution{ + Id: &distributionId, + ProjectId: &projectId, + Status: &statusCreating, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "unexpected status CREATING") { + if strings.Contains(err.Error(), "state is CREATING") { return } t.Fatalf("Unexpected error: %v", err) @@ -391,11 +409,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.distributions[0].Status = &statusDeleting }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: &cdn.Distribution{ + Id: &distributionId, + ProjectId: &projectId, + Status: &statusDeleting, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "updating CDN distribution failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -405,11 +429,17 @@ func TestUpdateDistributionWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.distributions[0].Status = &statusError }), - projectId: projectId, - distributionId: distributionId, - expectedDistribution: nil, + projectId: projectId, + distributionId: distributionId, + expectedDistribution: &cdn.GetDistributionResponse{ + Distribution: &cdn.Distribution{ + Id: &distributionId, + ProjectId: &projectId, + Status: &statusError, + }, + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "updating CDN distribution failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) @@ -491,12 +521,15 @@ func TestCreateCustomDomainWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.customDomains[0].Status = cdn.DOMAINSTATUS_DELETING.Ptr() }), - projectId: projectId, - distributionId: distributionId, - customDomain: customDomain, - expectedCustomDomain: nil, + projectId: projectId, + distributionId: distributionId, + customDomain: customDomain, + expectedCustomDomain: &cdn.CustomDomain{ + Name: &customDomain, + Status: cdn.DOMAINSTATUS_DELETING.Ptr(), + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN custom domain failed") { + if strings.Contains(err.Error(), "state is DELETING") { return } t.Fatalf("Unexpected error: %v", err) @@ -506,12 +539,15 @@ func TestCreateCustomDomainWaitHandler(t *testing.T) { apiClient: mockClientFixture(func(tc *mockApiClient) { tc.customDomains[0].Status = cdn.DOMAINSTATUS_ERROR.Ptr() }), - projectId: projectId, - distributionId: distributionId, - customDomain: customDomain, - expectedCustomDomain: nil, + projectId: projectId, + distributionId: distributionId, + customDomain: customDomain, + expectedCustomDomain: &cdn.CustomDomain{ + Name: &customDomain, + Status: cdn.DOMAINSTATUS_ERROR.Ptr(), + }, errCheck: func(t *testing.T, err error) { - if strings.Contains(err.Error(), "creating CDN custom domain failed") { + if strings.Contains(err.Error(), "state is ERROR") { return } t.Fatalf("Unexpected error: %v", err) diff --git a/services/logme/CHANGELOG.md b/services/logme/CHANGELOG.md index c860a5c8a..80fa87d86 100644 --- a/services/logme/CHANGELOG.md +++ b/services/logme/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.0.0 +- `v2api`: + - New package which can be used for communication with the logme v2 API + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Deprecation:** `FluentdTls`, `FluentdTlsCiphers`, `FluentdTlsMaxVersion`, `FluentdTlsMinVersion`, `FluentdTlsVersion`, `OpensearchTlsCiphers`, `OpensearchTlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. +- `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `FluentdTls`, `FluentdTlsCiphers`, `FluentdTlsMaxVersion`, `FluentdTlsMinVersion`, `FluentdTlsVersion`, `OpensearchTlsCiphers`, `OpensearchTlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. + ## v0.30.0 - **Feature:** Introduce enums for various attributes diff --git a/services/logme/VERSION b/services/logme/VERSION index 29e939cda..60453e690 100644 --- a/services/logme/VERSION +++ b/services/logme/VERSION @@ -1 +1 @@ -v0.30.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/logme/api_default.go b/services/logme/api_default.go index 4bc445a28..75330c085 100644 --- a/services/logme/api_default.go +++ b/services/logme/api_default.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/logme/client.go b/services/logme/client.go index 2ff0c3e54..931fc8fcf 100644 --- a/services/logme/client.go +++ b/services/logme/client.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT LogMe API API v1.1.0 +// APIClient manages communication with the STACKIT LogMe API API v2.1.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/logme/configuration.go b/services/logme/configuration.go index 7c34df0e6..805016815 100644 --- a/services/logme/configuration.go +++ b/services/logme/configuration.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://logme.api.{region}stackit.cloud", + URL: "https://logme.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/logme/model_backup.go b/services/logme/model_backup.go index c3aacab63..03bdb1dbd 100644 --- a/services/logme/model_backup.go +++ b/services/logme/model_backup.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/logme/model_backup_test.go b/services/logme/model_backup_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_backup_test.go +++ b/services/logme/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_backup_response_item.go b/services/logme/model_create_backup_response_item.go index 99685db65..0fe13b921 100644 --- a/services/logme/model_create_backup_response_item.go +++ b/services/logme/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/logme/model_create_backup_response_item_test.go b/services/logme/model_create_backup_response_item_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_backup_response_item_test.go +++ b/services/logme/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_credentials_payload.go b/services/logme/model_create_credentials_payload.go new file mode 100644 index 000000000..e268578a7 --- /dev/null +++ b/services/logme/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package logme + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/model_create_credentials_payload_test.go b/services/logme/model_create_credentials_payload_test.go new file mode 100644 index 000000000..8cc84223f --- /dev/null +++ b/services/logme/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package logme diff --git a/services/logme/model_create_instance_payload.go b/services/logme/model_create_instance_payload.go index 61712f833..41d447de0 100644 --- a/services/logme/model_create_instance_payload.go +++ b/services/logme/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_payload_test.go b/services/logme/model_create_instance_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_instance_payload_test.go +++ b/services/logme/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_response.go b/services/logme/model_create_instance_response.go index 5e6b86d08..54b357b4c 100644 --- a/services/logme/model_create_instance_response.go +++ b/services/logme/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_response_test.go b/services/logme/model_create_instance_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_instance_response_test.go +++ b/services/logme/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials.go b/services/logme/model_credentials.go index a73ae8aba..775735aa9 100644 --- a/services/logme/model_credentials.go +++ b/services/logme/model_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_list_item.go b/services/logme/model_credentials_list_item.go index d8fd23be9..fcba62cdb 100644 --- a/services/logme/model_credentials_list_item.go +++ b/services/logme/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_list_item_test.go b/services/logme/model_credentials_list_item_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_list_item_test.go +++ b/services/logme/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_response.go b/services/logme/model_credentials_response.go index 917db8474..aafc72de8 100644 --- a/services/logme/model_credentials_response.go +++ b/services/logme/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_response_test.go b/services/logme/model_credentials_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_response_test.go +++ b/services/logme/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_test.go b/services/logme/model_credentials_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_test.go +++ b/services/logme/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_error.go b/services/logme/model_error.go index 591483079..dd6096578 100644 --- a/services/logme/model_error.go +++ b/services/logme/model_error.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_error_test.go b/services/logme/model_error_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_error_test.go +++ b/services/logme/model_error_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_get_metrics_response.go b/services/logme/model_get_metrics_response.go index a765295a6..2e6ba7e5c 100644 --- a/services/logme/model_get_metrics_response.go +++ b/services/logme/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_get_metrics_response_test.go b/services/logme/model_get_metrics_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_get_metrics_response_test.go +++ b/services/logme/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance.go b/services/logme/model_instance.go index 73e99e584..d838965c0 100644 --- a/services/logme/model_instance.go +++ b/services/logme/model_instance.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_last_operation.go b/services/logme/model_instance_last_operation.go index 06bd06124..29cb7968d 100644 --- a/services/logme/model_instance_last_operation.go +++ b/services/logme/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_last_operation_test.go b/services/logme/model_instance_last_operation_test.go index 0ce42e6a2..1b136433c 100644 --- a/services/logme/model_instance_last_operation_test.go +++ b/services/logme/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters.go b/services/logme/model_instance_parameters.go index 55b1a5406..6b35a9100 100644 --- a/services/logme/model_instance_parameters.go +++ b/services/logme/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -645,12 +645,17 @@ type InstanceParameters struct { EnableMonitoring InstanceParametersgetEnableMonitoringAttributeType `json:"enable_monitoring,omitempty"` // Can be cast to int32 without loss of precision. FluentdTcp InstanceParametersGetFluentdTcpAttributeType `json:"fluentd-tcp,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. // Can be cast to int32 without loss of precision. - FluentdTls InstanceParametersGetFluentdTlsAttributeType `json:"fluentd-tls,omitempty"` - FluentdTlsCiphers InstanceParametersGetFluentdTlsCiphersAttributeType `json:"fluentd-tls-ciphers,omitempty"` + FluentdTls InstanceParametersGetFluentdTlsAttributeType `json:"fluentd-tls,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + FluentdTlsCiphers InstanceParametersGetFluentdTlsCiphersAttributeType `json:"fluentd-tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. FluentdTlsMaxVersion InstanceParametersGetFluentdTlsMaxVersionAttributeType `json:"fluentd-tls-max-version,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. FluentdTlsMinVersion InstanceParametersGetFluentdTlsMinVersionAttributeType `json:"fluentd-tls-min-version,omitempty"` - FluentdTlsVersion InstanceParametersGetFluentdTlsVersionAttributeType `json:"fluentd-tls-version,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + FluentdTlsVersion InstanceParametersGetFluentdTlsVersionAttributeType `json:"fluentd-tls-version,omitempty"` // Can be cast to int32 without loss of precision. FluentdUdp InstanceParametersGetFluentdUdpAttributeType `json:"fluentd-udp,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. @@ -674,9 +679,11 @@ type InstanceParameters struct { // Can be cast to int32 without loss of precision. MetricsFrequency InstanceParametersGetMetricsFrequencyAttributeType `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix InstanceParametersGetMetricsPrefixAttributeType `json:"metrics_prefix,omitempty"` - MonitoringInstanceId InstanceParametersGetMonitoringInstanceIdAttributeType `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers InstanceParametersGetOpensearchTlsCiphersAttributeType `json:"opensearch-tls-ciphers,omitempty"` + MetricsPrefix InstanceParametersGetMetricsPrefixAttributeType `json:"metrics_prefix,omitempty"` + MonitoringInstanceId InstanceParametersGetMonitoringInstanceIdAttributeType `json:"monitoring_instance_id,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + OpensearchTlsCiphers InstanceParametersGetOpensearchTlsCiphersAttributeType `json:"opensearch-tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. OpensearchTlsProtocols InstanceParametersGetOpensearchTlsProtocolsAttributeType `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` diff --git a/services/logme/model_instance_parameters_groks_inner.go b/services/logme/model_instance_parameters_groks_inner.go index 96cc54e27..490ed0b97 100644 --- a/services/logme/model_instance_parameters_groks_inner.go +++ b/services/logme/model_instance_parameters_groks_inner.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters_groks_inner_test.go b/services/logme/model_instance_parameters_groks_inner_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_parameters_groks_inner_test.go +++ b/services/logme/model_instance_parameters_groks_inner_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters_test.go b/services/logme/model_instance_parameters_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_parameters_test.go +++ b/services/logme/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_schema.go b/services/logme/model_instance_schema.go index 20945c34a..1ea5b5951 100644 --- a/services/logme/model_instance_schema.go +++ b/services/logme/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_schema_test.go b/services/logme/model_instance_schema_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_schema_test.go +++ b/services/logme/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_test.go b/services/logme/model_instance_test.go index c0e7585e9..0eec05301 100644 --- a/services/logme/model_instance_test.go +++ b/services/logme/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_backups_response.go b/services/logme/model_list_backups_response.go index dd9fc3f7c..e8cbba255 100644 --- a/services/logme/model_list_backups_response.go +++ b/services/logme/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_backups_response_test.go b/services/logme/model_list_backups_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_backups_response_test.go +++ b/services/logme/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_credentials_response.go b/services/logme/model_list_credentials_response.go index be321e165..1dc74087e 100644 --- a/services/logme/model_list_credentials_response.go +++ b/services/logme/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_credentials_response_test.go b/services/logme/model_list_credentials_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_credentials_response_test.go +++ b/services/logme/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_instances_response.go b/services/logme/model_list_instances_response.go index 7e6900c97..1a1d83837 100644 --- a/services/logme/model_list_instances_response.go +++ b/services/logme/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_instances_response_test.go b/services/logme/model_list_instances_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_instances_response_test.go +++ b/services/logme/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_offerings_response.go b/services/logme/model_list_offerings_response.go index 0597cee4f..5f0086716 100644 --- a/services/logme/model_list_offerings_response.go +++ b/services/logme/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_offerings_response_test.go b/services/logme/model_list_offerings_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_offerings_response_test.go +++ b/services/logme/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_restores_response.go b/services/logme/model_list_restores_response.go index 673c3661c..61888b25f 100644 --- a/services/logme/model_list_restores_response.go +++ b/services/logme/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_restores_response_test.go b/services/logme/model_list_restores_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_restores_response_test.go +++ b/services/logme/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_offering.go b/services/logme/model_offering.go index eb19aabee..4345d1f40 100644 --- a/services/logme/model_offering.go +++ b/services/logme/model_offering.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/logme/model_offering_test.go b/services/logme/model_offering_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_offering_test.go +++ b/services/logme/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_partial_update_instance_payload.go b/services/logme/model_partial_update_instance_payload.go index 9882eab63..4d37b29e7 100644 --- a/services/logme/model_partial_update_instance_payload.go +++ b/services/logme/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_partial_update_instance_payload_test.go b/services/logme/model_partial_update_instance_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_partial_update_instance_payload_test.go +++ b/services/logme/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_plan.go b/services/logme/model_plan.go index 232d6174e..239ac2ec4 100644 --- a/services/logme/model_plan.go +++ b/services/logme/model_plan.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_plan_test.go b/services/logme/model_plan_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_plan_test.go +++ b/services/logme/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_raw_credentials.go b/services/logme/model_raw_credentials.go index b3c539c18..680445abd 100644 --- a/services/logme/model_raw_credentials.go +++ b/services/logme/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_raw_credentials_test.go b/services/logme/model_raw_credentials_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_raw_credentials_test.go +++ b/services/logme/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_restore.go b/services/logme/model_restore.go index 9b1c1fd24..dcb23d9b3 100644 --- a/services/logme/model_restore.go +++ b/services/logme/model_restore.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/logme/model_restore_test.go b/services/logme/model_restore_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_restore_test.go +++ b/services/logme/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_schema.go b/services/logme/model_schema.go index 1c317e149..82fae31eb 100644 --- a/services/logme/model_schema.go +++ b/services/logme/model_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_schema_test.go b/services/logme/model_schema_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_schema_test.go +++ b/services/logme/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_trigger_restore_response.go b/services/logme/model_trigger_restore_response.go index c0dc1e46d..af41e3def 100644 --- a/services/logme/model_trigger_restore_response.go +++ b/services/logme/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/logme/model_trigger_restore_response_test.go b/services/logme/model_trigger_restore_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_trigger_restore_response_test.go +++ b/services/logme/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_payload.go b/services/logme/model_update_backups_config_payload.go index 211111803..dbaad932d 100644 --- a/services/logme/model_update_backups_config_payload.go +++ b/services/logme/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_payload_test.go b/services/logme/model_update_backups_config_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_update_backups_config_payload_test.go +++ b/services/logme/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_response.go b/services/logme/model_update_backups_config_response.go index 51dcc459a..8a779c083 100644 --- a/services/logme/model_update_backups_config_response.go +++ b/services/logme/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_response_test.go b/services/logme/model_update_backups_config_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_update_backups_config_response_test.go +++ b/services/logme/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/oas_commit b/services/logme/oas_commit index c08a6770d..8b7f9dc93 100644 --- a/services/logme/oas_commit +++ b/services/logme/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +5e4c1a8bd29ab40368c4e0280227a140daab9352 diff --git a/services/logme/utils.go b/services/logme/utils.go index f92a95b36..c18b39605 100644 --- a/services/logme/utils.go +++ b/services/logme/utils.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/api_default.go b/services/logme/v1api/api_default.go index 10b40366b..c422924b1 100644 --- a/services/logme/v1api/api_default.go +++ b/services/logme/v1api/api_default.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/logme/v1api/api_default_mock.go b/services/logme/v1api/api_default_mock.go index efa82edf5..3980424fc 100644 --- a/services/logme/v1api/api_default_mock.go +++ b/services/logme/v1api/api_default_mock.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/client.go b/services/logme/v1api/client.go index b96af5730..4f276ed24 100644 --- a/services/logme/v1api/client.go +++ b/services/logme/v1api/client.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT LogMe API API v1.1.0 +// APIClient manages communication with the STACKIT LogMe API API v1.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/logme/v1api/configuration.go b/services/logme/v1api/configuration.go index 810454e9b..5e27af4c2 100644 --- a/services/logme/v1api/configuration.go +++ b/services/logme/v1api/configuration.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_backup.go b/services/logme/v1api/model_backup.go index c23e4121b..79fb75563 100644 --- a/services/logme/v1api/model_backup.go +++ b/services/logme/v1api/model_backup.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_backup_response_item.go b/services/logme/v1api/model_create_backup_response_item.go index 607c05450..1cf5006bb 100644 --- a/services/logme/v1api/model_create_backup_response_item.go +++ b/services/logme/v1api/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_credentials_payload.go b/services/logme/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..5260fd627 --- /dev/null +++ b/services/logme/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v1api/model_create_instance_payload.go b/services/logme/v1api/model_create_instance_payload.go index f12c285e3..b20eefa3c 100644 --- a/services/logme/v1api/model_create_instance_payload.go +++ b/services/logme/v1api/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_instance_response.go b/services/logme/v1api/model_create_instance_response.go index c44dbc62e..6a72ac99f 100644 --- a/services/logme/v1api/model_create_instance_response.go +++ b/services/logme/v1api/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials.go b/services/logme/v1api/model_credentials.go index b793188e5..4cd6fe5d5 100644 --- a/services/logme/v1api/model_credentials.go +++ b/services/logme/v1api/model_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials_list_item.go b/services/logme/v1api/model_credentials_list_item.go index 5cfa0ebca..58fb5ab8d 100644 --- a/services/logme/v1api/model_credentials_list_item.go +++ b/services/logme/v1api/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials_response.go b/services/logme/v1api/model_credentials_response.go index 626ce4ea5..fdeec4f42 100644 --- a/services/logme/v1api/model_credentials_response.go +++ b/services/logme/v1api/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_error.go b/services/logme/v1api/model_error.go index aaae49204..b41ecea54 100644 --- a/services/logme/v1api/model_error.go +++ b/services/logme/v1api/model_error.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_get_metrics_response.go b/services/logme/v1api/model_get_metrics_response.go index 2912e2402..ab6f29a45 100644 --- a/services/logme/v1api/model_get_metrics_response.go +++ b/services/logme/v1api/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance.go b/services/logme/v1api/model_instance.go index a185f9823..3d965402f 100644 --- a/services/logme/v1api/model_instance.go +++ b/services/logme/v1api/model_instance.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_last_operation.go b/services/logme/v1api/model_instance_last_operation.go index 5bc2ebf64..ccc434771 100644 --- a/services/logme/v1api/model_instance_last_operation.go +++ b/services/logme/v1api/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_last_operation_state.go b/services/logme/v1api/model_instance_last_operation_state.go index 51aaa8b7d..94610ae33 100644 --- a/services/logme/v1api/model_instance_last_operation_state.go +++ b/services/logme/v1api/model_instance_last_operation_state.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_last_operation_type.go b/services/logme/v1api/model_instance_last_operation_type.go index 9ee3a889a..2e0b78793 100644 --- a/services/logme/v1api/model_instance_last_operation_type.go +++ b/services/logme/v1api/model_instance_last_operation_type.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_parameters.go b/services/logme/v1api/model_instance_parameters.go index 3baedfb6b..6cfb4a2aa 100644 --- a/services/logme/v1api/model_instance_parameters.go +++ b/services/logme/v1api/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,14 +19,24 @@ var _ MappedNullable = &InstanceParameters{} // InstanceParameters struct for InstanceParameters type InstanceParameters struct { - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` - FluentdTls *int32 `json:"fluentd-tls,omitempty"` - FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTls *int32 `json:"fluentd-tls,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated FluentdTlsMaxVersion *string `json:"fluentd-tls-max-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated FluentdTlsMinVersion *string `json:"fluentd-tls-min-version,omitempty"` - FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` - FluentdUdp *int32 `json:"fluentd-udp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` + FluentdUdp *int32 `json:"fluentd-udp,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. Graphite *string `json:"graphite,omitempty"` Groks []InstanceParametersGroksInner `json:"groks,omitempty"` @@ -43,10 +53,14 @@ type InstanceParameters struct { // Frequency of metrics being emitted in seconds MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers []InstanceParametersOpensearchTlsCiphersInner `json:"opensearch-tls-ciphers,omitempty"` - OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsCiphers []InstanceParametersOpensearchTlsCiphersInner `json:"opensearch-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` Syslog []string `json:"syslog,omitempty"` @@ -177,6 +191,7 @@ func (o *InstanceParameters) SetFluentdTcp(v int32) { } // GetFluentdTls returns the FluentdTls field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTls() int32 { if o == nil || IsNil(o.FluentdTls) { var ret int32 @@ -187,6 +202,7 @@ func (o *InstanceParameters) GetFluentdTls() int32 { // GetFluentdTlsOk returns a tuple with the FluentdTls field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsOk() (*int32, bool) { if o == nil || IsNil(o.FluentdTls) { return nil, false @@ -204,11 +220,13 @@ func (o *InstanceParameters) HasFluentdTls() bool { } // SetFluentdTls gets a reference to the given int32 and assigns it to the FluentdTls field. +// Deprecated func (o *InstanceParameters) SetFluentdTls(v int32) { o.FluentdTls = &v } // GetFluentdTlsCiphers returns the FluentdTlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsCiphers() string { if o == nil || IsNil(o.FluentdTlsCiphers) { var ret string @@ -219,6 +237,7 @@ func (o *InstanceParameters) GetFluentdTlsCiphers() string { // GetFluentdTlsCiphersOk returns a tuple with the FluentdTlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsCiphersOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsCiphers) { return nil, false @@ -236,11 +255,13 @@ func (o *InstanceParameters) HasFluentdTlsCiphers() bool { } // SetFluentdTlsCiphers gets a reference to the given string and assigns it to the FluentdTlsCiphers field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsCiphers(v string) { o.FluentdTlsCiphers = &v } // GetFluentdTlsMaxVersion returns the FluentdTlsMaxVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { if o == nil || IsNil(o.FluentdTlsMaxVersion) { var ret string @@ -251,6 +272,7 @@ func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { // GetFluentdTlsMaxVersionOk returns a tuple with the FluentdTlsMaxVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMaxVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsMaxVersion) { return nil, false @@ -268,11 +290,13 @@ func (o *InstanceParameters) HasFluentdTlsMaxVersion() bool { } // SetFluentdTlsMaxVersion gets a reference to the given string and assigns it to the FluentdTlsMaxVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsMaxVersion(v string) { o.FluentdTlsMaxVersion = &v } // GetFluentdTlsMinVersion returns the FluentdTlsMinVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMinVersion() string { if o == nil || IsNil(o.FluentdTlsMinVersion) { var ret string @@ -283,6 +307,7 @@ func (o *InstanceParameters) GetFluentdTlsMinVersion() string { // GetFluentdTlsMinVersionOk returns a tuple with the FluentdTlsMinVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMinVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsMinVersion) { return nil, false @@ -300,11 +325,13 @@ func (o *InstanceParameters) HasFluentdTlsMinVersion() bool { } // SetFluentdTlsMinVersion gets a reference to the given string and assigns it to the FluentdTlsMinVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsMinVersion(v string) { o.FluentdTlsMinVersion = &v } // GetFluentdTlsVersion returns the FluentdTlsVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsVersion() string { if o == nil || IsNil(o.FluentdTlsVersion) { var ret string @@ -315,6 +342,7 @@ func (o *InstanceParameters) GetFluentdTlsVersion() string { // GetFluentdTlsVersionOk returns a tuple with the FluentdTlsVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsVersion) { return nil, false @@ -332,6 +360,7 @@ func (o *InstanceParameters) HasFluentdTlsVersion() bool { } // SetFluentdTlsVersion gets a reference to the given string and assigns it to the FluentdTlsVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsVersion(v string) { o.FluentdTlsVersion = &v } @@ -721,6 +750,7 @@ func (o *InstanceParameters) SetMonitoringInstanceId(v string) { } // GetOpensearchTlsCiphers returns the OpensearchTlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsCiphers() []InstanceParametersOpensearchTlsCiphersInner { if o == nil || IsNil(o.OpensearchTlsCiphers) { var ret []InstanceParametersOpensearchTlsCiphersInner @@ -731,6 +761,7 @@ func (o *InstanceParameters) GetOpensearchTlsCiphers() []InstanceParametersOpens // GetOpensearchTlsCiphersOk returns a tuple with the OpensearchTlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]InstanceParametersOpensearchTlsCiphersInner, bool) { if o == nil || IsNil(o.OpensearchTlsCiphers) { return nil, false @@ -748,11 +779,13 @@ func (o *InstanceParameters) HasOpensearchTlsCiphers() bool { } // SetOpensearchTlsCiphers gets a reference to the given []InstanceParametersOpensearchTlsCiphersInner and assigns it to the OpensearchTlsCiphers field. +// Deprecated func (o *InstanceParameters) SetOpensearchTlsCiphers(v []InstanceParametersOpensearchTlsCiphersInner) { o.OpensearchTlsCiphers = v } // GetOpensearchTlsProtocols returns the OpensearchTlsProtocols field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { if o == nil || IsNil(o.OpensearchTlsProtocols) { var ret []string @@ -763,6 +796,7 @@ func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { // GetOpensearchTlsProtocolsOk returns a tuple with the OpensearchTlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsProtocolsOk() ([]string, bool) { if o == nil || IsNil(o.OpensearchTlsProtocols) { return nil, false @@ -780,6 +814,7 @@ func (o *InstanceParameters) HasOpensearchTlsProtocols() bool { } // SetOpensearchTlsProtocols gets a reference to the given []string and assigns it to the OpensearchTlsProtocols field. +// Deprecated func (o *InstanceParameters) SetOpensearchTlsProtocols(v []string) { o.OpensearchTlsProtocols = v } diff --git a/services/logme/v1api/model_instance_parameters_groks_inner.go b/services/logme/v1api/model_instance_parameters_groks_inner.go index ebd57ae73..8109d0b0c 100644 --- a/services/logme/v1api/model_instance_parameters_groks_inner.go +++ b/services/logme/v1api/model_instance_parameters_groks_inner.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go b/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go index 6f87eb47a..d46935b14 100644 --- a/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go +++ b/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_schema.go b/services/logme/v1api/model_instance_schema.go index fa8ed2dc0..b53fa6c5a 100644 --- a/services/logme/v1api/model_instance_schema.go +++ b/services/logme/v1api/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_status.go b/services/logme/v1api/model_instance_status.go index 2d1b8bb55..c7cd1c0ba 100644 --- a/services/logme/v1api/model_instance_status.go +++ b/services/logme/v1api/model_instance_status.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_backups_response.go b/services/logme/v1api/model_list_backups_response.go index 79cb6f65b..7d611bb21 100644 --- a/services/logme/v1api/model_list_backups_response.go +++ b/services/logme/v1api/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_credentials_response.go b/services/logme/v1api/model_list_credentials_response.go index 3d8480c51..acc60665d 100644 --- a/services/logme/v1api/model_list_credentials_response.go +++ b/services/logme/v1api/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_instances_response.go b/services/logme/v1api/model_list_instances_response.go index 8da663c4a..ac16e5bd0 100644 --- a/services/logme/v1api/model_list_instances_response.go +++ b/services/logme/v1api/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_offerings_response.go b/services/logme/v1api/model_list_offerings_response.go index cc17d2ab6..5a6055660 100644 --- a/services/logme/v1api/model_list_offerings_response.go +++ b/services/logme/v1api/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_restores_response.go b/services/logme/v1api/model_list_restores_response.go index c46866fe8..c20484aac 100644 --- a/services/logme/v1api/model_list_restores_response.go +++ b/services/logme/v1api/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_offering.go b/services/logme/v1api/model_offering.go index 6b6753ac6..7f0451413 100644 --- a/services/logme/v1api/model_offering.go +++ b/services/logme/v1api/model_offering.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_partial_update_instance_payload.go b/services/logme/v1api/model_partial_update_instance_payload.go index 4be8ecea4..86256146a 100644 --- a/services/logme/v1api/model_partial_update_instance_payload.go +++ b/services/logme/v1api/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_plan.go b/services/logme/v1api/model_plan.go index 7a8bbc416..a8e76b5f7 100644 --- a/services/logme/v1api/model_plan.go +++ b/services/logme/v1api/model_plan.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_raw_credentials.go b/services/logme/v1api/model_raw_credentials.go index cb1a468b1..5c9ce5352 100644 --- a/services/logme/v1api/model_raw_credentials.go +++ b/services/logme/v1api/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_restore.go b/services/logme/v1api/model_restore.go index 5db9fd906..023d5508f 100644 --- a/services/logme/v1api/model_restore.go +++ b/services/logme/v1api/model_restore.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_schema.go b/services/logme/v1api/model_schema.go index 3e78e7b6c..351fd1495 100644 --- a/services/logme/v1api/model_schema.go +++ b/services/logme/v1api/model_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_trigger_restore_response.go b/services/logme/v1api/model_trigger_restore_response.go index 26c7d3096..65892e9cc 100644 --- a/services/logme/v1api/model_trigger_restore_response.go +++ b/services/logme/v1api/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_update_backups_config_payload.go b/services/logme/v1api/model_update_backups_config_payload.go index 9e27e1332..ddca6d14b 100644 --- a/services/logme/v1api/model_update_backups_config_payload.go +++ b/services/logme/v1api/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_update_backups_config_response.go b/services/logme/v1api/model_update_backups_config_response.go index 2660d765c..2c60ee860 100644 --- a/services/logme/v1api/model_update_backups_config_response.go +++ b/services/logme/v1api/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/response.go b/services/logme/v1api/response.go index 0ce0024d3..7e808fccf 100644 --- a/services/logme/v1api/response.go +++ b/services/logme/v1api/response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/utils.go b/services/logme/v1api/utils.go index 13ded495b..4ab007378 100644 --- a/services/logme/v1api/utils.go +++ b/services/logme/v1api/utils.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v2api/api_default.go b/services/logme/v2api/api_default.go new file mode 100644 index 000000000..2685b9ede --- /dev/null +++ b/services/logme/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 410 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupsConfigPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/logme/v2api/api_default_mock.go b/services/logme/v2api/api_default_mock.go new file mode 100644 index 000000000..19281499a --- /dev/null +++ b/services/logme/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/logme/v2api/client.go b/services/logme/v2api/client.go new file mode 100644 index 000000000..640a4c52a --- /dev/null +++ b/services/logme/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT LogMe API API v2.1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/logme/v2api/configuration.go b/services/logme/v2api/configuration.go new file mode 100644 index 000000000..0f3683908 --- /dev/null +++ b/services/logme/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/logme", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://logme.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/logme/v2api/model_backup.go b/services/logme/v2api/model_backup.go new file mode 100644 index 000000000..49f359ff1 --- /dev/null +++ b/services/logme/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_backup_response_item.go b/services/logme/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..014a6c6f5 --- /dev/null +++ b/services/logme/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_credentials_payload.go b/services/logme/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..bcf174339 --- /dev/null +++ b/services/logme/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_instance_payload.go b/services/logme/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..376f7e955 --- /dev/null +++ b/services/logme/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_instance_response.go b/services/logme/v2api/model_create_instance_response.go new file mode 100644 index 000000000..af5ee249e --- /dev/null +++ b/services/logme/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials.go b/services/logme/v2api/model_credentials.go new file mode 100644 index 000000000..b8ef553e8 --- /dev/null +++ b/services/logme/v2api/model_credentials.go @@ -0,0 +1,335 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + SyslogDrainUrl *string `json:"syslog_drain_url,omitempty"` + Uri *string `json:"uri,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetSyslogDrainUrl returns the SyslogDrainUrl field value if set, zero value otherwise. +func (o *Credentials) GetSyslogDrainUrl() string { + if o == nil || IsNil(o.SyslogDrainUrl) { + var ret string + return ret + } + return *o.SyslogDrainUrl +} + +// GetSyslogDrainUrlOk returns a tuple with the SyslogDrainUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetSyslogDrainUrlOk() (*string, bool) { + if o == nil || IsNil(o.SyslogDrainUrl) { + return nil, false + } + return o.SyslogDrainUrl, true +} + +// HasSyslogDrainUrl returns a boolean if a field has been set. +func (o *Credentials) HasSyslogDrainUrl() bool { + if o != nil && !IsNil(o.SyslogDrainUrl) { + return true + } + + return false +} + +// SetSyslogDrainUrl gets a reference to the given string and assigns it to the SyslogDrainUrl field. +func (o *Credentials) SetSyslogDrainUrl(v string) { + o.SyslogDrainUrl = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.SyslogDrainUrl) { + toSerialize["syslog_drain_url"] = o.SyslogDrainUrl + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "syslog_drain_url") + delete(additionalProperties, "uri") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials_list_item.go b/services/logme/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..3abb49449 --- /dev/null +++ b/services/logme/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials_response.go b/services/logme/v2api/model_credentials_response.go new file mode 100644 index 000000000..11aa710e3 --- /dev/null +++ b/services/logme/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_error.go b/services/logme/v2api/model_error.go new file mode 100644 index 000000000..c03943e94 --- /dev/null +++ b/services/logme/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_get_metrics_response.go b/services/logme/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..ffeea837a --- /dev/null +++ b/services/logme/v2api/model_get_metrics_response.go @@ -0,0 +1,857 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + OpensearchDashboardURL string `json:"opensearchDashboardURL"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, opensearchDashboardURL string, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.OpensearchDashboardURL = opensearchDashboardURL + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetOpensearchDashboardURL returns the OpensearchDashboardURL field value +func (o *GetMetricsResponse) GetOpensearchDashboardURL() string { + if o == nil { + var ret string + return ret + } + + return o.OpensearchDashboardURL +} + +// GetOpensearchDashboardURLOk returns a tuple with the OpensearchDashboardURL field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetOpensearchDashboardURLOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OpensearchDashboardURL, true +} + +// SetOpensearchDashboardURL sets field value +func (o *GetMetricsResponse) SetOpensearchDashboardURL(v string) { + o.OpensearchDashboardURL = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["opensearchDashboardURL"] = o.OpensearchDashboardURL + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "opensearchDashboardURL", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "opensearchDashboardURL") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance.go b/services/logme/v2api/model_instance.go new file mode 100644 index 000000000..03f1f0628 --- /dev/null +++ b/services/logme/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *InstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) GetStatus() InstanceStatus { + if o == nil || IsNil(o.Status) { + var ret InstanceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Instance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_last_operation.go b/services/logme/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..35d4286a9 --- /dev/null +++ b/services/logme/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { + if o == nil { + var ret InstanceLastOperationState + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { + if o == nil { + var ret InstanceLastOperationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_last_operation_state.go b/services/logme/v2api/model_instance_last_operation_state.go new file mode 100644 index 000000000..79dca14e6 --- /dev/null +++ b/services/logme/v2api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_last_operation_type.go b/services/logme/v2api/model_instance_last_operation_type.go new file mode 100644 index 000000000..c71edb050 --- /dev/null +++ b/services/logme/v2api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_parameters.go b/services/logme/v2api/model_instance_parameters.go new file mode 100644 index 000000000..67c7dc99d --- /dev/null +++ b/services/logme/v2api/model_instance_parameters.go @@ -0,0 +1,1050 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTls *int32 `json:"fluentd-tls,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsMaxVersion *string `json:"fluentd-tls-max-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsMinVersion *string `json:"fluentd-tls-min-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` + FluentdUdp *int32 `json:"fluentd-udp,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + Groks []InstanceParametersGroksInner `json:"groks,omitempty"` + // Combination of an integer and a timerange when an index will be considered 'd' and can be deleted from OpenSearch. Possible values for the timerange are s, m, h and d. + IsmDeletionAfter *string `json:"ism_deletion_after,omitempty"` + IsmJitter *float32 `json:"ism_jitter,omitempty"` + IsmJobInterval *int32 `json:"ism_job_interval,omitempty"` + // Default: not set, 46% of available memory will be used. The amount of memory (in MB) allocated as heap by the JVM for OpenSearch. + JavaHeapspace *int32 `json:"java_heapspace,omitempty"` + // The amount of memory (in MB) used by the JVM to store metadata for OpenSearch. + JavaMaxmetaspace *int32 `json:"java_maxmetaspace,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsCiphers []InstanceParametersOpensearchTlsCiphersInner `json:"opensearch-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var fluentdTcp int32 = 0 + this.FluentdTcp = &fluentdTcp + var fluentdTls int32 = 6514 + this.FluentdTls = &fluentdTls + var fluentdUdp int32 = 514 + this.FluentdUdp = &fluentdUdp + var ismDeletionAfter string = "30d" + this.IsmDeletionAfter = &ismDeletionAfter + var ismJitter float32 = 0.6 + this.IsmJitter = &ismJitter + var ismJobInterval int32 = 5 + this.IsmJobInterval = &ismJobInterval + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var fluentdTcp int32 = 0 + this.FluentdTcp = &fluentdTcp + var fluentdTls int32 = 6514 + this.FluentdTls = &fluentdTls + var fluentdUdp int32 = 514 + this.FluentdUdp = &fluentdUdp + var ismDeletionAfter string = "30d" + this.IsmDeletionAfter = &ismDeletionAfter + var ismJitter float32 = 0.6 + this.IsmJitter = &ismJitter + var ismJobInterval int32 = 5 + this.IsmJobInterval = &ismJobInterval + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetFluentdTcp returns the FluentdTcp field value if set, zero value otherwise. +func (o *InstanceParameters) GetFluentdTcp() int32 { + if o == nil || IsNil(o.FluentdTcp) { + var ret int32 + return ret + } + return *o.FluentdTcp +} + +// GetFluentdTcpOk returns a tuple with the FluentdTcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetFluentdTcpOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdTcp) { + return nil, false + } + return o.FluentdTcp, true +} + +// HasFluentdTcp returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTcp() bool { + if o != nil && !IsNil(o.FluentdTcp) { + return true + } + + return false +} + +// SetFluentdTcp gets a reference to the given int32 and assigns it to the FluentdTcp field. +func (o *InstanceParameters) SetFluentdTcp(v int32) { + o.FluentdTcp = &v +} + +// GetFluentdTls returns the FluentdTls field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTls() int32 { + if o == nil || IsNil(o.FluentdTls) { + var ret int32 + return ret + } + return *o.FluentdTls +} + +// GetFluentdTlsOk returns a tuple with the FluentdTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdTls) { + return nil, false + } + return o.FluentdTls, true +} + +// HasFluentdTls returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTls() bool { + if o != nil && !IsNil(o.FluentdTls) { + return true + } + + return false +} + +// SetFluentdTls gets a reference to the given int32 and assigns it to the FluentdTls field. +// Deprecated +func (o *InstanceParameters) SetFluentdTls(v int32) { + o.FluentdTls = &v +} + +// GetFluentdTlsCiphers returns the FluentdTlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsCiphers() string { + if o == nil || IsNil(o.FluentdTlsCiphers) { + var ret string + return ret + } + return *o.FluentdTlsCiphers +} + +// GetFluentdTlsCiphersOk returns a tuple with the FluentdTlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsCiphersOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsCiphers) { + return nil, false + } + return o.FluentdTlsCiphers, true +} + +// HasFluentdTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsCiphers() bool { + if o != nil && !IsNil(o.FluentdTlsCiphers) { + return true + } + + return false +} + +// SetFluentdTlsCiphers gets a reference to the given string and assigns it to the FluentdTlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsCiphers(v string) { + o.FluentdTlsCiphers = &v +} + +// GetFluentdTlsMaxVersion returns the FluentdTlsMaxVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { + if o == nil || IsNil(o.FluentdTlsMaxVersion) { + var ret string + return ret + } + return *o.FluentdTlsMaxVersion +} + +// GetFluentdTlsMaxVersionOk returns a tuple with the FluentdTlsMaxVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMaxVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsMaxVersion) { + return nil, false + } + return o.FluentdTlsMaxVersion, true +} + +// HasFluentdTlsMaxVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsMaxVersion() bool { + if o != nil && !IsNil(o.FluentdTlsMaxVersion) { + return true + } + + return false +} + +// SetFluentdTlsMaxVersion gets a reference to the given string and assigns it to the FluentdTlsMaxVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsMaxVersion(v string) { + o.FluentdTlsMaxVersion = &v +} + +// GetFluentdTlsMinVersion returns the FluentdTlsMinVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMinVersion() string { + if o == nil || IsNil(o.FluentdTlsMinVersion) { + var ret string + return ret + } + return *o.FluentdTlsMinVersion +} + +// GetFluentdTlsMinVersionOk returns a tuple with the FluentdTlsMinVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMinVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsMinVersion) { + return nil, false + } + return o.FluentdTlsMinVersion, true +} + +// HasFluentdTlsMinVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsMinVersion() bool { + if o != nil && !IsNil(o.FluentdTlsMinVersion) { + return true + } + + return false +} + +// SetFluentdTlsMinVersion gets a reference to the given string and assigns it to the FluentdTlsMinVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsMinVersion(v string) { + o.FluentdTlsMinVersion = &v +} + +// GetFluentdTlsVersion returns the FluentdTlsVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsVersion() string { + if o == nil || IsNil(o.FluentdTlsVersion) { + var ret string + return ret + } + return *o.FluentdTlsVersion +} + +// GetFluentdTlsVersionOk returns a tuple with the FluentdTlsVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsVersion) { + return nil, false + } + return o.FluentdTlsVersion, true +} + +// HasFluentdTlsVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsVersion() bool { + if o != nil && !IsNil(o.FluentdTlsVersion) { + return true + } + + return false +} + +// SetFluentdTlsVersion gets a reference to the given string and assigns it to the FluentdTlsVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsVersion(v string) { + o.FluentdTlsVersion = &v +} + +// GetFluentdUdp returns the FluentdUdp field value if set, zero value otherwise. +func (o *InstanceParameters) GetFluentdUdp() int32 { + if o == nil || IsNil(o.FluentdUdp) { + var ret int32 + return ret + } + return *o.FluentdUdp +} + +// GetFluentdUdpOk returns a tuple with the FluentdUdp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetFluentdUdpOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdUdp) { + return nil, false + } + return o.FluentdUdp, true +} + +// HasFluentdUdp returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdUdp() bool { + if o != nil && !IsNil(o.FluentdUdp) { + return true + } + + return false +} + +// SetFluentdUdp gets a reference to the given int32 and assigns it to the FluentdUdp field. +func (o *InstanceParameters) SetFluentdUdp(v int32) { + o.FluentdUdp = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetGroks returns the Groks field value if set, zero value otherwise. +func (o *InstanceParameters) GetGroks() []InstanceParametersGroksInner { + if o == nil || IsNil(o.Groks) { + var ret []InstanceParametersGroksInner + return ret + } + return o.Groks +} + +// GetGroksOk returns a tuple with the Groks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGroksOk() ([]InstanceParametersGroksInner, bool) { + if o == nil || IsNil(o.Groks) { + return nil, false + } + return o.Groks, true +} + +// HasGroks returns a boolean if a field has been set. +func (o *InstanceParameters) HasGroks() bool { + if o != nil && !IsNil(o.Groks) { + return true + } + + return false +} + +// SetGroks gets a reference to the given []InstanceParametersGroksInner and assigns it to the Groks field. +func (o *InstanceParameters) SetGroks(v []InstanceParametersGroksInner) { + o.Groks = v +} + +// GetIsmDeletionAfter returns the IsmDeletionAfter field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmDeletionAfter() string { + if o == nil || IsNil(o.IsmDeletionAfter) { + var ret string + return ret + } + return *o.IsmDeletionAfter +} + +// GetIsmDeletionAfterOk returns a tuple with the IsmDeletionAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmDeletionAfterOk() (*string, bool) { + if o == nil || IsNil(o.IsmDeletionAfter) { + return nil, false + } + return o.IsmDeletionAfter, true +} + +// HasIsmDeletionAfter returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmDeletionAfter() bool { + if o != nil && !IsNil(o.IsmDeletionAfter) { + return true + } + + return false +} + +// SetIsmDeletionAfter gets a reference to the given string and assigns it to the IsmDeletionAfter field. +func (o *InstanceParameters) SetIsmDeletionAfter(v string) { + o.IsmDeletionAfter = &v +} + +// GetIsmJitter returns the IsmJitter field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmJitter() float32 { + if o == nil || IsNil(o.IsmJitter) { + var ret float32 + return ret + } + return *o.IsmJitter +} + +// GetIsmJitterOk returns a tuple with the IsmJitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmJitterOk() (*float32, bool) { + if o == nil || IsNil(o.IsmJitter) { + return nil, false + } + return o.IsmJitter, true +} + +// HasIsmJitter returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmJitter() bool { + if o != nil && !IsNil(o.IsmJitter) { + return true + } + + return false +} + +// SetIsmJitter gets a reference to the given float32 and assigns it to the IsmJitter field. +func (o *InstanceParameters) SetIsmJitter(v float32) { + o.IsmJitter = &v +} + +// GetIsmJobInterval returns the IsmJobInterval field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmJobInterval() int32 { + if o == nil || IsNil(o.IsmJobInterval) { + var ret int32 + return ret + } + return *o.IsmJobInterval +} + +// GetIsmJobIntervalOk returns a tuple with the IsmJobInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmJobIntervalOk() (*int32, bool) { + if o == nil || IsNil(o.IsmJobInterval) { + return nil, false + } + return o.IsmJobInterval, true +} + +// HasIsmJobInterval returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmJobInterval() bool { + if o != nil && !IsNil(o.IsmJobInterval) { + return true + } + + return false +} + +// SetIsmJobInterval gets a reference to the given int32 and assigns it to the IsmJobInterval field. +func (o *InstanceParameters) SetIsmJobInterval(v int32) { + o.IsmJobInterval = &v +} + +// GetJavaHeapspace returns the JavaHeapspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaHeapspace() int32 { + if o == nil || IsNil(o.JavaHeapspace) { + var ret int32 + return ret + } + return *o.JavaHeapspace +} + +// GetJavaHeapspaceOk returns a tuple with the JavaHeapspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaHeapspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaHeapspace) { + return nil, false + } + return o.JavaHeapspace, true +} + +// HasJavaHeapspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaHeapspace() bool { + if o != nil && !IsNil(o.JavaHeapspace) { + return true + } + + return false +} + +// SetJavaHeapspace gets a reference to the given int32 and assigns it to the JavaHeapspace field. +func (o *InstanceParameters) SetJavaHeapspace(v int32) { + o.JavaHeapspace = &v +} + +// GetJavaMaxmetaspace returns the JavaMaxmetaspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaMaxmetaspace() int32 { + if o == nil || IsNil(o.JavaMaxmetaspace) { + var ret int32 + return ret + } + return *o.JavaMaxmetaspace +} + +// GetJavaMaxmetaspaceOk returns a tuple with the JavaMaxmetaspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaMaxmetaspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaMaxmetaspace) { + return nil, false + } + return o.JavaMaxmetaspace, true +} + +// HasJavaMaxmetaspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaMaxmetaspace() bool { + if o != nil && !IsNil(o.JavaMaxmetaspace) { + return true + } + + return false +} + +// SetJavaMaxmetaspace gets a reference to the given int32 and assigns it to the JavaMaxmetaspace field. +func (o *InstanceParameters) SetJavaMaxmetaspace(v int32) { + o.JavaMaxmetaspace = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetOpensearchTlsCiphers returns the OpensearchTlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsCiphers() []InstanceParametersOpensearchTlsCiphersInner { + if o == nil || IsNil(o.OpensearchTlsCiphers) { + var ret []InstanceParametersOpensearchTlsCiphersInner + return ret + } + return o.OpensearchTlsCiphers +} + +// GetOpensearchTlsCiphersOk returns a tuple with the OpensearchTlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]InstanceParametersOpensearchTlsCiphersInner, bool) { + if o == nil || IsNil(o.OpensearchTlsCiphers) { + return nil, false + } + return o.OpensearchTlsCiphers, true +} + +// HasOpensearchTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasOpensearchTlsCiphers() bool { + if o != nil && !IsNil(o.OpensearchTlsCiphers) { + return true + } + + return false +} + +// SetOpensearchTlsCiphers gets a reference to the given []InstanceParametersOpensearchTlsCiphersInner and assigns it to the OpensearchTlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetOpensearchTlsCiphers(v []InstanceParametersOpensearchTlsCiphersInner) { + o.OpensearchTlsCiphers = v +} + +// GetOpensearchTlsProtocols returns the OpensearchTlsProtocols field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { + if o == nil || IsNil(o.OpensearchTlsProtocols) { + var ret []string + return ret + } + return o.OpensearchTlsProtocols +} + +// GetOpensearchTlsProtocolsOk returns a tuple with the OpensearchTlsProtocols field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsProtocolsOk() ([]string, bool) { + if o == nil || IsNil(o.OpensearchTlsProtocols) { + return nil, false + } + return o.OpensearchTlsProtocols, true +} + +// HasOpensearchTlsProtocols returns a boolean if a field has been set. +func (o *InstanceParameters) HasOpensearchTlsProtocols() bool { + if o != nil && !IsNil(o.OpensearchTlsProtocols) { + return true + } + + return false +} + +// SetOpensearchTlsProtocols gets a reference to the given []string and assigns it to the OpensearchTlsProtocols field. +// Deprecated +func (o *InstanceParameters) SetOpensearchTlsProtocols(v []string) { + o.OpensearchTlsProtocols = v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.FluentdTcp) { + toSerialize["fluentd-tcp"] = o.FluentdTcp + } + if !IsNil(o.FluentdTls) { + toSerialize["fluentd-tls"] = o.FluentdTls + } + if !IsNil(o.FluentdTlsCiphers) { + toSerialize["fluentd-tls-ciphers"] = o.FluentdTlsCiphers + } + if !IsNil(o.FluentdTlsMaxVersion) { + toSerialize["fluentd-tls-max-version"] = o.FluentdTlsMaxVersion + } + if !IsNil(o.FluentdTlsMinVersion) { + toSerialize["fluentd-tls-min-version"] = o.FluentdTlsMinVersion + } + if !IsNil(o.FluentdTlsVersion) { + toSerialize["fluentd-tls-version"] = o.FluentdTlsVersion + } + if !IsNil(o.FluentdUdp) { + toSerialize["fluentd-udp"] = o.FluentdUdp + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.Groks) { + toSerialize["groks"] = o.Groks + } + if !IsNil(o.IsmDeletionAfter) { + toSerialize["ism_deletion_after"] = o.IsmDeletionAfter + } + if !IsNil(o.IsmJitter) { + toSerialize["ism_jitter"] = o.IsmJitter + } + if !IsNil(o.IsmJobInterval) { + toSerialize["ism_job_interval"] = o.IsmJobInterval + } + if !IsNil(o.JavaHeapspace) { + toSerialize["java_heapspace"] = o.JavaHeapspace + } + if !IsNil(o.JavaMaxmetaspace) { + toSerialize["java_maxmetaspace"] = o.JavaMaxmetaspace + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.OpensearchTlsCiphers) { + toSerialize["opensearch-tls-ciphers"] = o.OpensearchTlsCiphers + } + if !IsNil(o.OpensearchTlsProtocols) { + toSerialize["opensearch-tls-protocols"] = o.OpensearchTlsProtocols + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "fluentd-tcp") + delete(additionalProperties, "fluentd-tls") + delete(additionalProperties, "fluentd-tls-ciphers") + delete(additionalProperties, "fluentd-tls-max-version") + delete(additionalProperties, "fluentd-tls-min-version") + delete(additionalProperties, "fluentd-tls-version") + delete(additionalProperties, "fluentd-udp") + delete(additionalProperties, "graphite") + delete(additionalProperties, "groks") + delete(additionalProperties, "ism_deletion_after") + delete(additionalProperties, "ism_jitter") + delete(additionalProperties, "ism_job_interval") + delete(additionalProperties, "java_heapspace") + delete(additionalProperties, "java_maxmetaspace") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "opensearch-tls-ciphers") + delete(additionalProperties, "opensearch-tls-protocols") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "syslog") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_parameters_groks_inner.go b/services/logme/v2api/model_instance_parameters_groks_inner.go new file mode 100644 index 000000000..f565961b4 --- /dev/null +++ b/services/logme/v2api/model_instance_parameters_groks_inner.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParametersGroksInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParametersGroksInner{} + +// InstanceParametersGroksInner struct for InstanceParametersGroksInner +type InstanceParametersGroksInner struct { + Pattern *string `json:"pattern,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParametersGroksInner InstanceParametersGroksInner + +// NewInstanceParametersGroksInner instantiates a new InstanceParametersGroksInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParametersGroksInner() *InstanceParametersGroksInner { + this := InstanceParametersGroksInner{} + return &this +} + +// NewInstanceParametersGroksInnerWithDefaults instantiates a new InstanceParametersGroksInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersGroksInnerWithDefaults() *InstanceParametersGroksInner { + this := InstanceParametersGroksInner{} + return &this +} + +// GetPattern returns the Pattern field value if set, zero value otherwise. +func (o *InstanceParametersGroksInner) GetPattern() string { + if o == nil || IsNil(o.Pattern) { + var ret string + return ret + } + return *o.Pattern +} + +// GetPatternOk returns a tuple with the Pattern field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParametersGroksInner) GetPatternOk() (*string, bool) { + if o == nil || IsNil(o.Pattern) { + return nil, false + } + return o.Pattern, true +} + +// HasPattern returns a boolean if a field has been set. +func (o *InstanceParametersGroksInner) HasPattern() bool { + if o != nil && !IsNil(o.Pattern) { + return true + } + + return false +} + +// SetPattern gets a reference to the given string and assigns it to the Pattern field. +func (o *InstanceParametersGroksInner) SetPattern(v string) { + o.Pattern = &v +} + +func (o InstanceParametersGroksInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParametersGroksInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pattern) { + toSerialize["pattern"] = o.Pattern + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParametersGroksInner) UnmarshalJSON(data []byte) (err error) { + varInstanceParametersGroksInner := _InstanceParametersGroksInner{} + + err = json.Unmarshal(data, &varInstanceParametersGroksInner) + + if err != nil { + return err + } + + *o = InstanceParametersGroksInner(varInstanceParametersGroksInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pattern") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParametersGroksInner struct { + value *InstanceParametersGroksInner + isSet bool +} + +func (v NullableInstanceParametersGroksInner) Get() *InstanceParametersGroksInner { + return v.value +} + +func (v *NullableInstanceParametersGroksInner) Set(val *InstanceParametersGroksInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersGroksInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersGroksInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersGroksInner(val *InstanceParametersGroksInner) *NullableInstanceParametersGroksInner { + return &NullableInstanceParametersGroksInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersGroksInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersGroksInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_parameters_opensearch_tls_ciphers_inner.go b/services/logme/v2api/model_instance_parameters_opensearch_tls_ciphers_inner.go new file mode 100644 index 000000000..4e9983a37 --- /dev/null +++ b/services/logme/v2api/model_instance_parameters_opensearch_tls_ciphers_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersOpensearchTlsCiphersInner the model 'InstanceParametersOpensearchTlsCiphersInner' +type InstanceParametersOpensearchTlsCiphersInner string + +// List of InstanceParameters_opensearch_tls_ciphers_inner +const ( + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_TLSV1_2 InstanceParametersOpensearchTlsCiphersInner = "TLSv1.2" + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_TLSV1_3 InstanceParametersOpensearchTlsCiphersInner = "TLSv1.3" + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersOpensearchTlsCiphersInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersOpensearchTlsCiphersInner enum +var AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues = []InstanceParametersOpensearchTlsCiphersInner{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersOpensearchTlsCiphersInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersOpensearchTlsCiphersInner(value) + for _, existing := range AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersOpensearchTlsCiphersInnerFromValue returns a pointer to a valid InstanceParametersOpensearchTlsCiphersInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersOpensearchTlsCiphersInnerFromValue(v string) (*InstanceParametersOpensearchTlsCiphersInner, error) { + ev := InstanceParametersOpensearchTlsCiphersInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersOpensearchTlsCiphersInner: valid values are %v", v, AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersOpensearchTlsCiphersInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_opensearch_tls_ciphers_inner value +func (v InstanceParametersOpensearchTlsCiphersInner) Ptr() *InstanceParametersOpensearchTlsCiphersInner { + return &v +} + +type NullableInstanceParametersOpensearchTlsCiphersInner struct { + value *InstanceParametersOpensearchTlsCiphersInner + isSet bool +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) Get() *InstanceParametersOpensearchTlsCiphersInner { + return v.value +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) Set(val *InstanceParametersOpensearchTlsCiphersInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersOpensearchTlsCiphersInner(val *InstanceParametersOpensearchTlsCiphersInner) *NullableInstanceParametersOpensearchTlsCiphersInner { + return &NullableInstanceParametersOpensearchTlsCiphersInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_schema.go b/services/logme/v2api/model_instance_schema.go new file mode 100644 index 000000000..21fc6b95f --- /dev/null +++ b/services/logme/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_status.go b/services/logme/v2api/model_instance_status.go new file mode 100644 index 000000000..6776e2c2a --- /dev/null +++ b/services/logme/v2api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_backups_response.go b/services/logme/v2api/model_list_backups_response.go new file mode 100644 index 000000000..2580b77c2 --- /dev/null +++ b/services/logme/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_credentials_response.go b/services/logme/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..66fc3d442 --- /dev/null +++ b/services/logme/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_instances_response.go b/services/logme/v2api/model_list_instances_response.go new file mode 100644 index 000000000..d4d9135d7 --- /dev/null +++ b/services/logme/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_offerings_response.go b/services/logme/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..a285907d4 --- /dev/null +++ b/services/logme/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_restores_response.go b/services/logme/v2api/model_list_restores_response.go new file mode 100644 index 000000000..9b804926f --- /dev/null +++ b/services/logme/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_offering.go b/services/logme/v2api/model_offering.go new file mode 100644 index 000000000..fe5a56f52 --- /dev/null +++ b/services/logme/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_partial_update_instance_payload.go b/services/logme/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..249356d14 --- /dev/null +++ b/services/logme/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_plan.go b/services/logme/v2api/model_plan.go new file mode 100644 index 000000000..6e1a73ffc --- /dev/null +++ b/services/logme/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_raw_credentials.go b/services/logme/v2api/model_raw_credentials.go new file mode 100644 index 000000000..fa6890bba --- /dev/null +++ b/services/logme/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_restore.go b/services/logme/v2api/model_restore.go new file mode 100644 index 000000000..292fc085e --- /dev/null +++ b/services/logme/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_schema.go b/services/logme/v2api/model_schema.go new file mode 100644 index 000000000..849ee64c5 --- /dev/null +++ b/services/logme/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_trigger_restore_response.go b/services/logme/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..7d7ec1a09 --- /dev/null +++ b/services/logme/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_update_backups_config_payload.go b/services/logme/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..6f2013e45 --- /dev/null +++ b/services/logme/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_update_backups_config_response.go b/services/logme/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..f1ffc9513 --- /dev/null +++ b/services/logme/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/response.go b/services/logme/v2api/response.go new file mode 100644 index 000000000..8aa724e42 --- /dev/null +++ b/services/logme/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/logme/v2api/utils.go b/services/logme/v2api/utils.go new file mode 100644 index 000000000..e9430bfc9 --- /dev/null +++ b/services/logme/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/mariadb/CHANGELOG.md b/services/mariadb/CHANGELOG.md index 8f62266dc..4f6950d47 100644 --- a/services/mariadb/CHANGELOG.md +++ b/services/mariadb/CHANGELOG.md @@ -1,3 +1,11 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v2api`: + - New package which can be used for communication with the mariadb v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + ## v0.30.0 - **Feature:** Introduce enums for various attributes diff --git a/services/mariadb/VERSION b/services/mariadb/VERSION index 29e939cda..60453e690 100644 --- a/services/mariadb/VERSION +++ b/services/mariadb/VERSION @@ -1 +1 @@ -v0.30.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/mariadb/api_default.go b/services/mariadb/api_default.go index eb919b2a8..2c419e8ea 100644 --- a/services/mariadb/api_default.go +++ b/services/mariadb/api_default.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/mariadb/client.go b/services/mariadb/client.go index e90e359c3..c9ac56a60 100644 --- a/services/mariadb/client.go +++ b/services/mariadb/client.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT MariaDB API API v1.1.0 +// APIClient manages communication with the STACKIT MariaDB API API v2.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/mariadb/configuration.go b/services/mariadb/configuration.go index 772a22859..c571f31eb 100644 --- a/services/mariadb/configuration.go +++ b/services/mariadb/configuration.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://mariadb.api.{region}stackit.cloud", + URL: "https://mariadb.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/mariadb/model_backup.go b/services/mariadb/model_backup.go index 8ee96ac62..d4152c500 100644 --- a/services/mariadb/model_backup.go +++ b/services/mariadb/model_backup.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/mariadb/model_backup_test.go b/services/mariadb/model_backup_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_backup_test.go +++ b/services/mariadb/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_create_backup_response_item.go b/services/mariadb/model_create_backup_response_item.go index 3a14feefb..780587b2e 100644 --- a/services/mariadb/model_create_backup_response_item.go +++ b/services/mariadb/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/mariadb/model_create_backup_response_item_test.go b/services/mariadb/model_create_backup_response_item_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_create_backup_response_item_test.go +++ b/services/mariadb/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_create_credentials_payload.go b/services/mariadb/model_create_credentials_payload.go new file mode 100644 index 000000000..24d320211 --- /dev/null +++ b/services/mariadb/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package mariadb + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/model_create_credentials_payload_test.go b/services/mariadb/model_create_credentials_payload_test.go new file mode 100644 index 000000000..732c6310d --- /dev/null +++ b/services/mariadb/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package mariadb diff --git a/services/mariadb/model_create_instance_payload.go b/services/mariadb/model_create_instance_payload.go index c4438407c..761afd3e7 100644 --- a/services/mariadb/model_create_instance_payload.go +++ b/services/mariadb/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_create_instance_payload_test.go b/services/mariadb/model_create_instance_payload_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_create_instance_payload_test.go +++ b/services/mariadb/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_create_instance_response.go b/services/mariadb/model_create_instance_response.go index c91d3c263..145dcec1d 100644 --- a/services/mariadb/model_create_instance_response.go +++ b/services/mariadb/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_create_instance_response_test.go b/services/mariadb/model_create_instance_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_create_instance_response_test.go +++ b/services/mariadb/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials.go b/services/mariadb/model_credentials.go index cea77e3b5..7c543fe88 100644 --- a/services/mariadb/model_credentials.go +++ b/services/mariadb/model_credentials.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials_list_item.go b/services/mariadb/model_credentials_list_item.go index 149725850..4c66d9d0f 100644 --- a/services/mariadb/model_credentials_list_item.go +++ b/services/mariadb/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials_list_item_test.go b/services/mariadb/model_credentials_list_item_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_credentials_list_item_test.go +++ b/services/mariadb/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials_response.go b/services/mariadb/model_credentials_response.go index e0daa1f73..8c575797e 100644 --- a/services/mariadb/model_credentials_response.go +++ b/services/mariadb/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials_response_test.go b/services/mariadb/model_credentials_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_credentials_response_test.go +++ b/services/mariadb/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_credentials_test.go b/services/mariadb/model_credentials_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_credentials_test.go +++ b/services/mariadb/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_error.go b/services/mariadb/model_error.go index 2f4aeea66..7ffb787a4 100644 --- a/services/mariadb/model_error.go +++ b/services/mariadb/model_error.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_error_test.go b/services/mariadb/model_error_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_error_test.go +++ b/services/mariadb/model_error_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_get_metrics_response.go b/services/mariadb/model_get_metrics_response.go index 338cd94ec..3794c9600 100644 --- a/services/mariadb/model_get_metrics_response.go +++ b/services/mariadb/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_get_metrics_response_test.go b/services/mariadb/model_get_metrics_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_get_metrics_response_test.go +++ b/services/mariadb/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance.go b/services/mariadb/model_instance.go index 9f679e279..3e85e1a47 100644 --- a/services/mariadb/model_instance.go +++ b/services/mariadb/model_instance.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_last_operation.go b/services/mariadb/model_instance_last_operation.go index 788a7444b..939ffe5be 100644 --- a/services/mariadb/model_instance_last_operation.go +++ b/services/mariadb/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_last_operation_test.go b/services/mariadb/model_instance_last_operation_test.go index b5003cf59..71921a507 100644 --- a/services/mariadb/model_instance_last_operation_test.go +++ b/services/mariadb/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_parameters.go b/services/mariadb/model_instance_parameters.go index 5f5424ca1..c598b33ed 100644 --- a/services/mariadb/model_instance_parameters.go +++ b/services/mariadb/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_parameters_test.go b/services/mariadb/model_instance_parameters_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_instance_parameters_test.go +++ b/services/mariadb/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_schema.go b/services/mariadb/model_instance_schema.go index 1484e5417..09f3d8ae7 100644 --- a/services/mariadb/model_instance_schema.go +++ b/services/mariadb/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_schema_test.go b/services/mariadb/model_instance_schema_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_instance_schema_test.go +++ b/services/mariadb/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_instance_test.go b/services/mariadb/model_instance_test.go index 800742fd4..aaefecfb0 100644 --- a/services/mariadb/model_instance_test.go +++ b/services/mariadb/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_backups_response.go b/services/mariadb/model_list_backups_response.go index 7a4e94ad6..38256022e 100644 --- a/services/mariadb/model_list_backups_response.go +++ b/services/mariadb/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_backups_response_test.go b/services/mariadb/model_list_backups_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_list_backups_response_test.go +++ b/services/mariadb/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_credentials_response.go b/services/mariadb/model_list_credentials_response.go index 76de4186b..9c62a3093 100644 --- a/services/mariadb/model_list_credentials_response.go +++ b/services/mariadb/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_credentials_response_test.go b/services/mariadb/model_list_credentials_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_list_credentials_response_test.go +++ b/services/mariadb/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_instances_response.go b/services/mariadb/model_list_instances_response.go index 30b63e2c8..2214dde83 100644 --- a/services/mariadb/model_list_instances_response.go +++ b/services/mariadb/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_instances_response_test.go b/services/mariadb/model_list_instances_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_list_instances_response_test.go +++ b/services/mariadb/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_offerings_response.go b/services/mariadb/model_list_offerings_response.go index 07bdac9c8..b53ab02bb 100644 --- a/services/mariadb/model_list_offerings_response.go +++ b/services/mariadb/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_offerings_response_test.go b/services/mariadb/model_list_offerings_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_list_offerings_response_test.go +++ b/services/mariadb/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_restores_response.go b/services/mariadb/model_list_restores_response.go index 42a89b9c4..39cbe4e0f 100644 --- a/services/mariadb/model_list_restores_response.go +++ b/services/mariadb/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_list_restores_response_test.go b/services/mariadb/model_list_restores_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_list_restores_response_test.go +++ b/services/mariadb/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_offering.go b/services/mariadb/model_offering.go index 1d4fe93d9..fad823ea4 100644 --- a/services/mariadb/model_offering.go +++ b/services/mariadb/model_offering.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/mariadb/model_offering_test.go b/services/mariadb/model_offering_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_offering_test.go +++ b/services/mariadb/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_partial_update_instance_payload.go b/services/mariadb/model_partial_update_instance_payload.go index 76497b1d6..e51dee62f 100644 --- a/services/mariadb/model_partial_update_instance_payload.go +++ b/services/mariadb/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_partial_update_instance_payload_test.go b/services/mariadb/model_partial_update_instance_payload_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_partial_update_instance_payload_test.go +++ b/services/mariadb/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_plan.go b/services/mariadb/model_plan.go index 62c8ee0ae..33d207bfa 100644 --- a/services/mariadb/model_plan.go +++ b/services/mariadb/model_plan.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_plan_test.go b/services/mariadb/model_plan_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_plan_test.go +++ b/services/mariadb/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_raw_credentials.go b/services/mariadb/model_raw_credentials.go index a2d8d6fa5..741ea6e19 100644 --- a/services/mariadb/model_raw_credentials.go +++ b/services/mariadb/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_raw_credentials_test.go b/services/mariadb/model_raw_credentials_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_raw_credentials_test.go +++ b/services/mariadb/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_restore.go b/services/mariadb/model_restore.go index 6e27c49bd..fb32f6cc0 100644 --- a/services/mariadb/model_restore.go +++ b/services/mariadb/model_restore.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/mariadb/model_restore_test.go b/services/mariadb/model_restore_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_restore_test.go +++ b/services/mariadb/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_schema.go b/services/mariadb/model_schema.go index bc0f79796..b5582c06d 100644 --- a/services/mariadb/model_schema.go +++ b/services/mariadb/model_schema.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_schema_test.go b/services/mariadb/model_schema_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_schema_test.go +++ b/services/mariadb/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_trigger_restore_response.go b/services/mariadb/model_trigger_restore_response.go index e39b00523..2347b955b 100644 --- a/services/mariadb/model_trigger_restore_response.go +++ b/services/mariadb/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/mariadb/model_trigger_restore_response_test.go b/services/mariadb/model_trigger_restore_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_trigger_restore_response_test.go +++ b/services/mariadb/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_update_backups_config_payload.go b/services/mariadb/model_update_backups_config_payload.go index 4aa70eb76..524f9a7c6 100644 --- a/services/mariadb/model_update_backups_config_payload.go +++ b/services/mariadb/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_update_backups_config_payload_test.go b/services/mariadb/model_update_backups_config_payload_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_update_backups_config_payload_test.go +++ b/services/mariadb/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_update_backups_config_response.go b/services/mariadb/model_update_backups_config_response.go index 641e98e04..61322e4ae 100644 --- a/services/mariadb/model_update_backups_config_response.go +++ b/services/mariadb/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/model_update_backups_config_response_test.go b/services/mariadb/model_update_backups_config_response_test.go index 69bc89d5d..732c6310d 100644 --- a/services/mariadb/model_update_backups_config_response_test.go +++ b/services/mariadb/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/oas_commit b/services/mariadb/oas_commit index c08a6770d..8b7f9dc93 100644 --- a/services/mariadb/oas_commit +++ b/services/mariadb/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +5e4c1a8bd29ab40368c4e0280227a140daab9352 diff --git a/services/mariadb/utils.go b/services/mariadb/utils.go index 3a171d5f8..cd2782ba8 100644 --- a/services/mariadb/utils.go +++ b/services/mariadb/utils.go @@ -3,7 +3,7 @@ STACKIT MariaDB API The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/mariadb/v1api/api_default.go b/services/mariadb/v1api/api_default.go index d9ff9effc..52a152fb8 100644 --- a/services/mariadb/v1api/api_default.go +++ b/services/mariadb/v1api/api_default.go @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/mariadb/v1api/model_create_credentials_payload.go b/services/mariadb/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..8824c97b5 --- /dev/null +++ b/services/mariadb/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/api_default.go b/services/mariadb/v2api/api_default.go new file mode 100644 index 000000000..537d62406 --- /dev/null +++ b/services/mariadb/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 410 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupsConfigPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/mariadb/v2api/api_default_mock.go b/services/mariadb/v2api/api_default_mock.go new file mode 100644 index 000000000..dff015d27 --- /dev/null +++ b/services/mariadb/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/mariadb/v2api/client.go b/services/mariadb/v2api/client.go new file mode 100644 index 000000000..e854909d3 --- /dev/null +++ b/services/mariadb/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT MariaDB API API v2.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/mariadb/v2api/configuration.go b/services/mariadb/v2api/configuration.go new file mode 100644 index 000000000..67bc0412e --- /dev/null +++ b/services/mariadb/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/mariadb", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://mariadb.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/mariadb/v2api/model_backup.go b/services/mariadb/v2api/model_backup.go new file mode 100644 index 000000000..768885c97 --- /dev/null +++ b/services/mariadb/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_create_backup_response_item.go b/services/mariadb/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..db59ee3d2 --- /dev/null +++ b/services/mariadb/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_create_credentials_payload.go b/services/mariadb/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..f38bf9d26 --- /dev/null +++ b/services/mariadb/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_create_instance_payload.go b/services/mariadb/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..52bfdde25 --- /dev/null +++ b/services/mariadb/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_create_instance_response.go b/services/mariadb/v2api/model_create_instance_response.go new file mode 100644 index 000000000..d7d0d0bba --- /dev/null +++ b/services/mariadb/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_credentials.go b/services/mariadb/v2api/model_credentials.go new file mode 100644 index 000000000..79ccd56ff --- /dev/null +++ b/services/mariadb/v2api/model_credentials.go @@ -0,0 +1,372 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Hosts []string `json:"hosts,omitempty"` + Name *string `json:"name,omitempty"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + Uri *string `json:"uri,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *Credentials) GetHosts() []string { + if o == nil || IsNil(o.Hosts) { + var ret []string + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostsOk() ([]string, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *Credentials) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []string and assigns it to the Hosts field. +func (o *Credentials) SetHosts(v []string) { + o.Hosts = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Credentials) 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 *Credentials) 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 *Credentials) 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 *Credentials) SetName(v string) { + o.Name = &v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "hosts") + delete(additionalProperties, "name") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "uri") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_credentials_list_item.go b/services/mariadb/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..d2cef4f0f --- /dev/null +++ b/services/mariadb/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_credentials_response.go b/services/mariadb/v2api/model_credentials_response.go new file mode 100644 index 000000000..cb08b1716 --- /dev/null +++ b/services/mariadb/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_error.go b/services/mariadb/v2api/model_error.go new file mode 100644 index 000000000..3dcd453b0 --- /dev/null +++ b/services/mariadb/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_get_metrics_response.go b/services/mariadb/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..a1f2bcf3e --- /dev/null +++ b/services/mariadb/v2api/model_get_metrics_response.go @@ -0,0 +1,828 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance.go b/services/mariadb/v2api/model_instance.go new file mode 100644 index 000000000..3a9118a60 --- /dev/null +++ b/services/mariadb/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *InstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) GetStatus() InstanceStatus { + if o == nil || IsNil(o.Status) { + var ret InstanceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Instance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_last_operation.go b/services/mariadb/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..04520174d --- /dev/null +++ b/services/mariadb/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { + if o == nil { + var ret InstanceLastOperationState + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { + if o == nil { + var ret InstanceLastOperationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_last_operation_state.go b/services/mariadb/v2api/model_instance_last_operation_state.go new file mode 100644 index 000000000..50f4f9767 --- /dev/null +++ b/services/mariadb/v2api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_last_operation_type.go b/services/mariadb/v2api/model_instance_last_operation_type.go new file mode 100644 index 000000000..0c3a6ea10 --- /dev/null +++ b/services/mariadb/v2api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_parameters.go b/services/mariadb/v2api/model_instance_parameters.go new file mode 100644 index 000000000..9d135d7c9 --- /dev/null +++ b/services/mariadb/v2api/model_instance_parameters.go @@ -0,0 +1,429 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "graphite") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "syslog") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_schema.go b/services/mariadb/v2api/model_instance_schema.go new file mode 100644 index 000000000..34079b5d4 --- /dev/null +++ b/services/mariadb/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_instance_status.go b/services/mariadb/v2api/model_instance_status.go new file mode 100644 index 000000000..243f9b0d5 --- /dev/null +++ b/services/mariadb/v2api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_list_backups_response.go b/services/mariadb/v2api/model_list_backups_response.go new file mode 100644 index 000000000..3506d7d59 --- /dev/null +++ b/services/mariadb/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_list_credentials_response.go b/services/mariadb/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..953f5f8b5 --- /dev/null +++ b/services/mariadb/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_list_instances_response.go b/services/mariadb/v2api/model_list_instances_response.go new file mode 100644 index 000000000..620806798 --- /dev/null +++ b/services/mariadb/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_list_offerings_response.go b/services/mariadb/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..19e3778c1 --- /dev/null +++ b/services/mariadb/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_list_restores_response.go b/services/mariadb/v2api/model_list_restores_response.go new file mode 100644 index 000000000..52e8ea18f --- /dev/null +++ b/services/mariadb/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_offering.go b/services/mariadb/v2api/model_offering.go new file mode 100644 index 000000000..da5f0c2de --- /dev/null +++ b/services/mariadb/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_partial_update_instance_payload.go b/services/mariadb/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..b74e755df --- /dev/null +++ b/services/mariadb/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_plan.go b/services/mariadb/v2api/model_plan.go new file mode 100644 index 000000000..f2bc1b45d --- /dev/null +++ b/services/mariadb/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_raw_credentials.go b/services/mariadb/v2api/model_raw_credentials.go new file mode 100644 index 000000000..64082d8cb --- /dev/null +++ b/services/mariadb/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_restore.go b/services/mariadb/v2api/model_restore.go new file mode 100644 index 000000000..154b16ab2 --- /dev/null +++ b/services/mariadb/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_schema.go b/services/mariadb/v2api/model_schema.go new file mode 100644 index 000000000..c7ae4a154 --- /dev/null +++ b/services/mariadb/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_trigger_restore_response.go b/services/mariadb/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..1e56fe950 --- /dev/null +++ b/services/mariadb/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_update_backups_config_payload.go b/services/mariadb/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..5b7deb468 --- /dev/null +++ b/services/mariadb/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/model_update_backups_config_response.go b/services/mariadb/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..bfc348037 --- /dev/null +++ b/services/mariadb/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v2api/response.go b/services/mariadb/v2api/response.go new file mode 100644 index 000000000..f08afbde9 --- /dev/null +++ b/services/mariadb/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/mariadb/v2api/utils.go b/services/mariadb/v2api/utils.go new file mode 100644 index 000000000..97c111bff --- /dev/null +++ b/services/mariadb/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/modelexperiments/CHANGELOG.md b/services/modelexperiments/CHANGELOG.md index 4794a642e..55a0c150e 100644 --- a/services/modelexperiments/CHANGELOG.md +++ b/services/modelexperiments/CHANGELOG.md @@ -1,2 +1,5 @@ +## v0.2.0 +- **New**: STACKIT Model Experiments module wait handler added. + ## v0.1.0 - **New**: API for STACKIT modelexperiments \ No newline at end of file diff --git a/services/modelexperiments/NOTICE.txt b/services/modelexperiments/NOTICE.txt index 80f267471..ae5b9e7f3 100644 --- a/services/modelexperiments/NOTICE.txt +++ b/services/modelexperiments/NOTICE.txt @@ -1,2 +1,2 @@ -STACKIT modelexperiments SDK for Go +STACKIT Model Experiments SDK for Go Copyright 2026 Schwarz IT KG \ No newline at end of file diff --git a/services/modelexperiments/VERSION b/services/modelexperiments/VERSION index 9ff151c5b..81fd7ba08 100644 --- a/services/modelexperiments/VERSION +++ b/services/modelexperiments/VERSION @@ -1 +1 @@ -v0.1.0 \ No newline at end of file +v0.2.0 \ No newline at end of file diff --git a/services/modelexperiments/go.mod b/services/modelexperiments/go.mod index 6ea1a4c6f..b62e53f0e 100644 --- a/services/modelexperiments/go.mod +++ b/services/modelexperiments/go.mod @@ -2,7 +2,10 @@ module github.com/stackitcloud/stackit-sdk-go/services/modelexperiments go 1.25 -require github.com/stackitcloud/stackit-sdk-go/core v0.26.0 +require ( + github.com/google/go-cmp v0.7.0 + github.com/stackitcloud/stackit-sdk-go/core v0.26.0 +) require ( github.com/golang-jwt/jwt/v5 v5.3.1 // indirect diff --git a/services/modelexperiments/v1api/wait/wait.go b/services/modelexperiments/v1api/wait/wait.go new file mode 100644 index 000000000..50a51392d --- /dev/null +++ b/services/modelexperiments/v1api/wait/wait.go @@ -0,0 +1,86 @@ +package wait + +import ( + "context" + "errors" + "net/http" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/wait" + modelexperiments "github.com/stackitcloud/stackit-sdk-go/services/modelexperiments/v1api" +) + +// CreateInstanceWaitHandler will wait for creation of Model Experiments instance +func CreateInstanceWaitHandler(ctx context.Context, a modelexperiments.DefaultAPI, region, projectId, instanceId string) *wait.AsyncActionHandler[modelexperiments.GetInstanceResponse] { + waitConfig := wait.WaiterHelper[modelexperiments.GetInstanceResponse, modelexperiments.InstanceState]{ + FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + GetState: func(response *modelexperiments.GetInstanceResponse) (modelexperiments.InstanceState, error) { + if response == nil { + return "", errors.New("empty response") + } + return response.Instance.State, nil + }, + ActiveState: []modelexperiments.InstanceState{modelexperiments.INSTANCESTATE_ACTIVE}, + ErrorState: []modelexperiments.InstanceState{modelexperiments.INSTANCESTATE_IMPAIRED}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) + return handler +} + +// DeleteInstanceWaitHandler will wait for deletion of Model Experiments instance +func DeleteInstanceWaitHandler(ctx context.Context, a modelexperiments.DefaultAPI, region, projectId, instanceId string) *wait.AsyncActionHandler[modelexperiments.GetInstanceResponse] { + waitConfig := wait.WaiterHelper[modelexperiments.GetInstanceResponse, modelexperiments.InstanceState]{ + FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + GetState: func(response *modelexperiments.GetInstanceResponse) (modelexperiments.InstanceState, error) { + if response == nil { + return "", errors.New("empty response") + } + return response.Instance.State, nil + }, + ErrorState: []modelexperiments.InstanceState{modelexperiments.INSTANCESTATE_IMPAIRED}, + DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) + return handler +} + +// CreateInstanceTokenWaitHandler will wait for creation of Model Experiments instance token +func CreateInstanceTokenWaitHandler(ctx context.Context, a modelexperiments.DefaultAPI, region, projectId, instanceId, tokenId string) *wait.AsyncActionHandler[modelexperiments.GetInstanceTokenResponse] { + waitConfig := wait.WaiterHelper[modelexperiments.GetInstanceTokenResponse, modelexperiments.TokenState]{ + FetchInstance: a.GetInstanceToken(ctx, projectId, region, tokenId, instanceId).Execute, + GetState: func(response *modelexperiments.GetInstanceTokenResponse) (modelexperiments.TokenState, error) { + if response == nil { + return "", errors.New("empty response") + } + return response.Token.State, nil + }, + ActiveState: []modelexperiments.TokenState{modelexperiments.TOKENSTATE_ACTIVE}, + ErrorState: []modelexperiments.TokenState{}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) + return handler +} + +// DeleteInstanceTokenWaitHandler will wait for deletion of Model Experiments instance token +func DeleteInstanceTokenWaitHandler(ctx context.Context, a modelexperiments.DefaultAPI, region, projectId, instanceId, tokenId string) *wait.AsyncActionHandler[modelexperiments.GetInstanceTokenResponse] { + waitConfig := wait.WaiterHelper[modelexperiments.GetInstanceTokenResponse, modelexperiments.TokenState]{ + FetchInstance: a.GetInstanceToken(ctx, projectId, region, tokenId, instanceId).Execute, + GetState: func(response *modelexperiments.GetInstanceTokenResponse) (modelexperiments.TokenState, error) { + if response == nil { + return "", errors.New("empty response") + } + return response.Token.State, nil + }, + DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) + return handler +} diff --git a/services/modelexperiments/v1api/wait/wait_test.go b/services/modelexperiments/v1api/wait/wait_test.go new file mode 100644 index 000000000..7acfcdac4 --- /dev/null +++ b/services/modelexperiments/v1api/wait/wait_test.go @@ -0,0 +1,327 @@ +package wait + +import ( + "context" + "testing" + "testing/synctest" + "time" + + "github.com/google/go-cmp/cmp" + + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/utils" + modelexperiments "github.com/stackitcloud/stackit-sdk-go/services/modelexperiments/v1api" +) + +type mockSettings struct { + getFails bool + statusCode int + resourceState string +} + +func newAPIMock(settings *mockSettings) modelexperiments.DefaultAPI { + return &modelexperiments.DefaultAPIServiceMock{ + GetInstanceExecuteMock: utils.Ptr(func(_ modelexperiments.ApiGetInstanceRequest) (*modelexperiments.GetInstanceResponse, error) { + if settings.getFails { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: settings.statusCode, + } + } + + return &modelexperiments.GetInstanceResponse{ + Instance: modelexperiments.Instance{ + State: modelexperiments.InstanceState(settings.resourceState), + }, + }, nil + }), + GetInstanceTokenExecuteMock: utils.Ptr(func(_ modelexperiments.ApiGetInstanceTokenRequest) (*modelexperiments.GetInstanceTokenResponse, error) { + if settings.getFails { + return nil, &oapierror.GenericOpenAPIError{ + StatusCode: settings.statusCode, + } + } + + return &modelexperiments.GetInstanceTokenResponse{ + Token: modelexperiments.TokenMetadata{ + State: modelexperiments.TokenState(settings.resourceState), + }, + }, nil + }), + } +} + +func TestCreateModelExperimentsInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + statusCode int + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "create_succeeded", + getFails: false, + statusCode: 202, + resourceState: string(modelexperiments.INSTANCESTATE_ACTIVE), + wantErr: false, + wantResp: true, + }, + { + desc: "get_fails", + getFails: true, + statusCode: 500, + resourceState: "", + wantErr: true, + wantResp: false, + }, + { + desc: "not_found", + getFails: true, + statusCode: 404, + resourceState: "", + wantErr: true, + wantResp: false, + }, + { + desc: "impaired", + getFails: false, + statusCode: 200, + resourceState: string(modelexperiments.INSTANCESTATE_IMPAIRED), + wantErr: true, + wantResp: true, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + apiClient := newAPIMock(&mockSettings{ + getFails: tt.getFails, + statusCode: tt.statusCode, + resourceState: tt.resourceState, + }) + + var wantRes *modelexperiments.GetInstanceResponse + if tt.wantResp { + wantRes = &modelexperiments.GetInstanceResponse{ + Instance: modelexperiments.Instance{ + State: modelexperiments.InstanceState(tt.resourceState), + }, + } + } + + handler := CreateInstanceWaitHandler(context.Background(), apiClient, "region", "pid", "instanceId") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + }) + } +} + +func TestDeleteModelExperimentsInstanceWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + statusCode int + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "delete_succeeded", + getFails: true, + statusCode: 404, + resourceState: "", + wantErr: false, + wantResp: false, + }, + { + desc: "delete_in_progress", + getFails: false, + statusCode: 200, + resourceState: string(modelexperiments.INSTANCESTATE_DELETING), + wantErr: true, // Should timeout since delete is not complete + wantResp: false, + }, + { + desc: "get_fails_with_other_error", + getFails: true, + statusCode: 500, + resourceState: "", + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + apiClient := newAPIMock(&mockSettings{ + getFails: tt.getFails, + statusCode: tt.statusCode, + resourceState: tt.resourceState, + }) + + var wantRes *modelexperiments.GetInstanceResponse + if tt.wantResp { + wantRes = &modelexperiments.GetInstanceResponse{ + Instance: modelexperiments.Instance{ + State: modelexperiments.InstanceState(tt.resourceState), + }, + } + } + + handler := DeleteInstanceWaitHandler(context.Background(), apiClient, "region", "pid", "instanceId") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + }) + } +} + +func TestCreateModelExperimentsInstanceTokenWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + statusCode int + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "create_succeeded", + getFails: false, + statusCode: 202, + resourceState: string(modelexperiments.TOKENSTATE_ACTIVE), + wantErr: false, + wantResp: true, + }, + { + desc: "get_fails", + getFails: true, + statusCode: 500, + resourceState: "", + wantErr: true, + wantResp: false, + }, + { + desc: "not_found", + getFails: true, + statusCode: 404, + resourceState: "", + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + apiClient := newAPIMock(&mockSettings{ + getFails: tt.getFails, + statusCode: tt.statusCode, + resourceState: tt.resourceState, + }) + + var wantRes *modelexperiments.GetInstanceTokenResponse + if tt.wantResp { + wantRes = &modelexperiments.GetInstanceTokenResponse{ + Token: modelexperiments.TokenMetadata{ + State: modelexperiments.TokenState(tt.resourceState), + }, + } + } + + handler := CreateInstanceTokenWaitHandler(context.Background(), apiClient, "region", "pid", "instanceId", "tid") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + }) + } +} + +func TestDeleteModelExperimentsInstanceTokenWaitHandler(t *testing.T) { + tests := []struct { + desc string + getFails bool + statusCode int + resourceState string + wantErr bool + wantResp bool + }{ + { + desc: "delete_succeeded", + getFails: true, + statusCode: 404, + resourceState: "", + wantErr: false, + wantResp: false, + }, + { + desc: "delete_in_progress", + getFails: false, + statusCode: 200, + resourceState: string(modelexperiments.TOKENSTATE_DELETING), + wantErr: true, // Should timeout since delete is not complete + wantResp: false, + }, + { + desc: "get_fails_with_other_error", + getFails: true, + statusCode: 500, + resourceState: "", + wantErr: true, + wantResp: false, + }, + } + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + apiClient := newAPIMock(&mockSettings{ + getFails: tt.getFails, + statusCode: tt.statusCode, + resourceState: tt.resourceState, + }) + + var wantRes *modelexperiments.GetInstanceTokenResponse + if tt.wantResp { + wantRes = &modelexperiments.GetInstanceTokenResponse{ + Token: modelexperiments.TokenMetadata{ + State: modelexperiments.TokenState(tt.resourceState), + }, + } + } + + handler := DeleteInstanceTokenWaitHandler(context.Background(), apiClient, "region", "pid", "instanceId", "tid") + + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %v, want %v", gotRes, wantRes) + } + }) + }) + } +} diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 875e1e1df..5b96e9f4c 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.11.0 +- `v1api`: + - **Breaking change:** Introduce validators for `name`, `database` and `username` +- `v2api`: + - **Breaking change:** Introduce validators for `name`, `database` and `username` + ## v1.10.0 - **Improvement:** Use new WaiterHelper for mongodbflex diff --git a/services/mongodbflex/VERSION b/services/mongodbflex/VERSION index e1e35526c..285cea5d1 100644 --- a/services/mongodbflex/VERSION +++ b/services/mongodbflex/VERSION @@ -1 +1 @@ -v1.10.0 \ No newline at end of file +v1.11.0 \ No newline at end of file diff --git a/services/mongodbflex/oas_commit b/services/mongodbflex/oas_commit index c08a6770d..6e745cd65 100644 --- a/services/mongodbflex/oas_commit +++ b/services/mongodbflex/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +9873a8f7a4120017699e43baba2e8b2af7bca93e diff --git a/services/mongodbflex/v1api/model_create_instance_payload.go b/services/mongodbflex/v1api/model_create_instance_payload.go index d9584eeca..02103f0bb 100644 --- a/services/mongodbflex/v1api/model_create_instance_payload.go +++ b/services/mongodbflex/v1api/model_create_instance_payload.go @@ -26,7 +26,7 @@ type CreateInstancePayload struct { FlavorId string `json:"flavorId"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name string `json:"name"` + Name string `json:"name" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options map[string]string `json:"options"` Replicas int32 `json:"replicas"` Storage Storage `json:"storage"` diff --git a/services/mongodbflex/v1api/model_create_user_payload.go b/services/mongodbflex/v1api/model_create_user_payload.go index 9ede8bae6..5996acd87 100644 --- a/services/mongodbflex/v1api/model_create_user_payload.go +++ b/services/mongodbflex/v1api/model_create_user_payload.go @@ -21,10 +21,10 @@ var _ MappedNullable = &CreateUserPayload{} // CreateUserPayload struct for CreateUserPayload type CreateUserPayload struct { - Database string `json:"database"` + Database string `json:"database" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` // The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.** Roles []string `json:"roles"` - Username *string `json:"username,omitempty"` + Username *string `json:"username,omitempty" validate:"regexp=^[A-Za-z][A-Za-z0-9-]{1,61}[A-Za-z0-9]$"` AdditionalProperties map[string]interface{} } diff --git a/services/mongodbflex/v1api/model_instance_response_user.go b/services/mongodbflex/v1api/model_instance_response_user.go index ab95db497..67727ad09 100644 --- a/services/mongodbflex/v1api/model_instance_response_user.go +++ b/services/mongodbflex/v1api/model_instance_response_user.go @@ -20,7 +20,7 @@ var _ MappedNullable = &InstanceResponseUser{} // InstanceResponseUser struct for InstanceResponseUser type InstanceResponseUser struct { - Database *string `json:"database,omitempty"` + Database *string `json:"database,omitempty" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Host *string `json:"host,omitempty"` Id *string `json:"id,omitempty"` Port *int32 `json:"port,omitempty"` diff --git a/services/mongodbflex/v1api/model_partial_update_instance_payload.go b/services/mongodbflex/v1api/model_partial_update_instance_payload.go index fd6a70161..ef5506f4f 100644 --- a/services/mongodbflex/v1api/model_partial_update_instance_payload.go +++ b/services/mongodbflex/v1api/model_partial_update_instance_payload.go @@ -25,7 +25,7 @@ type PartialUpdateInstancePayload struct { FlavorId *string `json:"flavorId,omitempty"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options *map[string]string `json:"options,omitempty"` Replicas *int32 `json:"replicas,omitempty"` Storage *Storage `json:"storage,omitempty"` diff --git a/services/mongodbflex/v1api/model_update_instance_payload.go b/services/mongodbflex/v1api/model_update_instance_payload.go index 0d6cde9b5..95aa463ed 100644 --- a/services/mongodbflex/v1api/model_update_instance_payload.go +++ b/services/mongodbflex/v1api/model_update_instance_payload.go @@ -26,7 +26,7 @@ type UpdateInstancePayload struct { FlavorId string `json:"flavorId"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name string `json:"name"` + Name string `json:"name" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options map[string]string `json:"options"` Replicas int32 `json:"replicas"` Storage Storage `json:"storage"` diff --git a/services/mongodbflex/v1api/model_update_user_payload.go b/services/mongodbflex/v1api/model_update_user_payload.go index b4b2ef619..6042235e3 100644 --- a/services/mongodbflex/v1api/model_update_user_payload.go +++ b/services/mongodbflex/v1api/model_update_user_payload.go @@ -21,7 +21,7 @@ var _ MappedNullable = &UpdateUserPayload{} // UpdateUserPayload struct for UpdateUserPayload type UpdateUserPayload struct { - Database string `json:"database"` + Database string `json:"database" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` // The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.** Roles []string `json:"roles"` AdditionalProperties map[string]interface{} diff --git a/services/mongodbflex/v2api/model_create_instance_payload.go b/services/mongodbflex/v2api/model_create_instance_payload.go index 4aeb17253..b00662622 100644 --- a/services/mongodbflex/v2api/model_create_instance_payload.go +++ b/services/mongodbflex/v2api/model_create_instance_payload.go @@ -27,7 +27,7 @@ type CreateInstancePayload struct { FlavorId string `json:"flavorId"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name string `json:"name"` + Name string `json:"name" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options map[string]string `json:"options"` Replicas int32 `json:"replicas"` Storage Storage `json:"storage"` diff --git a/services/mongodbflex/v2api/model_create_user_payload.go b/services/mongodbflex/v2api/model_create_user_payload.go index 30acbf058..6681f54bc 100644 --- a/services/mongodbflex/v2api/model_create_user_payload.go +++ b/services/mongodbflex/v2api/model_create_user_payload.go @@ -21,10 +21,10 @@ var _ MappedNullable = &CreateUserPayload{} // CreateUserPayload struct for CreateUserPayload type CreateUserPayload struct { - Database string `json:"database"` + Database string `json:"database" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` // The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.** Roles []string `json:"roles"` - Username *string `json:"username,omitempty"` + Username *string `json:"username,omitempty" validate:"regexp=^[A-Za-z][A-Za-z0-9-]{1,61}[A-Za-z0-9]$"` AdditionalProperties map[string]interface{} } diff --git a/services/mongodbflex/v2api/model_partial_update_instance_payload.go b/services/mongodbflex/v2api/model_partial_update_instance_payload.go index 893e2eaa0..8cf5db8d6 100644 --- a/services/mongodbflex/v2api/model_partial_update_instance_payload.go +++ b/services/mongodbflex/v2api/model_partial_update_instance_payload.go @@ -25,7 +25,7 @@ type PartialUpdateInstancePayload struct { FlavorId *string `json:"flavorId,omitempty"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options *map[string]string `json:"options,omitempty"` Replicas *int32 `json:"replicas,omitempty"` Storage *Storage `json:"storage,omitempty"` diff --git a/services/mongodbflex/v2api/model_partial_update_user_payload.go b/services/mongodbflex/v2api/model_partial_update_user_payload.go index 2f278dc12..c7c007651 100644 --- a/services/mongodbflex/v2api/model_partial_update_user_payload.go +++ b/services/mongodbflex/v2api/model_partial_update_user_payload.go @@ -20,7 +20,7 @@ var _ MappedNullable = &PartialUpdateUserPayload{} // PartialUpdateUserPayload struct for PartialUpdateUserPayload type PartialUpdateUserPayload struct { - Database *string `json:"database,omitempty"` + Database *string `json:"database,omitempty" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` // The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.** Roles []string `json:"roles,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/mongodbflex/v2api/model_update_instance_payload.go b/services/mongodbflex/v2api/model_update_instance_payload.go index a8eba4cf4..d0bc87aac 100644 --- a/services/mongodbflex/v2api/model_update_instance_payload.go +++ b/services/mongodbflex/v2api/model_update_instance_payload.go @@ -26,7 +26,7 @@ type UpdateInstancePayload struct { FlavorId string `json:"flavorId"` // Labels field is not certain/clear Labels *map[string]string `json:"labels,omitempty"` - Name string `json:"name"` + Name string `json:"name" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` Options map[string]string `json:"options"` Replicas int64 `json:"replicas"` Storage Storage `json:"storage"` diff --git a/services/mongodbflex/v2api/model_update_user_payload.go b/services/mongodbflex/v2api/model_update_user_payload.go index 75ec63394..503b91b58 100644 --- a/services/mongodbflex/v2api/model_update_user_payload.go +++ b/services/mongodbflex/v2api/model_update_user_payload.go @@ -21,7 +21,7 @@ var _ MappedNullable = &UpdateUserPayload{} // UpdateUserPayload struct for UpdateUserPayload type UpdateUserPayload struct { - Database string `json:"database"` + Database string `json:"database" validate:"regexp=^[A-Za-z_][A-Za-z0-9-_]{1,61}[A-Za-z0-9_]$"` // The roles defined for a user. Currently only one role in the list is supported, therefore only the first role from this list is used. The *roles* attribute can contain the following values: 'read', 'readWrite', 'readAnyDatabase', 'readWriteAnyDatabase', 'stackitAdmin'. **The 'readAnyDatabase', 'readWriteAnyDatabase' and 'stackitAdmin' roles will always be created in the admin database.** Roles []string `json:"roles"` AdditionalProperties map[string]interface{} diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index ca9f25c4b..e0ef26bfd 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.0.0 +- `v2api`: + - New package which can be used for communication with the opensearch v2 API + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Deprecation:** `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. +- `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-12. + ## v0.29.0 - **Feature:** Introduce enums for various attributes diff --git a/services/opensearch/VERSION b/services/opensearch/VERSION index 5bc296535..60453e690 100644 --- a/services/opensearch/VERSION +++ b/services/opensearch/VERSION @@ -1 +1 @@ -v0.29.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/opensearch/api_default.go b/services/opensearch/api_default.go index 7ed1b4826..cd898c7fb 100644 --- a/services/opensearch/api_default.go +++ b/services/opensearch/api_default.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/opensearch/client.go b/services/opensearch/client.go index 8e5b228dd..6ee6b0fb5 100644 --- a/services/opensearch/client.go +++ b/services/opensearch/client.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Opensearch API API v1.1.0 +// APIClient manages communication with the STACKIT Opensearch API API v2.1.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/opensearch/configuration.go b/services/opensearch/configuration.go index 0d6b4d3e0..7434d7672 100644 --- a/services/opensearch/configuration.go +++ b/services/opensearch/configuration.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://opensearch.api.{region}stackit.cloud", + URL: "https://opensearch.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/opensearch/model_backup.go b/services/opensearch/model_backup.go index 1d8e72e7f..29aa1160c 100644 --- a/services/opensearch/model_backup.go +++ b/services/opensearch/model_backup.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/opensearch/model_backup_test.go b/services/opensearch/model_backup_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_backup_test.go +++ b/services/opensearch/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_create_backup_response_item.go b/services/opensearch/model_create_backup_response_item.go index c58f2af3e..05d05fae1 100644 --- a/services/opensearch/model_create_backup_response_item.go +++ b/services/opensearch/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/opensearch/model_create_backup_response_item_test.go b/services/opensearch/model_create_backup_response_item_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_create_backup_response_item_test.go +++ b/services/opensearch/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_create_credentials_payload.go b/services/opensearch/model_create_credentials_payload.go new file mode 100644 index 000000000..0174c0858 --- /dev/null +++ b/services/opensearch/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package opensearch + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/model_create_credentials_payload_test.go b/services/opensearch/model_create_credentials_payload_test.go new file mode 100644 index 000000000..acc93b4d9 --- /dev/null +++ b/services/opensearch/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package opensearch diff --git a/services/opensearch/model_create_instance_payload.go b/services/opensearch/model_create_instance_payload.go index f001c8de3..a36cdfc07 100644 --- a/services/opensearch/model_create_instance_payload.go +++ b/services/opensearch/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_create_instance_payload_test.go b/services/opensearch/model_create_instance_payload_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_create_instance_payload_test.go +++ b/services/opensearch/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_create_instance_response.go b/services/opensearch/model_create_instance_response.go index cbb475b24..7cdca529e 100644 --- a/services/opensearch/model_create_instance_response.go +++ b/services/opensearch/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_create_instance_response_test.go b/services/opensearch/model_create_instance_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_create_instance_response_test.go +++ b/services/opensearch/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials.go b/services/opensearch/model_credentials.go index b366d6a65..1335124e7 100644 --- a/services/opensearch/model_credentials.go +++ b/services/opensearch/model_credentials.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials_list_item.go b/services/opensearch/model_credentials_list_item.go index 8087a55ea..1d39d2af1 100644 --- a/services/opensearch/model_credentials_list_item.go +++ b/services/opensearch/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials_list_item_test.go b/services/opensearch/model_credentials_list_item_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_credentials_list_item_test.go +++ b/services/opensearch/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials_response.go b/services/opensearch/model_credentials_response.go index d8a7eaf10..a7a4585af 100644 --- a/services/opensearch/model_credentials_response.go +++ b/services/opensearch/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials_response_test.go b/services/opensearch/model_credentials_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_credentials_response_test.go +++ b/services/opensearch/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_credentials_test.go b/services/opensearch/model_credentials_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_credentials_test.go +++ b/services/opensearch/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_error.go b/services/opensearch/model_error.go index 048ba399c..d9113609f 100644 --- a/services/opensearch/model_error.go +++ b/services/opensearch/model_error.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_error_test.go b/services/opensearch/model_error_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_error_test.go +++ b/services/opensearch/model_error_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_get_metrics_response.go b/services/opensearch/model_get_metrics_response.go index caa468b3b..b096854ea 100644 --- a/services/opensearch/model_get_metrics_response.go +++ b/services/opensearch/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_get_metrics_response_test.go b/services/opensearch/model_get_metrics_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_get_metrics_response_test.go +++ b/services/opensearch/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance.go b/services/opensearch/model_instance.go index 7d8299341..5cf41797e 100644 --- a/services/opensearch/model_instance.go +++ b/services/opensearch/model_instance.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_last_operation.go b/services/opensearch/model_instance_last_operation.go index 8d5859ff0..1d03e8cae 100644 --- a/services/opensearch/model_instance_last_operation.go +++ b/services/opensearch/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_last_operation_test.go b/services/opensearch/model_instance_last_operation_test.go index 8a99482b3..7ad8378dd 100644 --- a/services/opensearch/model_instance_last_operation_test.go +++ b/services/opensearch/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_parameters.go b/services/opensearch/model_instance_parameters.go index c1b3c7260..1586e5322 100644 --- a/services/opensearch/model_instance_parameters.go +++ b/services/opensearch/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -550,8 +550,9 @@ type InstanceParameters struct { // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` Syslog InstanceParametersGetSyslogAttributeType `json:"syslog,omitempty"` - // Only Java format is supported. - TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. TlsProtocols InstanceParametersGetTlsProtocolsAttributeType `json:"tls-protocols,omitempty"` } diff --git a/services/opensearch/model_instance_parameters_test.go b/services/opensearch/model_instance_parameters_test.go index 2a588634c..86e95e903 100644 --- a/services/opensearch/model_instance_parameters_test.go +++ b/services/opensearch/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_schema.go b/services/opensearch/model_instance_schema.go index d5f16f88b..b8deba7dc 100644 --- a/services/opensearch/model_instance_schema.go +++ b/services/opensearch/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_schema_test.go b/services/opensearch/model_instance_schema_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_instance_schema_test.go +++ b/services/opensearch/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_instance_test.go b/services/opensearch/model_instance_test.go index f6f0d7ce7..ecd52699f 100644 --- a/services/opensearch/model_instance_test.go +++ b/services/opensearch/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_backups_response.go b/services/opensearch/model_list_backups_response.go index e950de867..bf5079a51 100644 --- a/services/opensearch/model_list_backups_response.go +++ b/services/opensearch/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_backups_response_test.go b/services/opensearch/model_list_backups_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_list_backups_response_test.go +++ b/services/opensearch/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_credentials_response.go b/services/opensearch/model_list_credentials_response.go index 382b06583..d1fd560f1 100644 --- a/services/opensearch/model_list_credentials_response.go +++ b/services/opensearch/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_credentials_response_test.go b/services/opensearch/model_list_credentials_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_list_credentials_response_test.go +++ b/services/opensearch/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_instances_response.go b/services/opensearch/model_list_instances_response.go index 6f16f114f..068ed8dea 100644 --- a/services/opensearch/model_list_instances_response.go +++ b/services/opensearch/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_instances_response_test.go b/services/opensearch/model_list_instances_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_list_instances_response_test.go +++ b/services/opensearch/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_offerings_response.go b/services/opensearch/model_list_offerings_response.go index 803e5cc9c..234e47c77 100644 --- a/services/opensearch/model_list_offerings_response.go +++ b/services/opensearch/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_offerings_response_test.go b/services/opensearch/model_list_offerings_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_list_offerings_response_test.go +++ b/services/opensearch/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_restores_response.go b/services/opensearch/model_list_restores_response.go index fffd3da77..12d746e43 100644 --- a/services/opensearch/model_list_restores_response.go +++ b/services/opensearch/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_list_restores_response_test.go b/services/opensearch/model_list_restores_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_list_restores_response_test.go +++ b/services/opensearch/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_offering.go b/services/opensearch/model_offering.go index 3536be395..2e882fbc3 100644 --- a/services/opensearch/model_offering.go +++ b/services/opensearch/model_offering.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/opensearch/model_offering_test.go b/services/opensearch/model_offering_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_offering_test.go +++ b/services/opensearch/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_partial_update_instance_payload.go b/services/opensearch/model_partial_update_instance_payload.go index d421c075d..b92e2ffbe 100644 --- a/services/opensearch/model_partial_update_instance_payload.go +++ b/services/opensearch/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_partial_update_instance_payload_test.go b/services/opensearch/model_partial_update_instance_payload_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_partial_update_instance_payload_test.go +++ b/services/opensearch/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_plan.go b/services/opensearch/model_plan.go index 26a63bc31..2ca6cb76f 100644 --- a/services/opensearch/model_plan.go +++ b/services/opensearch/model_plan.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_plan_test.go b/services/opensearch/model_plan_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_plan_test.go +++ b/services/opensearch/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_raw_credentials.go b/services/opensearch/model_raw_credentials.go index 141a90f19..91b85fa33 100644 --- a/services/opensearch/model_raw_credentials.go +++ b/services/opensearch/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_raw_credentials_test.go b/services/opensearch/model_raw_credentials_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_raw_credentials_test.go +++ b/services/opensearch/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_restore.go b/services/opensearch/model_restore.go index cc1e6fc94..71455db01 100644 --- a/services/opensearch/model_restore.go +++ b/services/opensearch/model_restore.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/opensearch/model_restore_test.go b/services/opensearch/model_restore_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_restore_test.go +++ b/services/opensearch/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_schema.go b/services/opensearch/model_schema.go index 447e51ee7..c6f046d18 100644 --- a/services/opensearch/model_schema.go +++ b/services/opensearch/model_schema.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_schema_test.go b/services/opensearch/model_schema_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_schema_test.go +++ b/services/opensearch/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_trigger_restore_response.go b/services/opensearch/model_trigger_restore_response.go index 3357fe282..06fe72137 100644 --- a/services/opensearch/model_trigger_restore_response.go +++ b/services/opensearch/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/opensearch/model_trigger_restore_response_test.go b/services/opensearch/model_trigger_restore_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_trigger_restore_response_test.go +++ b/services/opensearch/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_update_backups_config_payload.go b/services/opensearch/model_update_backups_config_payload.go index ec6afb22e..206b14a30 100644 --- a/services/opensearch/model_update_backups_config_payload.go +++ b/services/opensearch/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_update_backups_config_payload_test.go b/services/opensearch/model_update_backups_config_payload_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_update_backups_config_payload_test.go +++ b/services/opensearch/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_update_backups_config_response.go b/services/opensearch/model_update_backups_config_response.go index 7e6620b02..69609ed56 100644 --- a/services/opensearch/model_update_backups_config_response.go +++ b/services/opensearch/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/model_update_backups_config_response_test.go b/services/opensearch/model_update_backups_config_response_test.go index 044e8fef0..acc93b4d9 100644 --- a/services/opensearch/model_update_backups_config_response_test.go +++ b/services/opensearch/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/oas_commit b/services/opensearch/oas_commit index c08a6770d..43650201f 100644 --- a/services/opensearch/oas_commit +++ b/services/opensearch/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +4bd25bda4419f2f3209df549faf293bcf5f4e687 diff --git a/services/opensearch/utils.go b/services/opensearch/utils.go index 5e2718687..250d16253 100644 --- a/services/opensearch/utils.go +++ b/services/opensearch/utils.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/api_default.go b/services/opensearch/v1api/api_default.go index f21b18590..1ffbc7f68 100644 --- a/services/opensearch/v1api/api_default.go +++ b/services/opensearch/v1api/api_default.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/opensearch/v1api/api_default_mock.go b/services/opensearch/v1api/api_default_mock.go index 1ab31c2f9..7a0305dcd 100644 --- a/services/opensearch/v1api/api_default_mock.go +++ b/services/opensearch/v1api/api_default_mock.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/client.go b/services/opensearch/v1api/client.go index 80d1c2131..c62391588 100644 --- a/services/opensearch/v1api/client.go +++ b/services/opensearch/v1api/client.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Opensearch API API v1.1.0 +// APIClient manages communication with the STACKIT Opensearch API API v1.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/opensearch/v1api/configuration.go b/services/opensearch/v1api/configuration.go index 30722f3dc..164ac1663 100644 --- a/services/opensearch/v1api/configuration.go +++ b/services/opensearch/v1api/configuration.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_backup.go b/services/opensearch/v1api/model_backup.go index cab339545..10fe440db 100644 --- a/services/opensearch/v1api/model_backup.go +++ b/services/opensearch/v1api/model_backup.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_create_backup_response_item.go b/services/opensearch/v1api/model_create_backup_response_item.go index fd1177e73..2ca5c9638 100644 --- a/services/opensearch/v1api/model_create_backup_response_item.go +++ b/services/opensearch/v1api/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_create_credentials_payload.go b/services/opensearch/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..166b6546e --- /dev/null +++ b/services/opensearch/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_create_instance_payload.go b/services/opensearch/v1api/model_create_instance_payload.go index 795de18d7..4e575990a 100644 --- a/services/opensearch/v1api/model_create_instance_payload.go +++ b/services/opensearch/v1api/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_create_instance_response.go b/services/opensearch/v1api/model_create_instance_response.go index bea74e67e..2936e5b9b 100644 --- a/services/opensearch/v1api/model_create_instance_response.go +++ b/services/opensearch/v1api/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_credentials.go b/services/opensearch/v1api/model_credentials.go index 5c4057240..b86371f37 100644 --- a/services/opensearch/v1api/model_credentials.go +++ b/services/opensearch/v1api/model_credentials.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_credentials_list_item.go b/services/opensearch/v1api/model_credentials_list_item.go index 0e0792cf4..faa7da5a9 100644 --- a/services/opensearch/v1api/model_credentials_list_item.go +++ b/services/opensearch/v1api/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_credentials_response.go b/services/opensearch/v1api/model_credentials_response.go index ccb1b0c35..342cfeba3 100644 --- a/services/opensearch/v1api/model_credentials_response.go +++ b/services/opensearch/v1api/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_error.go b/services/opensearch/v1api/model_error.go index 8a785ab58..358ea85c9 100644 --- a/services/opensearch/v1api/model_error.go +++ b/services/opensearch/v1api/model_error.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_get_metrics_response.go b/services/opensearch/v1api/model_get_metrics_response.go index 1035c50cd..6e1b692d3 100644 --- a/services/opensearch/v1api/model_get_metrics_response.go +++ b/services/opensearch/v1api/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance.go b/services/opensearch/v1api/model_instance.go index 9cd832665..5aa8a5e47 100644 --- a/services/opensearch/v1api/model_instance.go +++ b/services/opensearch/v1api/model_instance.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_last_operation.go b/services/opensearch/v1api/model_instance_last_operation.go index 800e71e73..5dc60c71d 100644 --- a/services/opensearch/v1api/model_instance_last_operation.go +++ b/services/opensearch/v1api/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_last_operation_state.go b/services/opensearch/v1api/model_instance_last_operation_state.go index 29ef473e9..22d2099e3 100644 --- a/services/opensearch/v1api/model_instance_last_operation_state.go +++ b/services/opensearch/v1api/model_instance_last_operation_state.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_last_operation_type.go b/services/opensearch/v1api/model_instance_last_operation_type.go index b020a0d66..05d3f9aff 100644 --- a/services/opensearch/v1api/model_instance_last_operation_type.go +++ b/services/opensearch/v1api/model_instance_last_operation_type.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_parameters.go b/services/opensearch/v1api/model_instance_parameters.go index b8d972fdf..4eb3161ac 100644 --- a/services/opensearch/v1api/model_instance_parameters.go +++ b/services/opensearch/v1api/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -39,8 +39,11 @@ type InstanceParameters struct { // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` Syslog []string `json:"syslog,omitempty"` - // Only Java format is supported. - TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -469,6 +472,7 @@ func (o *InstanceParameters) SetSyslog(v []string) { } // GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsCiphers() []string { if o == nil || IsNil(o.TlsCiphers) { var ret []string @@ -479,6 +483,7 @@ func (o *InstanceParameters) GetTlsCiphers() []string { // GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { if o == nil || IsNil(o.TlsCiphers) { return nil, false @@ -496,11 +501,13 @@ func (o *InstanceParameters) HasTlsCiphers() bool { } // SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated func (o *InstanceParameters) SetTlsCiphers(v []string) { o.TlsCiphers = v } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { if o == nil || IsNil(o.TlsProtocols) { var ret []InstanceParametersTlsProtocolsInner @@ -511,6 +518,7 @@ func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsI // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false @@ -528,6 +536,7 @@ func (o *InstanceParameters) HasTlsProtocols() bool { } // SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +// Deprecated func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { o.TlsProtocols = v } diff --git a/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go b/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go index c6040f718..163941bb0 100644 --- a/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go +++ b/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_parameters_plugins_inner.go b/services/opensearch/v1api/model_instance_parameters_plugins_inner.go index 5819003a9..ed3c0c10e 100644 --- a/services/opensearch/v1api/model_instance_parameters_plugins_inner.go +++ b/services/opensearch/v1api/model_instance_parameters_plugins_inner.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go b/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go index 24784725e..2e92589bf 100644 --- a/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go +++ b/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_schema.go b/services/opensearch/v1api/model_instance_schema.go index 7542de13a..192cdbee3 100644 --- a/services/opensearch/v1api/model_instance_schema.go +++ b/services/opensearch/v1api/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_instance_status.go b/services/opensearch/v1api/model_instance_status.go index ee66b6ba6..027a5a131 100644 --- a/services/opensearch/v1api/model_instance_status.go +++ b/services/opensearch/v1api/model_instance_status.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_list_backups_response.go b/services/opensearch/v1api/model_list_backups_response.go index 0a974c168..e4d8efa9d 100644 --- a/services/opensearch/v1api/model_list_backups_response.go +++ b/services/opensearch/v1api/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_list_credentials_response.go b/services/opensearch/v1api/model_list_credentials_response.go index 3eb5069bb..6b7bcaaae 100644 --- a/services/opensearch/v1api/model_list_credentials_response.go +++ b/services/opensearch/v1api/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_list_instances_response.go b/services/opensearch/v1api/model_list_instances_response.go index 33e77750f..42654c921 100644 --- a/services/opensearch/v1api/model_list_instances_response.go +++ b/services/opensearch/v1api/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_list_offerings_response.go b/services/opensearch/v1api/model_list_offerings_response.go index 0de3c1d54..467fc307e 100644 --- a/services/opensearch/v1api/model_list_offerings_response.go +++ b/services/opensearch/v1api/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_list_restores_response.go b/services/opensearch/v1api/model_list_restores_response.go index 68131238f..cd962285b 100644 --- a/services/opensearch/v1api/model_list_restores_response.go +++ b/services/opensearch/v1api/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_offering.go b/services/opensearch/v1api/model_offering.go index 198b5726b..094e9fde3 100644 --- a/services/opensearch/v1api/model_offering.go +++ b/services/opensearch/v1api/model_offering.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_partial_update_instance_payload.go b/services/opensearch/v1api/model_partial_update_instance_payload.go index 9718caad9..38504f41c 100644 --- a/services/opensearch/v1api/model_partial_update_instance_payload.go +++ b/services/opensearch/v1api/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_plan.go b/services/opensearch/v1api/model_plan.go index f781dbde1..fb30d20ba 100644 --- a/services/opensearch/v1api/model_plan.go +++ b/services/opensearch/v1api/model_plan.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_raw_credentials.go b/services/opensearch/v1api/model_raw_credentials.go index d90fe3fc2..b91ce1a1c 100644 --- a/services/opensearch/v1api/model_raw_credentials.go +++ b/services/opensearch/v1api/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_restore.go b/services/opensearch/v1api/model_restore.go index 52e8c1e52..c79d47679 100644 --- a/services/opensearch/v1api/model_restore.go +++ b/services/opensearch/v1api/model_restore.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_schema.go b/services/opensearch/v1api/model_schema.go index dc373bf27..ccd138a60 100644 --- a/services/opensearch/v1api/model_schema.go +++ b/services/opensearch/v1api/model_schema.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_trigger_restore_response.go b/services/opensearch/v1api/model_trigger_restore_response.go index c3d0240b7..ea6368fad 100644 --- a/services/opensearch/v1api/model_trigger_restore_response.go +++ b/services/opensearch/v1api/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_update_backups_config_payload.go b/services/opensearch/v1api/model_update_backups_config_payload.go index f0c48e248..5cd5fb67a 100644 --- a/services/opensearch/v1api/model_update_backups_config_payload.go +++ b/services/opensearch/v1api/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/model_update_backups_config_response.go b/services/opensearch/v1api/model_update_backups_config_response.go index 90ece65e2..5915bc59b 100644 --- a/services/opensearch/v1api/model_update_backups_config_response.go +++ b/services/opensearch/v1api/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/response.go b/services/opensearch/v1api/response.go index fd194ec7c..82f1ba653 100644 --- a/services/opensearch/v1api/response.go +++ b/services/opensearch/v1api/response.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v1api/utils.go b/services/opensearch/v1api/utils.go index 3ed0c9693..12af11dd5 100644 --- a/services/opensearch/v1api/utils.go +++ b/services/opensearch/v1api/utils.go @@ -3,7 +3,7 @@ STACKIT Opensearch API The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/opensearch/v2api/api_default.go b/services/opensearch/v2api/api_default.go new file mode 100644 index 000000000..56cc37e22 --- /dev/null +++ b/services/opensearch/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 410 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupsConfigPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/opensearch/v2api/api_default_mock.go b/services/opensearch/v2api/api_default_mock.go new file mode 100644 index 000000000..31f2e2855 --- /dev/null +++ b/services/opensearch/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/opensearch/v2api/client.go b/services/opensearch/v2api/client.go new file mode 100644 index 000000000..6ef2fc90a --- /dev/null +++ b/services/opensearch/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Opensearch API API v2.1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/opensearch/v2api/configuration.go b/services/opensearch/v2api/configuration.go new file mode 100644 index 000000000..4eab8aa6a --- /dev/null +++ b/services/opensearch/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/opensearch", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://opensearch.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/opensearch/v2api/model_backup.go b/services/opensearch/v2api/model_backup.go new file mode 100644 index 000000000..223daf1ae --- /dev/null +++ b/services/opensearch/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_create_backup_response_item.go b/services/opensearch/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..fad3621e1 --- /dev/null +++ b/services/opensearch/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_create_credentials_payload.go b/services/opensearch/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..209b128f4 --- /dev/null +++ b/services/opensearch/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_create_instance_payload.go b/services/opensearch/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..09b1689c3 --- /dev/null +++ b/services/opensearch/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_create_instance_response.go b/services/opensearch/v2api/model_create_instance_response.go new file mode 100644 index 000000000..b0574a12b --- /dev/null +++ b/services/opensearch/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_credentials.go b/services/opensearch/v2api/model_credentials.go new file mode 100644 index 000000000..2b276a0a8 --- /dev/null +++ b/services/opensearch/v2api/model_credentials.go @@ -0,0 +1,372 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Hosts []string `json:"hosts,omitempty"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + Scheme *string `json:"scheme,omitempty"` + Uri *string `json:"uri,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *Credentials) GetHosts() []string { + if o == nil || IsNil(o.Hosts) { + var ret []string + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostsOk() ([]string, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *Credentials) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []string and assigns it to the Hosts field. +func (o *Credentials) SetHosts(v []string) { + o.Hosts = v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetScheme returns the Scheme field value if set, zero value otherwise. +func (o *Credentials) GetScheme() string { + if o == nil || IsNil(o.Scheme) { + var ret string + return ret + } + return *o.Scheme +} + +// GetSchemeOk returns a tuple with the Scheme field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetSchemeOk() (*string, bool) { + if o == nil || IsNil(o.Scheme) { + return nil, false + } + return o.Scheme, true +} + +// HasScheme returns a boolean if a field has been set. +func (o *Credentials) HasScheme() bool { + if o != nil && !IsNil(o.Scheme) { + return true + } + + return false +} + +// SetScheme gets a reference to the given string and assigns it to the Scheme field. +func (o *Credentials) SetScheme(v string) { + o.Scheme = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Scheme) { + toSerialize["scheme"] = o.Scheme + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "hosts") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "scheme") + delete(additionalProperties, "uri") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_credentials_list_item.go b/services/opensearch/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..52d57caa0 --- /dev/null +++ b/services/opensearch/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_credentials_response.go b/services/opensearch/v2api/model_credentials_response.go new file mode 100644 index 000000000..dc2d40f82 --- /dev/null +++ b/services/opensearch/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_error.go b/services/opensearch/v2api/model_error.go new file mode 100644 index 000000000..19abc46a9 --- /dev/null +++ b/services/opensearch/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_get_metrics_response.go b/services/opensearch/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..7377ab617 --- /dev/null +++ b/services/opensearch/v2api/model_get_metrics_response.go @@ -0,0 +1,828 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance.go b/services/opensearch/v2api/model_instance.go new file mode 100644 index 000000000..ea36b001e --- /dev/null +++ b/services/opensearch/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *InstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) GetStatus() InstanceStatus { + if o == nil || IsNil(o.Status) { + var ret InstanceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Instance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_last_operation.go b/services/opensearch/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..2005762fd --- /dev/null +++ b/services/opensearch/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { + if o == nil { + var ret InstanceLastOperationState + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { + if o == nil { + var ret InstanceLastOperationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_last_operation_state.go b/services/opensearch/v2api/model_instance_last_operation_state.go new file mode 100644 index 000000000..065344c69 --- /dev/null +++ b/services/opensearch/v2api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_last_operation_type.go b/services/opensearch/v2api/model_instance_last_operation_type.go new file mode 100644 index 000000000..bae9d4857 --- /dev/null +++ b/services/opensearch/v2api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_parameters.go b/services/opensearch/v2api/model_instance_parameters.go new file mode 100644 index 000000000..fc65b6416 --- /dev/null +++ b/services/opensearch/v2api/model_instance_parameters.go @@ -0,0 +1,672 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + JavaGarbageCollector *InstanceParametersJavaGarbageCollector `json:"java_garbage_collector,omitempty"` + // Default: not set, 46% of available memory will be used. The amount of memory (in MB) allocated as heap by the JVM for OpenSearch. + JavaHeapspace *int32 `json:"java_heapspace,omitempty"` + // The amount of memory (in MB) used by the JVM to store metadata for OpenSearch. + JavaMaxmetaspace *int32 `json:"java_maxmetaspace,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // The plugins repository-s3 and repository-azure are enabled by default and cannot be disabled. + Plugins []InstanceParametersPluginsInner `json:"plugins,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var javaGarbageCollector InstanceParametersJavaGarbageCollector = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC + this.JavaGarbageCollector = &javaGarbageCollector + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var javaGarbageCollector InstanceParametersJavaGarbageCollector = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC + this.JavaGarbageCollector = &javaGarbageCollector + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetJavaGarbageCollector returns the JavaGarbageCollector field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaGarbageCollector() InstanceParametersJavaGarbageCollector { + if o == nil || IsNil(o.JavaGarbageCollector) { + var ret InstanceParametersJavaGarbageCollector + return ret + } + return *o.JavaGarbageCollector +} + +// GetJavaGarbageCollectorOk returns a tuple with the JavaGarbageCollector field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaGarbageCollectorOk() (*InstanceParametersJavaGarbageCollector, bool) { + if o == nil || IsNil(o.JavaGarbageCollector) { + return nil, false + } + return o.JavaGarbageCollector, true +} + +// HasJavaGarbageCollector returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaGarbageCollector() bool { + if o != nil && !IsNil(o.JavaGarbageCollector) { + return true + } + + return false +} + +// SetJavaGarbageCollector gets a reference to the given InstanceParametersJavaGarbageCollector and assigns it to the JavaGarbageCollector field. +func (o *InstanceParameters) SetJavaGarbageCollector(v InstanceParametersJavaGarbageCollector) { + o.JavaGarbageCollector = &v +} + +// GetJavaHeapspace returns the JavaHeapspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaHeapspace() int32 { + if o == nil || IsNil(o.JavaHeapspace) { + var ret int32 + return ret + } + return *o.JavaHeapspace +} + +// GetJavaHeapspaceOk returns a tuple with the JavaHeapspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaHeapspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaHeapspace) { + return nil, false + } + return o.JavaHeapspace, true +} + +// HasJavaHeapspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaHeapspace() bool { + if o != nil && !IsNil(o.JavaHeapspace) { + return true + } + + return false +} + +// SetJavaHeapspace gets a reference to the given int32 and assigns it to the JavaHeapspace field. +func (o *InstanceParameters) SetJavaHeapspace(v int32) { + o.JavaHeapspace = &v +} + +// GetJavaMaxmetaspace returns the JavaMaxmetaspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaMaxmetaspace() int32 { + if o == nil || IsNil(o.JavaMaxmetaspace) { + var ret int32 + return ret + } + return *o.JavaMaxmetaspace +} + +// GetJavaMaxmetaspaceOk returns a tuple with the JavaMaxmetaspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaMaxmetaspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaMaxmetaspace) { + return nil, false + } + return o.JavaMaxmetaspace, true +} + +// HasJavaMaxmetaspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaMaxmetaspace() bool { + if o != nil && !IsNil(o.JavaMaxmetaspace) { + return true + } + + return false +} + +// SetJavaMaxmetaspace gets a reference to the given int32 and assigns it to the JavaMaxmetaspace field. +func (o *InstanceParameters) SetJavaMaxmetaspace(v int32) { + o.JavaMaxmetaspace = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetPlugins returns the Plugins field value if set, zero value otherwise. +func (o *InstanceParameters) GetPlugins() []InstanceParametersPluginsInner { + if o == nil || IsNil(o.Plugins) { + var ret []InstanceParametersPluginsInner + return ret + } + return o.Plugins +} + +// GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetPluginsOk() ([]InstanceParametersPluginsInner, bool) { + if o == nil || IsNil(o.Plugins) { + return nil, false + } + return o.Plugins, true +} + +// HasPlugins returns a boolean if a field has been set. +func (o *InstanceParameters) HasPlugins() bool { + if o != nil && !IsNil(o.Plugins) { + return true + } + + return false +} + +// SetPlugins gets a reference to the given []InstanceParametersPluginsInner and assigns it to the Plugins field. +func (o *InstanceParameters) SetPlugins(v []InstanceParametersPluginsInner) { + o.Plugins = v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +// GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsCiphers() []string { + if o == nil || IsNil(o.TlsCiphers) { + var ret []string + return ret + } + return o.TlsCiphers +} + +// GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { + if o == nil || IsNil(o.TlsCiphers) { + return nil, false + } + return o.TlsCiphers, true +} + +// HasTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsCiphers() bool { + if o != nil && !IsNil(o.TlsCiphers) { + return true + } + + return false +} + +// SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetTlsCiphers(v []string) { + o.TlsCiphers = v +} + +// GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { + if o == nil || IsNil(o.TlsProtocols) { + var ret []InstanceParametersTlsProtocolsInner + return ret + } + return o.TlsProtocols +} + +// GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { + if o == nil || IsNil(o.TlsProtocols) { + return nil, false + } + return o.TlsProtocols, true +} + +// HasTlsProtocols returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsProtocols() bool { + if o != nil && !IsNil(o.TlsProtocols) { + return true + } + + return false +} + +// SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +// Deprecated +func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { + o.TlsProtocols = v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.JavaGarbageCollector) { + toSerialize["java_garbage_collector"] = o.JavaGarbageCollector + } + if !IsNil(o.JavaHeapspace) { + toSerialize["java_heapspace"] = o.JavaHeapspace + } + if !IsNil(o.JavaMaxmetaspace) { + toSerialize["java_maxmetaspace"] = o.JavaMaxmetaspace + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.Plugins) { + toSerialize["plugins"] = o.Plugins + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + if !IsNil(o.TlsCiphers) { + toSerialize["tls-ciphers"] = o.TlsCiphers + } + if !IsNil(o.TlsProtocols) { + toSerialize["tls-protocols"] = o.TlsProtocols + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "graphite") + delete(additionalProperties, "java_garbage_collector") + delete(additionalProperties, "java_heapspace") + delete(additionalProperties, "java_maxmetaspace") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "plugins") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "syslog") + delete(additionalProperties, "tls-ciphers") + delete(additionalProperties, "tls-protocols") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_parameters_java_garbage_collector.go b/services/opensearch/v2api/model_instance_parameters_java_garbage_collector.go new file mode 100644 index 000000000..b8cd7f860 --- /dev/null +++ b/services/opensearch/v2api/model_instance_parameters_java_garbage_collector.go @@ -0,0 +1,117 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersJavaGarbageCollector the model 'InstanceParametersJavaGarbageCollector' +type InstanceParametersJavaGarbageCollector string + +// List of InstanceParameters_java_garbage_collector +const ( + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_SERIAL_GC InstanceParametersJavaGarbageCollector = "UseSerialGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_PARALLEL_GC InstanceParametersJavaGarbageCollector = "UseParallelGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_PARALLEL_OLD_GC InstanceParametersJavaGarbageCollector = "UseParallelOldGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC InstanceParametersJavaGarbageCollector = "UseG1GC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_UNKNOWN_DEFAULT_OPEN_API InstanceParametersJavaGarbageCollector = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersJavaGarbageCollector enum +var AllowedInstanceParametersJavaGarbageCollectorEnumValues = []InstanceParametersJavaGarbageCollector{ + "UseSerialGC", + "UseParallelGC", + "UseParallelOldGC", + "UseG1GC", + "unknown_default_open_api", +} + +func (v *InstanceParametersJavaGarbageCollector) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersJavaGarbageCollector(value) + for _, existing := range AllowedInstanceParametersJavaGarbageCollectorEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersJavaGarbageCollectorFromValue returns a pointer to a valid InstanceParametersJavaGarbageCollector +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersJavaGarbageCollectorFromValue(v string) (*InstanceParametersJavaGarbageCollector, error) { + ev := InstanceParametersJavaGarbageCollector(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersJavaGarbageCollector: valid values are %v", v, AllowedInstanceParametersJavaGarbageCollectorEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersJavaGarbageCollector) IsValid() bool { + for _, existing := range AllowedInstanceParametersJavaGarbageCollectorEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_java_garbage_collector value +func (v InstanceParametersJavaGarbageCollector) Ptr() *InstanceParametersJavaGarbageCollector { + return &v +} + +type NullableInstanceParametersJavaGarbageCollector struct { + value *InstanceParametersJavaGarbageCollector + isSet bool +} + +func (v NullableInstanceParametersJavaGarbageCollector) Get() *InstanceParametersJavaGarbageCollector { + return v.value +} + +func (v *NullableInstanceParametersJavaGarbageCollector) Set(val *InstanceParametersJavaGarbageCollector) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersJavaGarbageCollector) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersJavaGarbageCollector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersJavaGarbageCollector(val *InstanceParametersJavaGarbageCollector) *NullableInstanceParametersJavaGarbageCollector { + return &NullableInstanceParametersJavaGarbageCollector{value: val, isSet: true} +} + +func (v NullableInstanceParametersJavaGarbageCollector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersJavaGarbageCollector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_parameters_plugins_inner.go b/services/opensearch/v2api/model_instance_parameters_plugins_inner.go new file mode 100644 index 000000000..a9f515822 --- /dev/null +++ b/services/opensearch/v2api/model_instance_parameters_plugins_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersPluginsInner the model 'InstanceParametersPluginsInner' +type InstanceParametersPluginsInner string + +// List of InstanceParameters_plugins_inner +const ( + INSTANCEPARAMETERSPLUGINSINNER_REPOSITORY_S3 InstanceParametersPluginsInner = "repository-s3" + INSTANCEPARAMETERSPLUGINSINNER_REPOSITORY_AZURE InstanceParametersPluginsInner = "repository-azure" + INSTANCEPARAMETERSPLUGINSINNER_ANALYSIS_PHONETIC InstanceParametersPluginsInner = "analysis-phonetic" + INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersPluginsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersPluginsInner enum +var AllowedInstanceParametersPluginsInnerEnumValues = []InstanceParametersPluginsInner{ + "repository-s3", + "repository-azure", + "analysis-phonetic", + "unknown_default_open_api", +} + +func (v *InstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersPluginsInner(value) + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersPluginsInnerFromValue returns a pointer to a valid InstanceParametersPluginsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersPluginsInnerFromValue(v string) (*InstanceParametersPluginsInner, error) { + ev := InstanceParametersPluginsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersPluginsInner: valid values are %v", v, AllowedInstanceParametersPluginsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersPluginsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_plugins_inner value +func (v InstanceParametersPluginsInner) Ptr() *InstanceParametersPluginsInner { + return &v +} + +type NullableInstanceParametersPluginsInner struct { + value *InstanceParametersPluginsInner + isSet bool +} + +func (v NullableInstanceParametersPluginsInner) Get() *InstanceParametersPluginsInner { + return v.value +} + +func (v *NullableInstanceParametersPluginsInner) Set(val *InstanceParametersPluginsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersPluginsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersPluginsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersPluginsInner(val *InstanceParametersPluginsInner) *NullableInstanceParametersPluginsInner { + return &NullableInstanceParametersPluginsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersPluginsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_parameters_tls_protocols_inner.go b/services/opensearch/v2api/model_instance_parameters_tls_protocols_inner.go new file mode 100644 index 000000000..22d1ddfbf --- /dev/null +++ b/services/opensearch/v2api/model_instance_parameters_tls_protocols_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocolsInner the model 'InstanceParametersTlsProtocolsInner' +type InstanceParametersTlsProtocolsInner string + +// List of InstanceParameters_tls_protocols_inner +const ( + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_2 InstanceParametersTlsProtocolsInner = "TLSv1.2" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_3 InstanceParametersTlsProtocolsInner = "TLSv1.3" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocolsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocolsInner enum +var AllowedInstanceParametersTlsProtocolsInnerEnumValues = []InstanceParametersTlsProtocolsInner{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocolsInner(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersTlsProtocolsInnerFromValue returns a pointer to a valid InstanceParametersTlsProtocolsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersTlsProtocolsInnerFromValue(v string) (*InstanceParametersTlsProtocolsInner, error) { + ev := InstanceParametersTlsProtocolsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocolsInner: valid values are %v", v, AllowedInstanceParametersTlsProtocolsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersTlsProtocolsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_tls_protocols_inner value +func (v InstanceParametersTlsProtocolsInner) Ptr() *InstanceParametersTlsProtocolsInner { + return &v +} + +type NullableInstanceParametersTlsProtocolsInner struct { + value *InstanceParametersTlsProtocolsInner + isSet bool +} + +func (v NullableInstanceParametersTlsProtocolsInner) Get() *InstanceParametersTlsProtocolsInner { + return v.value +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Set(val *InstanceParametersTlsProtocolsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersTlsProtocolsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersTlsProtocolsInner(val *InstanceParametersTlsProtocolsInner) *NullableInstanceParametersTlsProtocolsInner { + return &NullableInstanceParametersTlsProtocolsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersTlsProtocolsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_schema.go b/services/opensearch/v2api/model_instance_schema.go new file mode 100644 index 000000000..682e130f7 --- /dev/null +++ b/services/opensearch/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_instance_status.go b/services/opensearch/v2api/model_instance_status.go new file mode 100644 index 000000000..648d55fcf --- /dev/null +++ b/services/opensearch/v2api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_list_backups_response.go b/services/opensearch/v2api/model_list_backups_response.go new file mode 100644 index 000000000..f8a8a1ee7 --- /dev/null +++ b/services/opensearch/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_list_credentials_response.go b/services/opensearch/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..54bc65387 --- /dev/null +++ b/services/opensearch/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_list_instances_response.go b/services/opensearch/v2api/model_list_instances_response.go new file mode 100644 index 000000000..302811b29 --- /dev/null +++ b/services/opensearch/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_list_offerings_response.go b/services/opensearch/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..08ec2ea50 --- /dev/null +++ b/services/opensearch/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_list_restores_response.go b/services/opensearch/v2api/model_list_restores_response.go new file mode 100644 index 000000000..a7ab7c6ee --- /dev/null +++ b/services/opensearch/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_offering.go b/services/opensearch/v2api/model_offering.go new file mode 100644 index 000000000..398074b37 --- /dev/null +++ b/services/opensearch/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_partial_update_instance_payload.go b/services/opensearch/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..dde078e68 --- /dev/null +++ b/services/opensearch/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_plan.go b/services/opensearch/v2api/model_plan.go new file mode 100644 index 000000000..9a19f2603 --- /dev/null +++ b/services/opensearch/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_raw_credentials.go b/services/opensearch/v2api/model_raw_credentials.go new file mode 100644 index 000000000..8d81bb192 --- /dev/null +++ b/services/opensearch/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_restore.go b/services/opensearch/v2api/model_restore.go new file mode 100644 index 000000000..b9223a7b7 --- /dev/null +++ b/services/opensearch/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_schema.go b/services/opensearch/v2api/model_schema.go new file mode 100644 index 000000000..f37825dd3 --- /dev/null +++ b/services/opensearch/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_trigger_restore_response.go b/services/opensearch/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..b3b60aece --- /dev/null +++ b/services/opensearch/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_update_backups_config_payload.go b/services/opensearch/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..a632885b4 --- /dev/null +++ b/services/opensearch/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/model_update_backups_config_response.go b/services/opensearch/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..97b0c8579 --- /dev/null +++ b/services/opensearch/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v2api/response.go b/services/opensearch/v2api/response.go new file mode 100644 index 000000000..1c50af4d5 --- /dev/null +++ b/services/opensearch/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/opensearch/v2api/utils.go b/services/opensearch/v2api/utils.go new file mode 100644 index 000000000..3f2a4aafc --- /dev/null +++ b/services/opensearch/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 0a3c666e2..24a562c9f 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.10.0 +- `v3alpha1api`: Align package to latest API specification + ## v1.9.0 - `v2api`: - **Improvement**: Use new `WaiterHelper` struct in the PostgreSQL Flex WaitHandler diff --git a/services/postgresflex/VERSION b/services/postgresflex/VERSION index e2f650c40..e1e35526c 100644 --- a/services/postgresflex/VERSION +++ b/services/postgresflex/VERSION @@ -1 +1 @@ -v1.9.0 \ No newline at end of file +v1.10.0 \ No newline at end of file diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index f87355dc7..6e745cd65 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -b007357148d67833f3db635716935453d20a8609 +9873a8f7a4120017699e43baba2e8b2af7bca93e diff --git a/services/postgresflex/v3alpha1api/api_default.go b/services/postgresflex/v3alpha1api/api_default.go index 378953bd5..a62b33995 100644 --- a/services/postgresflex/v3alpha1api/api_default.go +++ b/services/postgresflex/v3alpha1api/api_default.go @@ -156,8 +156,8 @@ type DefaultAPI interface { GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request - // @return GetBackupResponse - GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + // @return BackupData + GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) /* GetCollationsRequest Get Collations for an Instance @@ -644,6 +644,17 @@ func (a *DefaultAPIService) CloneRequestExecute(r ApiCloneRequestRequest) (*Clon newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 422 { var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -675,6 +686,17 @@ func (a *DefaultAPIService) CloneRequestExecute(r ApiCloneRequestRequest) (*Clon } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -866,8 +888,8 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -877,8 +899,8 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -897,6 +919,17 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -1093,6 +1126,17 @@ func (a *DefaultAPIService) CreateInstanceRequestExecute(r ApiCreateInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -1273,7 +1317,7 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1295,6 +1339,17 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1304,6 +1359,17 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -1473,7 +1539,7 @@ func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 423 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1493,6 +1559,17 @@ func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -1668,6 +1745,17 @@ func (a *DefaultAPIService) DeleteInstanceRequestExecute(r ApiDeleteInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -1827,7 +1915,18 @@ func (a *DefaultAPIService) DeleteUserRequestExecute(r ApiDeleteUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1847,6 +1946,17 @@ func (a *DefaultAPIService) DeleteUserRequestExecute(r ApiDeleteUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -1863,7 +1973,7 @@ type ApiGetBackupRequestRequest struct { backupId int32 } -func (r ApiGetBackupRequestRequest) Execute() (*GetBackupResponse, error) { +func (r ApiGetBackupRequestRequest) Execute() (*BackupData, error) { return r.ApiService.GetBackupRequestExecute(r) } @@ -1892,13 +2002,13 @@ func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId stri // Execute executes the request // -// @return GetBackupResponse -func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { +// @return BackupData +func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetBackupResponse + localVarReturnValue *BackupData ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackupRequest") @@ -2029,6 +2139,17 @@ func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2217,6 +2338,17 @@ func (a *DefaultAPIService) GetCollationsRequestExecute(r ApiGetCollationsReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2398,6 +2530,17 @@ func (a *DefaultAPIService) GetDatabaseRequestExecute(r ApiGetDatabaseRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2620,6 +2763,17 @@ func (a *DefaultAPIService) GetFlavorsRequestExecute(r ApiGetFlavorsRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2797,6 +2951,17 @@ func (a *DefaultAPIService) GetInstanceRequestExecute(r ApiGetInstanceRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2978,6 +3143,17 @@ func (a *DefaultAPIService) GetUserRequestExecute(r ApiGetUserRequestRequest) (* } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3388,6 +3564,17 @@ func (a *DefaultAPIService) ListBackupsRequestExecute(r ApiListBackupsRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3603,6 +3790,17 @@ func (a *DefaultAPIService) ListDatabasesRequestExecute(r ApiListDatabasesReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3814,6 +4012,17 @@ func (a *DefaultAPIService) ListInstancesRequestExecute(r ApiListInstancesReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3991,6 +4200,17 @@ func (a *DefaultAPIService) ListRolesRequestExecute(r ApiListRolesRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -4206,6 +4426,17 @@ func (a *DefaultAPIService) ListUsersRequestExecute(r ApiListUsersRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -4417,6 +4648,17 @@ func (a *DefaultAPIService) ProtectInstanceRequestExecute(r ApiProtectInstanceRe } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -4589,8 +4831,8 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4600,8 +4842,8 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4620,6 +4862,17 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -4801,8 +5054,8 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4812,8 +5065,8 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4832,6 +5085,17 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5003,8 +5267,8 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5014,8 +5278,8 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5034,6 +5298,17 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5223,6 +5498,17 @@ func (a *DefaultAPIService) UpdateInstancePartiallyRequestExecute(r ApiUpdateIns newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5232,6 +5518,17 @@ func (a *DefaultAPIService) UpdateInstancePartiallyRequestExecute(r ApiUpdateIns } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5421,6 +5718,17 @@ func (a *DefaultAPIService) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequ newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5430,6 +5738,17 @@ func (a *DefaultAPIService) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5598,8 +5917,8 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5609,8 +5928,8 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5629,6 +5948,17 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5800,8 +6130,8 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5811,8 +6141,8 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5831,6 +6161,17 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } diff --git a/services/postgresflex/v3alpha1api/api_default_mock.go b/services/postgresflex/v3alpha1api/api_default_mock.go index 8a2fefee0..15a607e45 100644 --- a/services/postgresflex/v3alpha1api/api_default_mock.go +++ b/services/postgresflex/v3alpha1api/api_default_mock.go @@ -36,7 +36,7 @@ type DefaultAPIServiceMock struct { // DeleteUserRequestExecuteMock can be populated to implement the behavior of the DeleteUserRequestExecute function of this mock DeleteUserRequestExecuteMock *func(r ApiDeleteUserRequestRequest) error // GetBackupRequestExecuteMock can be populated to implement the behavior of the GetBackupRequestExecute function of this mock - GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*BackupData, error) // GetCollationsRequestExecuteMock can be populated to implement the behavior of the GetCollationsRequestExecute function of this mock GetCollationsRequestExecuteMock *func(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) // GetDatabaseRequestExecuteMock can be populated to implement the behavior of the GetDatabaseRequestExecute function of this mock @@ -227,9 +227,9 @@ func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId s } // GetBackupRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupRequestExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { +func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) { if a.GetBackupRequestExecuteMock == nil { - var localVarReturnValue *GetBackupResponse + var localVarReturnValue *BackupData return localVarReturnValue, nil } diff --git a/services/postgresflex/v3alpha1api/model_list_backup.go b/services/postgresflex/v3alpha1api/model_backup_data.go similarity index 71% rename from services/postgresflex/v3alpha1api/model_list_backup.go rename to services/postgresflex/v3alpha1api/model_backup_data.go index 6086a3a75..f8253074c 100644 --- a/services/postgresflex/v3alpha1api/model_list_backup.go +++ b/services/postgresflex/v3alpha1api/model_backup_data.go @@ -16,11 +16,11 @@ import ( "fmt" ) -// checks if the ListBackup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackup{} +// checks if the BackupData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupData{} -// ListBackup struct for ListBackup -type ListBackup struct { +// BackupData struct for BackupData +type BackupData struct { // The time when the backup was completed in RFC3339 format. CompletionTime string `json:"completionTime"` // The ID of the backup. @@ -36,14 +36,14 @@ type ListBackup struct { AdditionalProperties map[string]interface{} } -type _ListBackup ListBackup +type _BackupData BackupData -// NewListBackup instantiates a new ListBackup object +// NewBackupData instantiates a new BackupData 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 NewListBackup(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *ListBackup { - this := ListBackup{} +func NewBackupData(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *BackupData { + this := BackupData{} this.CompletionTime = completionTime this.Id = id this.Name = name @@ -53,16 +53,16 @@ func NewListBackup(completionTime string, id int32, name string, retainedUntil s return &this } -// NewListBackupWithDefaults instantiates a new ListBackup object +// NewBackupDataWithDefaults instantiates a new BackupData 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 NewListBackupWithDefaults() *ListBackup { - this := ListBackup{} +func NewBackupDataWithDefaults() *BackupData { + this := BackupData{} return &this } // GetCompletionTime returns the CompletionTime field value -func (o *ListBackup) GetCompletionTime() string { +func (o *BackupData) GetCompletionTime() string { if o == nil { var ret string return ret @@ -73,7 +73,7 @@ func (o *ListBackup) GetCompletionTime() string { // GetCompletionTimeOk returns a tuple with the CompletionTime field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetCompletionTimeOk() (*string, bool) { +func (o *BackupData) GetCompletionTimeOk() (*string, bool) { if o == nil { return nil, false } @@ -81,12 +81,12 @@ func (o *ListBackup) GetCompletionTimeOk() (*string, bool) { } // SetCompletionTime sets field value -func (o *ListBackup) SetCompletionTime(v string) { +func (o *BackupData) SetCompletionTime(v string) { o.CompletionTime = v } // GetId returns the Id field value -func (o *ListBackup) GetId() int32 { +func (o *BackupData) GetId() int32 { if o == nil { var ret int32 return ret @@ -97,7 +97,7 @@ func (o *ListBackup) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetIdOk() (*int32, bool) { +func (o *BackupData) GetIdOk() (*int32, bool) { if o == nil { return nil, false } @@ -105,12 +105,12 @@ func (o *ListBackup) GetIdOk() (*int32, bool) { } // SetId sets field value -func (o *ListBackup) SetId(v int32) { +func (o *BackupData) SetId(v int32) { o.Id = v } // GetName returns the Name field value -func (o *ListBackup) GetName() string { +func (o *BackupData) GetName() string { if o == nil { var ret string return ret @@ -121,7 +121,7 @@ func (o *ListBackup) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetNameOk() (*string, bool) { +func (o *BackupData) GetNameOk() (*string, bool) { if o == nil { return nil, false } @@ -129,12 +129,12 @@ func (o *ListBackup) GetNameOk() (*string, bool) { } // SetName sets field value -func (o *ListBackup) SetName(v string) { +func (o *BackupData) SetName(v string) { o.Name = v } // GetRetainedUntil returns the RetainedUntil field value -func (o *ListBackup) GetRetainedUntil() string { +func (o *BackupData) GetRetainedUntil() string { if o == nil { var ret string return ret @@ -145,7 +145,7 @@ func (o *ListBackup) GetRetainedUntil() string { // GetRetainedUntilOk returns a tuple with the RetainedUntil field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetRetainedUntilOk() (*string, bool) { +func (o *BackupData) GetRetainedUntilOk() (*string, bool) { if o == nil { return nil, false } @@ -153,12 +153,12 @@ func (o *ListBackup) GetRetainedUntilOk() (*string, bool) { } // SetRetainedUntil sets field value -func (o *ListBackup) SetRetainedUntil(v string) { +func (o *BackupData) SetRetainedUntil(v string) { o.RetainedUntil = v } // GetSize returns the Size field value -func (o *ListBackup) GetSize() int32 { +func (o *BackupData) GetSize() int32 { if o == nil { var ret int32 return ret @@ -169,7 +169,7 @@ func (o *ListBackup) GetSize() int32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetSizeOk() (*int32, bool) { +func (o *BackupData) GetSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -177,12 +177,12 @@ func (o *ListBackup) GetSizeOk() (*int32, bool) { } // SetSize sets field value -func (o *ListBackup) SetSize(v int32) { +func (o *BackupData) SetSize(v int32) { o.Size = v } // GetType returns the Type field value -func (o *ListBackup) GetType() string { +func (o *BackupData) GetType() string { if o == nil { var ret string return ret @@ -193,7 +193,7 @@ func (o *ListBackup) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetTypeOk() (*string, bool) { +func (o *BackupData) GetTypeOk() (*string, bool) { if o == nil { return nil, false } @@ -201,11 +201,11 @@ func (o *ListBackup) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *ListBackup) SetType(v string) { +func (o *BackupData) SetType(v string) { o.Type = v } -func (o ListBackup) MarshalJSON() ([]byte, error) { +func (o BackupData) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -213,7 +213,7 @@ func (o ListBackup) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ListBackup) ToMap() (map[string]interface{}, error) { +func (o BackupData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["completionTime"] = o.CompletionTime toSerialize["id"] = o.Id @@ -229,7 +229,7 @@ func (o ListBackup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { +func (o *BackupData) 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. @@ -256,15 +256,15 @@ func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { } } - varListBackup := _ListBackup{} + varBackupData := _BackupData{} - err = json.Unmarshal(data, &varListBackup) + err = json.Unmarshal(data, &varBackupData) if err != nil { return err } - *o = ListBackup(varListBackup) + *o = BackupData(varBackupData) additionalProperties := make(map[string]interface{}) @@ -281,38 +281,38 @@ func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { return err } -type NullableListBackup struct { - value *ListBackup +type NullableBackupData struct { + value *BackupData isSet bool } -func (v NullableListBackup) Get() *ListBackup { +func (v NullableBackupData) Get() *BackupData { return v.value } -func (v *NullableListBackup) Set(val *ListBackup) { +func (v *NullableBackupData) Set(val *BackupData) { v.value = val v.isSet = true } -func (v NullableListBackup) IsSet() bool { +func (v NullableBackupData) IsSet() bool { return v.isSet } -func (v *NullableListBackup) Unset() { +func (v *NullableBackupData) Unset() { v.value = nil v.isSet = false } -func NewNullableListBackup(val *ListBackup) *NullableListBackup { - return &NullableListBackup{value: val, isSet: true} +func NewNullableBackupData(val *BackupData) *NullableBackupData { + return &NullableBackupData{value: val, isSet: true} } -func (v NullableListBackup) MarshalJSON() ([]byte, error) { +func (v NullableBackupData) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableListBackup) UnmarshalJSON(src []byte) error { +func (v *NullableBackupData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go index f74d96940..0cb85373d 100644 --- a/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go +++ b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go @@ -21,8 +21,13 @@ var _ MappedNullable = &CloneInstanceOverrides{} // CloneInstanceOverrides struct for CloneInstanceOverrides type CloneInstanceOverrides struct { - // The storage class for the storage. - PerformanceClass string `json:"performanceClass"` + // The storage class for the storage. If both 'class' and 'performanceClass' are provided, the value of 'class' will take precedence. + Class *string `json:"class,omitempty"` + // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. + Name *string `json:"name,omitempty"` + // Deprecated: The storage class for the storage. Use the 'class' field instead. If both fields are provided, the value of 'class' will take precedence. + // Deprecated + PerformanceClass *string `json:"performanceClass,omitempty"` // The storage size in Gigabytes. Size int32 `json:"size"` AdditionalProperties map[string]interface{} @@ -34,9 +39,8 @@ type _CloneInstanceOverrides CloneInstanceOverrides // 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 NewCloneInstanceOverrides(performanceClass string, size int32) *CloneInstanceOverrides { +func NewCloneInstanceOverrides(size int32) *CloneInstanceOverrides { this := CloneInstanceOverrides{} - this.PerformanceClass = performanceClass this.Size = size return &this } @@ -49,28 +53,103 @@ func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { return &this } -// GetPerformanceClass returns the PerformanceClass field value -func (o *CloneInstanceOverrides) GetPerformanceClass() string { - if o == nil { +// GetClass returns the Class field value if set, zero value otherwise. +func (o *CloneInstanceOverrides) GetClass() string { + if o == nil || IsNil(o.Class) { var ret string return ret } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *CloneInstanceOverrides) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *CloneInstanceOverrides) SetClass(v string) { + o.Class = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CloneInstanceOverrides) 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 *CloneInstanceOverrides) 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 *CloneInstanceOverrides) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } - return o.PerformanceClass + return false } -// GetPerformanceClassOk returns a tuple with the PerformanceClass field value +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CloneInstanceOverrides) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated +func (o *CloneInstanceOverrides) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *CloneInstanceOverrides) GetPerformanceClassOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.PerformanceClass) { return nil, false } - return &o.PerformanceClass, true + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CloneInstanceOverrides) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false } -// SetPerformanceClass sets field value +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated func (o *CloneInstanceOverrides) SetPerformanceClass(v string) { - o.PerformanceClass = v + o.PerformanceClass = &v } // GetSize returns the Size field value @@ -107,7 +186,15 @@ func (o CloneInstanceOverrides) MarshalJSON() ([]byte, error) { func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["performanceClass"] = o.PerformanceClass + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } toSerialize["size"] = o.Size for key, value := range o.AdditionalProperties { @@ -122,7 +209,6 @@ func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { // 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{ - "performanceClass", "size", } @@ -153,6 +239,8 @@ func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "name") delete(additionalProperties, "performanceClass") delete(additionalProperties, "size") o.AdditionalProperties = additionalProperties diff --git a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go index 478ae8739..53f01c94d 100644 --- a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go @@ -33,7 +33,7 @@ type CreateInstanceRequestPayload struct { Network InstanceNetworkCreate `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` + RetentionDays NullableInt32 `json:"retentionDays"` Storage StorageCreate `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` @@ -46,7 +46,7 @@ type _CreateInstanceRequestPayload CreateInstanceRequestPayload // 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 NewCreateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, replicas Replicas, retentionDays int32, storage StorageCreate, version string) *CreateInstanceRequestPayload { +func NewCreateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, replicas Replicas, retentionDays NullableInt32, storage StorageCreate, version string) *CreateInstanceRequestPayload { this := CreateInstanceRequestPayload{} this.BackupSchedule = backupSchedule this.FlavorId = flavorId @@ -252,27 +252,29 @@ func (o *CreateInstanceRequestPayload) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *CreateInstanceRequestPayload) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *CreateInstanceRequestPayload) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) } // GetStorage returns the Storage field value @@ -344,7 +346,7 @@ func (o CreateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version diff --git a/services/postgresflex/v3alpha1api/model_create_user_request_payload.go b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go index f26e937b7..82c279e00 100644 --- a/services/postgresflex/v3alpha1api/model_create_user_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go @@ -23,8 +23,8 @@ var _ MappedNullable = &CreateUserRequestPayload{} type CreateUserRequestPayload struct { // The name of the user. Name string `json:"name"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` AdditionalProperties map[string]interface{} } @@ -73,9 +73,9 @@ func (o *CreateUserRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *CreateUserRequestPayload) GetRoles() []UserRole { +func (o *CreateUserRequestPayload) GetRoles() []string { if o == nil || IsNil(o.Roles) { - var ret []UserRole + var ret []string return ret } return o.Roles @@ -83,7 +83,7 @@ func (o *CreateUserRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *CreateUserRequestPayload) GetRolesOk() ([]string, bool) { if o == nil || IsNil(o.Roles) { return nil, false } @@ -99,8 +99,8 @@ func (o *CreateUserRequestPayload) HasRoles() bool { return false } -// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. -func (o *CreateUserRequestPayload) SetRoles(v []UserRole) { +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *CreateUserRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_create_user_response.go b/services/postgresflex/v3alpha1api/model_create_user_response.go index 6073751cd..051043885 100644 --- a/services/postgresflex/v3alpha1api/model_create_user_response.go +++ b/services/postgresflex/v3alpha1api/model_create_user_response.go @@ -28,6 +28,8 @@ type CreateUserResponse struct { // The password for the user. Password string `json:"password"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -38,11 +40,12 @@ type _CreateUserResponse CreateUserResponse // 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 NewCreateUserResponse(id int32, name string, password string, status string) *CreateUserResponse { +func NewCreateUserResponse(id int32, name string, password string, state string, status string) *CreateUserResponse { this := CreateUserResponse{} this.Id = id this.Name = name this.Password = password + this.State = state this.Status = status return &this } @@ -127,6 +130,30 @@ func (o *CreateUserResponse) SetPassword(v string) { o.Password = v } +// GetState returns the State field value +func (o *CreateUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *CreateUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *CreateUserResponse) GetStatus() string { if o == nil { @@ -164,6 +191,7 @@ func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["name"] = o.Name toSerialize["password"] = o.Password + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -181,6 +209,7 @@ func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { "id", "name", "password", + "state", "status", } @@ -214,6 +243,7 @@ func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "password") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_get_backup_response.go b/services/postgresflex/v3alpha1api/model_get_backup_response.go deleted file mode 100644 index 68b87f610..000000000 --- a/services/postgresflex/v3alpha1api/model_get_backup_response.go +++ /dev/null @@ -1,318 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT Postgres Flex service - -API version: 3alpha1 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetBackupResponse{} - -// GetBackupResponse struct for GetBackupResponse -type GetBackupResponse struct { - // The time when the backup was completed in RFC3339 format. - CompletionTime string `json:"completionTime"` - // The ID of the backup. - Id int32 `json:"id"` - // The name of the backup. - Name string `json:"name"` - // The time until the backup will be retained. - RetainedUntil string `json:"retainedUntil"` - // The size of the backup in bytes. - Size int32 `json:"size"` - // The type of the backup, which can be automated or manual triggered. - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetBackupResponse GetBackupResponse - -// NewGetBackupResponse instantiates a new GetBackupResponse 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 NewGetBackupResponse(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *GetBackupResponse { - this := GetBackupResponse{} - this.CompletionTime = completionTime - this.Id = id - this.Name = name - this.RetainedUntil = retainedUntil - this.Size = size - this.Type = types - return &this -} - -// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse 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 NewGetBackupResponseWithDefaults() *GetBackupResponse { - this := GetBackupResponse{} - return &this -} - -// GetCompletionTime returns the CompletionTime field value -func (o *GetBackupResponse) GetCompletionTime() string { - if o == nil { - var ret string - return ret - } - - return o.CompletionTime -} - -// GetCompletionTimeOk returns a tuple with the CompletionTime field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetCompletionTimeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CompletionTime, true -} - -// SetCompletionTime sets field value -func (o *GetBackupResponse) SetCompletionTime(v string) { - o.CompletionTime = v -} - -// GetId returns the Id field value -func (o *GetBackupResponse) GetId() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *GetBackupResponse) SetId(v int32) { - o.Id = v -} - -// GetName returns the Name field value -func (o *GetBackupResponse) 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 *GetBackupResponse) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *GetBackupResponse) SetName(v string) { - o.Name = v -} - -// GetRetainedUntil returns the RetainedUntil field value -func (o *GetBackupResponse) GetRetainedUntil() string { - if o == nil { - var ret string - return ret - } - - return o.RetainedUntil -} - -// GetRetainedUntilOk returns a tuple with the RetainedUntil field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetRetainedUntilOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RetainedUntil, true -} - -// SetRetainedUntil sets field value -func (o *GetBackupResponse) SetRetainedUntil(v string) { - o.RetainedUntil = v -} - -// GetSize returns the Size field value -func (o *GetBackupResponse) GetSize() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetSizeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *GetBackupResponse) SetSize(v int32) { - o.Size = v -} - -// GetType returns the Type field value -func (o *GetBackupResponse) 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 *GetBackupResponse) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetBackupResponse) SetType(v string) { - o.Type = v -} - -func (o GetBackupResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["completionTime"] = o.CompletionTime - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["retainedUntil"] = o.RetainedUntil - toSerialize["size"] = o.Size - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetBackupResponse) 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{ - "completionTime", - "id", - "name", - "retainedUntil", - "size", - "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) - } - } - - varGetBackupResponse := _GetBackupResponse{} - - err = json.Unmarshal(data, &varGetBackupResponse) - - if err != nil { - return err - } - - *o = GetBackupResponse(varGetBackupResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "completionTime") - delete(additionalProperties, "id") - delete(additionalProperties, "name") - delete(additionalProperties, "retainedUntil") - delete(additionalProperties, "size") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetBackupResponse struct { - value *GetBackupResponse - isSet bool -} - -func (v NullableGetBackupResponse) Get() *GetBackupResponse { - return v.value -} - -func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetBackupResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetBackupResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { - return &NullableGetBackupResponse{value: val, isSet: true} -} - -func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v3alpha1api/model_get_instance_response.go b/services/postgresflex/v3alpha1api/model_get_instance_response.go index 39791bac2..c80897a76 100644 --- a/services/postgresflex/v3alpha1api/model_get_instance_response.go +++ b/services/postgresflex/v3alpha1api/model_get_instance_response.go @@ -40,9 +40,10 @@ type GetInstanceResponse struct { Network InstanceNetwork `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` - Status Status `json:"status"` - Storage Storage `json:"storage"` + RetentionDays NullableInt32 `json:"retentionDays"` + State Status `json:"state"` + Status Status `json:"status"` + Storage Storage `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` AdditionalProperties map[string]interface{} @@ -54,7 +55,7 @@ type _GetInstanceResponse GetInstanceResponse // 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 NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays int32, status Status, storage Storage, version string) *GetInstanceResponse { +func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays NullableInt32, state Status, status Status, storage Storage, version string) *GetInstanceResponse { this := GetInstanceResponse{} this.BackupSchedule = backupSchedule this.ConnectionInfo = connectionInfo @@ -65,6 +66,7 @@ func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnec this.Network = network this.Replicas = replicas this.RetentionDays = retentionDays + this.State = state this.Status = status this.Storage = storage this.Version = version @@ -368,27 +370,53 @@ func (o *GetInstanceResponse) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *GetInstanceResponse) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetInstanceResponse) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *GetInstanceResponse) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) +} + +// GetState returns the State field value +func (o *GetInstanceResponse) GetState() Status { + if o == nil { + var ret Status + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetStateOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetInstanceResponse) SetState(v Status) { + o.State = v } // GetStatus returns the Status field value @@ -490,7 +518,8 @@ func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() + toSerialize["state"] = o.State toSerialize["status"] = o.Status toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version @@ -516,6 +545,7 @@ func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { "network", "replicas", "retentionDays", + "state", "status", "storage", "version", @@ -560,6 +590,7 @@ func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "network") delete(additionalProperties, "replicas") delete(additionalProperties, "retentionDays") + delete(additionalProperties, "state") delete(additionalProperties, "status") delete(additionalProperties, "storage") delete(additionalProperties, "version") diff --git a/services/postgresflex/v3alpha1api/model_get_user_response.go b/services/postgresflex/v3alpha1api/model_get_user_response.go index 908ef1656..67beae005 100644 --- a/services/postgresflex/v3alpha1api/model_get_user_response.go +++ b/services/postgresflex/v3alpha1api/model_get_user_response.go @@ -26,7 +26,9 @@ type GetUserResponse struct { // The name of the user. Name string `json:"name"` // A list of user roles. - Roles []UserRole `json:"roles"` + Roles []string `json:"roles"` + // The current status of the user. + State string `json:"state"` // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} @@ -38,11 +40,12 @@ type _GetUserResponse GetUserResponse // 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 NewGetUserResponse(id int32, name string, roles []UserRole, status string) *GetUserResponse { +func NewGetUserResponse(id int32, name string, roles []string, state string, status string) *GetUserResponse { this := GetUserResponse{} this.Id = id this.Name = name this.Roles = roles + this.State = state this.Status = status return &this } @@ -104,9 +107,9 @@ func (o *GetUserResponse) SetName(v string) { } // GetRoles returns the Roles field value -func (o *GetUserResponse) GetRoles() []UserRole { +func (o *GetUserResponse) GetRoles() []string { if o == nil { - var ret []UserRole + var ret []string return ret } @@ -115,7 +118,7 @@ func (o *GetUserResponse) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. -func (o *GetUserResponse) GetRolesOk() ([]UserRole, bool) { +func (o *GetUserResponse) GetRolesOk() ([]string, bool) { if o == nil { return nil, false } @@ -123,10 +126,34 @@ func (o *GetUserResponse) GetRolesOk() ([]UserRole, bool) { } // SetRoles sets field value -func (o *GetUserResponse) SetRoles(v []UserRole) { +func (o *GetUserResponse) SetRoles(v []string) { o.Roles = v } +// GetState returns the State field value +func (o *GetUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *GetUserResponse) GetStatus() string { if o == nil { @@ -164,6 +191,7 @@ func (o GetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["name"] = o.Name toSerialize["roles"] = o.Roles + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -181,6 +209,7 @@ func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { "id", "name", "roles", + "state", "status", } @@ -214,6 +243,7 @@ func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "roles") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_instance_encryption.go b/services/postgresflex/v3alpha1api/model_instance_encryption.go index 72c169041..51b2f02bc 100644 --- a/services/postgresflex/v3alpha1api/model_instance_encryption.go +++ b/services/postgresflex/v3alpha1api/model_instance_encryption.go @@ -19,7 +19,7 @@ import ( // checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceEncryption{} -// InstanceEncryption The configuration for instance's volume and backup storage encryption. ⚠︝ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. +// InstanceEncryption The configuration for instance's volume and backup storage encryption. ⚠️ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. type InstanceEncryption struct { // The encryption-key key identifier KekKeyId string `json:"kekKeyId"` diff --git a/services/postgresflex/v3alpha1api/model_instance_sort.go b/services/postgresflex/v3alpha1api/model_instance_sort.go index dda248669..3c4bb23f6 100644 --- a/services/postgresflex/v3alpha1api/model_instance_sort.go +++ b/services/postgresflex/v3alpha1api/model_instance_sort.go @@ -27,6 +27,8 @@ const ( INSTANCESORT_IS_DELETABLE_ASC InstanceSort = "is_deletable.asc" INSTANCESORT_NAME_ASC InstanceSort = "name.asc" INSTANCESORT_NAME_DESC InstanceSort = "name.desc" + INSTANCESORT_STATE_ASC InstanceSort = "state.asc" + INSTANCESORT_STATE_DESC InstanceSort = "state.desc" INSTANCESORT_STATUS_ASC InstanceSort = "status.asc" INSTANCESORT_STATUS_DESC InstanceSort = "status.desc" INSTANCESORT_UNKNOWN_DEFAULT_OPEN_API InstanceSort = "unknown_default_open_api" @@ -40,6 +42,8 @@ var AllowedInstanceSortEnumValues = []InstanceSort{ "is_deletable.asc", "name.asc", "name.desc", + "state.asc", + "state.desc", "status.asc", "status.desc", "unknown_default_open_api", diff --git a/services/postgresflex/v3alpha1api/model_list_backup_response.go b/services/postgresflex/v3alpha1api/model_list_backup_response.go index aec06a49c..2ea8b3f29 100644 --- a/services/postgresflex/v3alpha1api/model_list_backup_response.go +++ b/services/postgresflex/v3alpha1api/model_list_backup_response.go @@ -22,7 +22,7 @@ var _ MappedNullable = &ListBackupResponse{} // ListBackupResponse struct for ListBackupResponse type ListBackupResponse struct { // The list containing the information about the backups. - Backups []ListBackup `json:"backups"` + Backups []BackupData `json:"backups"` Pagination Pagination `json:"pagination"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _ListBackupResponse ListBackupResponse // 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 NewListBackupResponse(backups []ListBackup, pagination Pagination) *ListBackupResponse { +func NewListBackupResponse(backups []BackupData, pagination Pagination) *ListBackupResponse { this := ListBackupResponse{} this.Backups = backups this.Pagination = pagination @@ -49,9 +49,9 @@ func NewListBackupResponseWithDefaults() *ListBackupResponse { } // GetBackups returns the Backups field value -func (o *ListBackupResponse) GetBackups() []ListBackup { +func (o *ListBackupResponse) GetBackups() []BackupData { if o == nil { - var ret []ListBackup + var ret []BackupData return ret } @@ -60,7 +60,7 @@ func (o *ListBackupResponse) GetBackups() []ListBackup { // GetBackupsOk returns a tuple with the Backups field value // and a boolean to check if the value has been set. -func (o *ListBackupResponse) GetBackupsOk() ([]ListBackup, bool) { +func (o *ListBackupResponse) GetBackupsOk() ([]BackupData, bool) { if o == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *ListBackupResponse) GetBackupsOk() ([]ListBackup, bool) { } // SetBackups sets field value -func (o *ListBackupResponse) SetBackups(v []ListBackup) { +func (o *ListBackupResponse) SetBackups(v []BackupData) { o.Backups = v } diff --git a/services/postgresflex/v3alpha1api/model_list_instance.go b/services/postgresflex/v3alpha1api/model_list_instance.go index 0b44d87d0..ec695e1d9 100644 --- a/services/postgresflex/v3alpha1api/model_list_instance.go +++ b/services/postgresflex/v3alpha1api/model_list_instance.go @@ -27,6 +27,7 @@ type ListInstance struct { IsDeletable bool `json:"isDeletable"` // The name of the instance. Name string `json:"name"` + State Status `json:"state"` Status Status `json:"status"` AdditionalProperties map[string]interface{} } @@ -37,11 +38,12 @@ type _ListInstance ListInstance // 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 NewListInstance(id string, isDeletable bool, name string, status Status) *ListInstance { +func NewListInstance(id string, isDeletable bool, name string, state Status, status Status) *ListInstance { this := ListInstance{} this.Id = id this.IsDeletable = isDeletable this.Name = name + this.State = state this.Status = status return &this } @@ -126,6 +128,30 @@ func (o *ListInstance) SetName(v string) { o.Name = v } +// GetState returns the State field value +func (o *ListInstance) GetState() Status { + if o == nil { + var ret Status + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetStateOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListInstance) SetState(v Status) { + o.State = v +} + // GetStatus returns the Status field value func (o *ListInstance) GetStatus() Status { if o == nil { @@ -163,6 +189,7 @@ func (o ListInstance) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["isDeletable"] = o.IsDeletable toSerialize["name"] = o.Name + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -180,6 +207,7 @@ func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { "id", "isDeletable", "name", + "state", "status", } @@ -213,6 +241,7 @@ func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "isDeletable") delete(additionalProperties, "name") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_list_user.go b/services/postgresflex/v3alpha1api/model_list_user.go index 73fbe6c07..cc5a42b89 100644 --- a/services/postgresflex/v3alpha1api/model_list_user.go +++ b/services/postgresflex/v3alpha1api/model_list_user.go @@ -26,6 +26,8 @@ type ListUser struct { // The name of the user. Name string `json:"name"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -36,10 +38,11 @@ type _ListUser ListUser // 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 NewListUser(id int32, name string, status string) *ListUser { +func NewListUser(id int32, name string, state string, status string) *ListUser { this := ListUser{} this.Id = id this.Name = name + this.State = state this.Status = status return &this } @@ -100,6 +103,30 @@ func (o *ListUser) SetName(v string) { o.Name = v } +// GetState returns the State field value +func (o *ListUser) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListUser) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *ListUser) GetStatus() string { if o == nil { @@ -136,6 +163,7 @@ func (o ListUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["name"] = o.Name + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -152,6 +180,7 @@ func (o *ListUser) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "id", "name", + "state", "status", } @@ -184,6 +213,7 @@ func (o *ListUser) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "name") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_reset_user_response.go b/services/postgresflex/v3alpha1api/model_reset_user_response.go index 3705db4b4..1097ea23a 100644 --- a/services/postgresflex/v3alpha1api/model_reset_user_response.go +++ b/services/postgresflex/v3alpha1api/model_reset_user_response.go @@ -26,6 +26,8 @@ type ResetUserResponse struct { // The password for the user. Password string `json:"password"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -36,10 +38,11 @@ type _ResetUserResponse ResetUserResponse // 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 NewResetUserResponse(name string, password string, status string) *ResetUserResponse { +func NewResetUserResponse(name string, password string, state string, status string) *ResetUserResponse { this := ResetUserResponse{} this.Name = name this.Password = password + this.State = state this.Status = status return &this } @@ -100,6 +103,30 @@ func (o *ResetUserResponse) SetPassword(v string) { o.Password = v } +// GetState returns the State field value +func (o *ResetUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ResetUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *ResetUserResponse) GetStatus() string { if o == nil { @@ -136,6 +163,7 @@ func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["password"] = o.Password + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -152,6 +180,7 @@ func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "name", "password", + "state", "status", } @@ -184,6 +213,7 @@ func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "name") delete(additionalProperties, "password") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_storage.go b/services/postgresflex/v3alpha1api/model_storage.go index a5f40e70b..823cd26b5 100644 --- a/services/postgresflex/v3alpha1api/model_storage.go +++ b/services/postgresflex/v3alpha1api/model_storage.go @@ -20,7 +20,10 @@ var _ MappedNullable = &Storage{} // Storage The object containing information about the storage size and class. type Storage struct { - // The storage class for the storage. + // The storage class for the storage. If both 'class' and 'performanceClass' are provided, the value of 'class' will take precedence. + Class *string `json:"class,omitempty"` + // Deprecated: The storage class for the storage. Use the 'class' field instead. If both fields are provided, the value of 'class' will take precedence. + // Deprecated PerformanceClass *string `json:"performanceClass,omitempty"` // The storage size in Gigabytes. Size *int32 `json:"size,omitempty"` @@ -46,7 +49,40 @@ func NewStorageWithDefaults() *Storage { return &this } +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Storage) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Storage) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Storage) SetClass(v string) { + o.Class = &v +} + // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated func (o *Storage) GetPerformanceClass() string { if o == nil || IsNil(o.PerformanceClass) { var ret string @@ -57,6 +93,7 @@ func (o *Storage) GetPerformanceClass() string { // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Storage) GetPerformanceClassOk() (*string, bool) { if o == nil || IsNil(o.PerformanceClass) { return nil, false @@ -74,6 +111,7 @@ func (o *Storage) HasPerformanceClass() bool { } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated func (o *Storage) SetPerformanceClass(v string) { o.PerformanceClass = &v } @@ -120,6 +158,9 @@ func (o Storage) MarshalJSON() ([]byte, error) { func (o Storage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } if !IsNil(o.PerformanceClass) { toSerialize["performanceClass"] = o.PerformanceClass } @@ -148,6 +189,7 @@ func (o *Storage) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") delete(additionalProperties, "performanceClass") delete(additionalProperties, "size") o.AdditionalProperties = additionalProperties diff --git a/services/postgresflex/v3alpha1api/model_storage_create.go b/services/postgresflex/v3alpha1api/model_storage_create.go index 1eae30644..9dc107cd0 100644 --- a/services/postgresflex/v3alpha1api/model_storage_create.go +++ b/services/postgresflex/v3alpha1api/model_storage_create.go @@ -21,8 +21,11 @@ var _ MappedNullable = &StorageCreate{} // StorageCreate The object containing information about the storage size and class. type StorageCreate struct { - // The storage class for the storage. - PerformanceClass string `json:"performanceClass"` + // The storage class for the storage. If both 'class' and 'performanceClass' are provided, the value of 'class' will take precedence. + Class *string `json:"class,omitempty"` + // Deprecated: The storage class for the storage. Use the 'class' field instead. If both fields are provided, the value of 'class' will take precedence. + // Deprecated + PerformanceClass *string `json:"performanceClass,omitempty"` // The storage size in Gigabytes. Size int32 `json:"size"` AdditionalProperties map[string]interface{} @@ -34,9 +37,8 @@ type _StorageCreate StorageCreate // 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 NewStorageCreate(performanceClass string, size int32) *StorageCreate { +func NewStorageCreate(size int32) *StorageCreate { this := StorageCreate{} - this.PerformanceClass = performanceClass this.Size = size return &this } @@ -49,28 +51,71 @@ func NewStorageCreateWithDefaults() *StorageCreate { return &this } -// GetPerformanceClass returns the PerformanceClass field value -func (o *StorageCreate) GetPerformanceClass() string { - if o == nil { +// GetClass returns the Class field value if set, zero value otherwise. +func (o *StorageCreate) GetClass() string { + if o == nil || IsNil(o.Class) { var ret string return ret } + return *o.Class +} - return o.PerformanceClass +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true } -// GetPerformanceClassOk returns a tuple with the PerformanceClass field value +// HasClass returns a boolean if a field has been set. +func (o *StorageCreate) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *StorageCreate) SetClass(v string) { + o.Class = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated +func (o *StorageCreate) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *StorageCreate) GetPerformanceClassOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.PerformanceClass) { return nil, false } - return &o.PerformanceClass, true + return o.PerformanceClass, true } -// SetPerformanceClass sets field value +// HasPerformanceClass returns a boolean if a field has been set. +func (o *StorageCreate) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated func (o *StorageCreate) SetPerformanceClass(v string) { - o.PerformanceClass = v + o.PerformanceClass = &v } // GetSize returns the Size field value @@ -107,7 +152,12 @@ func (o StorageCreate) MarshalJSON() ([]byte, error) { func (o StorageCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["performanceClass"] = o.PerformanceClass + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } toSerialize["size"] = o.Size for key, value := range o.AdditionalProperties { @@ -122,7 +172,6 @@ func (o *StorageCreate) UnmarshalJSON(data []byte) (err error) { // 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{ - "performanceClass", "size", } @@ -153,6 +202,7 @@ func (o *StorageCreate) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") delete(additionalProperties, "performanceClass") delete(additionalProperties, "size") o.AdditionalProperties = additionalProperties diff --git a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go index 85f6e84eb..48ce9c273 100644 --- a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go @@ -32,7 +32,7 @@ type UpdateInstanceRequestPayload struct { Network InstanceNetworkUpdate `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` + RetentionDays NullableInt32 `json:"retentionDays"` Storage StorageUpdate `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` @@ -45,7 +45,7 @@ type _UpdateInstanceRequestPayload UpdateInstanceRequestPayload // 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 NewUpdateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, replicas Replicas, retentionDays int32, storage StorageUpdate, version string) *UpdateInstanceRequestPayload { +func NewUpdateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, replicas Replicas, retentionDays NullableInt32, storage StorageUpdate, version string) *UpdateInstanceRequestPayload { this := UpdateInstanceRequestPayload{} this.BackupSchedule = backupSchedule this.FlavorId = flavorId @@ -219,27 +219,29 @@ func (o *UpdateInstanceRequestPayload) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *UpdateInstanceRequestPayload) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *UpdateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *UpdateInstanceRequestPayload) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) } // GetStorage returns the Storage field value @@ -308,7 +310,7 @@ func (o UpdateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version diff --git a/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go index e7c6c48f8..5852bb8d7 100644 --- a/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go @@ -22,8 +22,8 @@ var _ MappedNullable = &UpdateUserPartiallyRequestPayload{} type UpdateUserPartiallyRequestPayload struct { // The name of the user. Name *string `json:"name,omitempty"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` AdditionalProperties map[string]interface{} } @@ -79,9 +79,9 @@ func (o *UpdateUserPartiallyRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UpdateUserPartiallyRequestPayload) GetRoles() []UserRole { +func (o *UpdateUserPartiallyRequestPayload) GetRoles() []string { if o == nil || IsNil(o.Roles) { - var ret []UserRole + var ret []string return ret } return o.Roles @@ -89,7 +89,7 @@ func (o *UpdateUserPartiallyRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateUserPartiallyRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *UpdateUserPartiallyRequestPayload) GetRolesOk() ([]string, bool) { if o == nil || IsNil(o.Roles) { return nil, false } @@ -105,8 +105,8 @@ func (o *UpdateUserPartiallyRequestPayload) HasRoles() bool { return false } -// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. -func (o *UpdateUserPartiallyRequestPayload) SetRoles(v []UserRole) { +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UpdateUserPartiallyRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_update_user_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go index 556df7b2c..fe0f79378 100644 --- a/services/postgresflex/v3alpha1api/model_update_user_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go @@ -23,8 +23,8 @@ var _ MappedNullable = &UpdateUserRequestPayload{} type UpdateUserRequestPayload struct { // The name of the user. Name *string `json:"name,omitempty"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles"` AdditionalProperties map[string]interface{} } @@ -34,7 +34,7 @@ type _UpdateUserRequestPayload UpdateUserRequestPayload // 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 NewUpdateUserRequestPayload(roles []UserRole) *UpdateUserRequestPayload { +func NewUpdateUserRequestPayload(roles []string) *UpdateUserRequestPayload { this := UpdateUserRequestPayload{} this.Roles = roles return &this @@ -81,9 +81,9 @@ func (o *UpdateUserRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value -func (o *UpdateUserRequestPayload) GetRoles() []UserRole { +func (o *UpdateUserRequestPayload) GetRoles() []string { if o == nil { - var ret []UserRole + var ret []string return ret } @@ -92,7 +92,7 @@ func (o *UpdateUserRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. -func (o *UpdateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *UpdateUserRequestPayload) GetRolesOk() ([]string, bool) { if o == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *UpdateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { } // SetRoles sets field value -func (o *UpdateUserRequestPayload) SetRoles(v []UserRole) { +func (o *UpdateUserRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_user_role.go b/services/postgresflex/v3alpha1api/model_user_role.go deleted file mode 100644 index dd31c990d..000000000 --- a/services/postgresflex/v3alpha1api/model_user_role.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT Postgres Flex service - -API version: 3alpha1 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3alpha1api - -import ( - "encoding/json" - "fmt" -) - -// UserRole The user role for the instance. -type UserRole string - -// List of user.role -const ( - USERROLE_CREATEDB UserRole = "createdb" - USERROLE_LOGIN UserRole = "login" - USERROLE_UNKNOWN_DEFAULT_OPEN_API UserRole = "unknown_default_open_api" -) - -// All allowed values of UserRole enum -var AllowedUserRoleEnumValues = []UserRole{ - "createdb", - "login", - "unknown_default_open_api", -} - -func (v *UserRole) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UserRole(value) - for _, existing := range AllowedUserRoleEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = USERROLE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewUserRoleFromValue returns a pointer to a valid UserRole -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUserRoleFromValue(v string) (*UserRole, error) { - ev := UserRole(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UserRole: valid values are %v", v, AllowedUserRoleEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UserRole) IsValid() bool { - for _, existing := range AllowedUserRoleEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to user.role value -func (v UserRole) Ptr() *UserRole { - return &v -} - -type NullableUserRole struct { - value *UserRole - isSet bool -} - -func (v NullableUserRole) Get() *UserRole { - return v.value -} - -func (v *NullableUserRole) Set(val *UserRole) { - v.value = val - v.isSet = true -} - -func (v NullableUserRole) IsSet() bool { - return v.isSet -} - -func (v *NullableUserRole) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserRole(val *UserRole) *NullableUserRole { - return &NullableUserRole{value: val, isSet: true} -} - -func (v NullableUserRole) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserRole) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v3alpha1api/model_user_sort.go b/services/postgresflex/v3alpha1api/model_user_sort.go index a064d3ae4..005dd42e1 100644 --- a/services/postgresflex/v3alpha1api/model_user_sort.go +++ b/services/postgresflex/v3alpha1api/model_user_sort.go @@ -25,6 +25,8 @@ const ( USERSORT_ID_DESC UserSort = "id.desc" USERSORT_NAME_DESC UserSort = "name.desc" USERSORT_NAME_ASC UserSort = "name.asc" + USERSORT_STATE_DESC UserSort = "state.desc" + USERSORT_STATE_ASC UserSort = "state.asc" USERSORT_STATUS_DESC UserSort = "status.desc" USERSORT_STATUS_ASC UserSort = "status.asc" USERSORT_UNKNOWN_DEFAULT_OPEN_API UserSort = "unknown_default_open_api" @@ -36,6 +38,8 @@ var AllowedUserSortEnumValues = []UserSort{ "id.desc", "name.desc", "name.asc", + "state.desc", + "state.asc", "status.desc", "status.asc", "unknown_default_open_api", diff --git a/services/rabbitmq/CHANGELOG.md b/services/rabbitmq/CHANGELOG.md index 87f28a98e..540ba9574 100644 --- a/services/rabbitmq/CHANGELOG.md +++ b/services/rabbitmq/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v2api`: + - New package which can be used for communication with the rabbitmq v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `Roles`, `TlsCiphers`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-11. + ## v0.31.0 - **Feature:** Introduce enums for various attributes diff --git a/services/rabbitmq/VERSION b/services/rabbitmq/VERSION index 4e0bea4fb..60453e690 100644 --- a/services/rabbitmq/VERSION +++ b/services/rabbitmq/VERSION @@ -1 +1 @@ -v0.31.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/rabbitmq/api_default.go b/services/rabbitmq/api_default.go index de2e5e010..022d41383 100644 --- a/services/rabbitmq/api_default.go +++ b/services/rabbitmq/api_default.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/rabbitmq/client.go b/services/rabbitmq/client.go index a1111e9ef..f0ea7e79d 100644 --- a/services/rabbitmq/client.go +++ b/services/rabbitmq/client.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT RabbitMQ API API v1.1.0 +// APIClient manages communication with the STACKIT RabbitMQ API API v2.2.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/rabbitmq/configuration.go b/services/rabbitmq/configuration.go index d7266bd8c..65ac4d893 100644 --- a/services/rabbitmq/configuration.go +++ b/services/rabbitmq/configuration.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://rabbitmq.api.{region}stackit.cloud", + URL: "https://rabbitmq.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/rabbitmq/model_backup.go b/services/rabbitmq/model_backup.go index 87a45eb94..1d635c009 100644 --- a/services/rabbitmq/model_backup.go +++ b/services/rabbitmq/model_backup.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/rabbitmq/model_backup_test.go b/services/rabbitmq/model_backup_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_backup_test.go +++ b/services/rabbitmq/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_create_backup_response_item.go b/services/rabbitmq/model_create_backup_response_item.go index 3da60ccde..d24264063 100644 --- a/services/rabbitmq/model_create_backup_response_item.go +++ b/services/rabbitmq/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/rabbitmq/model_create_backup_response_item_test.go b/services/rabbitmq/model_create_backup_response_item_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_create_backup_response_item_test.go +++ b/services/rabbitmq/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_create_credentials_payload.go b/services/rabbitmq/model_create_credentials_payload.go new file mode 100644 index 000000000..64e68d4ac --- /dev/null +++ b/services/rabbitmq/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package rabbitmq + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *CredentialsParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = CredentialsParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = CredentialsParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given CredentialsParameters and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/model_create_credentials_payload_test.go b/services/rabbitmq/model_create_credentials_payload_test.go new file mode 100644 index 000000000..236e4e5f2 --- /dev/null +++ b/services/rabbitmq/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package rabbitmq diff --git a/services/rabbitmq/model_create_instance_payload.go b/services/rabbitmq/model_create_instance_payload.go index 42bd0f41e..0c26fd0ba 100644 --- a/services/rabbitmq/model_create_instance_payload.go +++ b/services/rabbitmq/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_create_instance_payload_test.go b/services/rabbitmq/model_create_instance_payload_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_create_instance_payload_test.go +++ b/services/rabbitmq/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_create_instance_response.go b/services/rabbitmq/model_create_instance_response.go index 4adfa4f4c..a98cfdc93 100644 --- a/services/rabbitmq/model_create_instance_response.go +++ b/services/rabbitmq/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_create_instance_response_test.go b/services/rabbitmq/model_create_instance_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_create_instance_response_test.go +++ b/services/rabbitmq/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials.go b/services/rabbitmq/model_credentials.go index 5d615137b..585463808 100644 --- a/services/rabbitmq/model_credentials.go +++ b/services/rabbitmq/model_credentials.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials_list_item.go b/services/rabbitmq/model_credentials_list_item.go index 0d3826ca1..a18f922da 100644 --- a/services/rabbitmq/model_credentials_list_item.go +++ b/services/rabbitmq/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials_list_item_test.go b/services/rabbitmq/model_credentials_list_item_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_credentials_list_item_test.go +++ b/services/rabbitmq/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials_parameters.go b/services/rabbitmq/model_credentials_parameters.go new file mode 100644 index 000000000..5754f2323 --- /dev/null +++ b/services/rabbitmq/model_credentials_parameters.go @@ -0,0 +1,152 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package rabbitmq + +import ( + "encoding/json" +) + +// checks if the CredentialsParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsParameters{} + +/* + types and functions for roles +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CredentialsParametersGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CredentialsParametersGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CredentialsParametersGetRolesRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCredentialsParametersGetRolesAttributeTypeOk(arg CredentialsParametersGetRolesAttributeType) (ret CredentialsParametersGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCredentialsParametersGetRolesAttributeType(arg *CredentialsParametersGetRolesAttributeType, val CredentialsParametersGetRolesRetType) { + *arg = &val +} + +// CredentialsParameters struct for CredentialsParameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CredentialsParameters struct { + // A list of roles to assign to the generated credentials. If not provided, standard default role 'policymaker' will be assigned. + Roles CredentialsParametersGetRolesAttributeType `json:"roles,omitempty"` +} + +// NewCredentialsParameters instantiates a new CredentialsParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCredentialsParameters() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// NewCredentialsParametersWithDefaults instantiates a new CredentialsParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCredentialsParametersWithDefaults() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CredentialsParameters) GetRoles() (res CredentialsParametersGetRolesRetType) { + res, _ = o.GetRolesOk() + return +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CredentialsParameters) GetRolesOk() (ret CredentialsParametersGetRolesRetType, ok bool) { + return getCredentialsParametersGetRolesAttributeTypeOk(o.Roles) +} + +// HasRoles returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CredentialsParameters) HasRoles() bool { + _, ok := o.GetRolesOk() + return ok +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CredentialsParameters) SetRoles(v CredentialsParametersGetRolesRetType) { + setCredentialsParametersGetRolesAttributeType(&o.Roles, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CredentialsParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCredentialsParametersGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCredentialsParameters struct { + value *CredentialsParameters + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCredentialsParameters) Get() *CredentialsParameters { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCredentialsParameters) Set(val *CredentialsParameters) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCredentialsParameters) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCredentialsParameters) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCredentialsParameters(val *CredentialsParameters) *NullableCredentialsParameters { + return &NullableCredentialsParameters{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCredentialsParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCredentialsParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/model_credentials_parameters_test.go b/services/rabbitmq/model_credentials_parameters_test.go new file mode 100644 index 000000000..236e4e5f2 --- /dev/null +++ b/services/rabbitmq/model_credentials_parameters_test.go @@ -0,0 +1,11 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package rabbitmq diff --git a/services/rabbitmq/model_credentials_response.go b/services/rabbitmq/model_credentials_response.go index 4d9279be6..7d180e687 100644 --- a/services/rabbitmq/model_credentials_response.go +++ b/services/rabbitmq/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials_response_test.go b/services/rabbitmq/model_credentials_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_credentials_response_test.go +++ b/services/rabbitmq/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_credentials_test.go b/services/rabbitmq/model_credentials_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_credentials_test.go +++ b/services/rabbitmq/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_error.go b/services/rabbitmq/model_error.go index 1801e3f89..7ee067335 100644 --- a/services/rabbitmq/model_error.go +++ b/services/rabbitmq/model_error.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_error_test.go b/services/rabbitmq/model_error_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_error_test.go +++ b/services/rabbitmq/model_error_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_get_metrics_response.go b/services/rabbitmq/model_get_metrics_response.go index 32ca6c841..221357cdc 100644 --- a/services/rabbitmq/model_get_metrics_response.go +++ b/services/rabbitmq/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_get_metrics_response_test.go b/services/rabbitmq/model_get_metrics_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_get_metrics_response_test.go +++ b/services/rabbitmq/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance.go b/services/rabbitmq/model_instance.go index 7adc87418..37745a78d 100644 --- a/services/rabbitmq/model_instance.go +++ b/services/rabbitmq/model_instance.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_last_operation.go b/services/rabbitmq/model_instance_last_operation.go index ed9cc9899..c63e13796 100644 --- a/services/rabbitmq/model_instance_last_operation.go +++ b/services/rabbitmq/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_last_operation_test.go b/services/rabbitmq/model_instance_last_operation_test.go index e1fe48685..a3d204452 100644 --- a/services/rabbitmq/model_instance_last_operation_test.go +++ b/services/rabbitmq/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_parameters.go b/services/rabbitmq/model_instance_parameters.go index d53294e52..e14c9acc6 100644 --- a/services/rabbitmq/model_instance_parameters.go +++ b/services/rabbitmq/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -388,11 +388,14 @@ type InstanceParameters struct { MetricsPrefix InstanceParametersGetMetricsPrefixAttributeType `json:"metrics_prefix,omitempty"` MonitoringInstanceId InstanceParametersGetMonitoringInstanceIdAttributeType `json:"monitoring_instance_id,omitempty"` Plugins InstanceParametersGetPluginsAttributeType `json:"plugins,omitempty"` - Roles InstanceParametersGetRolesAttributeType `json:"roles,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + Roles InstanceParametersGetRolesAttributeType `json:"roles,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` - Syslog InstanceParametersGetSyslogAttributeType `json:"syslog,omitempty"` - TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` + Syslog InstanceParametersGetSyslogAttributeType `json:"syslog,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. TlsProtocols InstanceParametersGetTlsProtocolsAttributeType `json:"tls-protocols,omitempty"` } diff --git a/services/rabbitmq/model_instance_parameters_test.go b/services/rabbitmq/model_instance_parameters_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_instance_parameters_test.go +++ b/services/rabbitmq/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_schema.go b/services/rabbitmq/model_instance_schema.go index 5f10ed3d0..b577a7dd9 100644 --- a/services/rabbitmq/model_instance_schema.go +++ b/services/rabbitmq/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_schema_test.go b/services/rabbitmq/model_instance_schema_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_instance_schema_test.go +++ b/services/rabbitmq/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_instance_test.go b/services/rabbitmq/model_instance_test.go index 6cc4539e1..dc84c55ef 100644 --- a/services/rabbitmq/model_instance_test.go +++ b/services/rabbitmq/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_backups_response.go b/services/rabbitmq/model_list_backups_response.go index 32a22ce22..cfa70b890 100644 --- a/services/rabbitmq/model_list_backups_response.go +++ b/services/rabbitmq/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_backups_response_test.go b/services/rabbitmq/model_list_backups_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_list_backups_response_test.go +++ b/services/rabbitmq/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_credentials_response.go b/services/rabbitmq/model_list_credentials_response.go index 1773dbb7b..4dece4c20 100644 --- a/services/rabbitmq/model_list_credentials_response.go +++ b/services/rabbitmq/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_credentials_response_test.go b/services/rabbitmq/model_list_credentials_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_list_credentials_response_test.go +++ b/services/rabbitmq/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_instances_response.go b/services/rabbitmq/model_list_instances_response.go index 0d1937ec9..1fd0bd2fc 100644 --- a/services/rabbitmq/model_list_instances_response.go +++ b/services/rabbitmq/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_instances_response_test.go b/services/rabbitmq/model_list_instances_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_list_instances_response_test.go +++ b/services/rabbitmq/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_offerings_response.go b/services/rabbitmq/model_list_offerings_response.go index b76db19a7..2a1972855 100644 --- a/services/rabbitmq/model_list_offerings_response.go +++ b/services/rabbitmq/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_offerings_response_test.go b/services/rabbitmq/model_list_offerings_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_list_offerings_response_test.go +++ b/services/rabbitmq/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_restores_response.go b/services/rabbitmq/model_list_restores_response.go index a4481ef2b..42f3ad9c0 100644 --- a/services/rabbitmq/model_list_restores_response.go +++ b/services/rabbitmq/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_list_restores_response_test.go b/services/rabbitmq/model_list_restores_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_list_restores_response_test.go +++ b/services/rabbitmq/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_offering.go b/services/rabbitmq/model_offering.go index 141178705..2b8997cbc 100644 --- a/services/rabbitmq/model_offering.go +++ b/services/rabbitmq/model_offering.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/rabbitmq/model_offering_test.go b/services/rabbitmq/model_offering_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_offering_test.go +++ b/services/rabbitmq/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_partial_update_instance_payload.go b/services/rabbitmq/model_partial_update_instance_payload.go index d09e5f36b..9faac3863 100644 --- a/services/rabbitmq/model_partial_update_instance_payload.go +++ b/services/rabbitmq/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_partial_update_instance_payload_test.go b/services/rabbitmq/model_partial_update_instance_payload_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_partial_update_instance_payload_test.go +++ b/services/rabbitmq/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_plan.go b/services/rabbitmq/model_plan.go index 073e146b4..07d8e6e8a 100644 --- a/services/rabbitmq/model_plan.go +++ b/services/rabbitmq/model_plan.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_plan_test.go b/services/rabbitmq/model_plan_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_plan_test.go +++ b/services/rabbitmq/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_raw_credentials.go b/services/rabbitmq/model_raw_credentials.go index 1601ace77..7f5e63ecd 100644 --- a/services/rabbitmq/model_raw_credentials.go +++ b/services/rabbitmq/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_raw_credentials_test.go b/services/rabbitmq/model_raw_credentials_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_raw_credentials_test.go +++ b/services/rabbitmq/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_restore.go b/services/rabbitmq/model_restore.go index 624c3e481..e633da2d0 100644 --- a/services/rabbitmq/model_restore.go +++ b/services/rabbitmq/model_restore.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/rabbitmq/model_restore_test.go b/services/rabbitmq/model_restore_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_restore_test.go +++ b/services/rabbitmq/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_schema.go b/services/rabbitmq/model_schema.go index 1a57eba75..41e1d341d 100644 --- a/services/rabbitmq/model_schema.go +++ b/services/rabbitmq/model_schema.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_schema_test.go b/services/rabbitmq/model_schema_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_schema_test.go +++ b/services/rabbitmq/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_trigger_restore_response.go b/services/rabbitmq/model_trigger_restore_response.go index a356941ac..44bb838ec 100644 --- a/services/rabbitmq/model_trigger_restore_response.go +++ b/services/rabbitmq/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/rabbitmq/model_trigger_restore_response_test.go b/services/rabbitmq/model_trigger_restore_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_trigger_restore_response_test.go +++ b/services/rabbitmq/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_update_backups_config_payload.go b/services/rabbitmq/model_update_backups_config_payload.go index ee5b7702c..aecaf6853 100644 --- a/services/rabbitmq/model_update_backups_config_payload.go +++ b/services/rabbitmq/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_update_backups_config_payload_test.go b/services/rabbitmq/model_update_backups_config_payload_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_update_backups_config_payload_test.go +++ b/services/rabbitmq/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_update_backups_config_response.go b/services/rabbitmq/model_update_backups_config_response.go index fc5fb9da2..16432bee0 100644 --- a/services/rabbitmq/model_update_backups_config_response.go +++ b/services/rabbitmq/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/model_update_backups_config_response_test.go b/services/rabbitmq/model_update_backups_config_response_test.go index 36793fa7a..236e4e5f2 100644 --- a/services/rabbitmq/model_update_backups_config_response_test.go +++ b/services/rabbitmq/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/oas_commit b/services/rabbitmq/oas_commit index c08a6770d..0c0e97d62 100644 --- a/services/rabbitmq/oas_commit +++ b/services/rabbitmq/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +327e1a89405f6b4994afaee72ecc7e5a24c9c42d diff --git a/services/rabbitmq/utils.go b/services/rabbitmq/utils.go index 1409db18b..cb17c80c4 100644 --- a/services/rabbitmq/utils.go +++ b/services/rabbitmq/utils.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/api_default.go b/services/rabbitmq/v1api/api_default.go index 01009cc3d..2b1194a63 100644 --- a/services/rabbitmq/v1api/api_default.go +++ b/services/rabbitmq/v1api/api_default.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/rabbitmq/v1api/api_default_mock.go b/services/rabbitmq/v1api/api_default_mock.go index 2484b5636..253d023cb 100644 --- a/services/rabbitmq/v1api/api_default_mock.go +++ b/services/rabbitmq/v1api/api_default_mock.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/client.go b/services/rabbitmq/v1api/client.go index 29e54865d..9aaa3e554 100644 --- a/services/rabbitmq/v1api/client.go +++ b/services/rabbitmq/v1api/client.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT RabbitMQ API API v1.1.0 +// APIClient manages communication with the STACKIT RabbitMQ API API v1.3.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/rabbitmq/v1api/configuration.go b/services/rabbitmq/v1api/configuration.go index 9ba230d0f..b38380cde 100644 --- a/services/rabbitmq/v1api/configuration.go +++ b/services/rabbitmq/v1api/configuration.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_backup.go b/services/rabbitmq/v1api/model_backup.go index 612700aaa..a206e415e 100644 --- a/services/rabbitmq/v1api/model_backup.go +++ b/services/rabbitmq/v1api/model_backup.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_create_backup_response_item.go b/services/rabbitmq/v1api/model_create_backup_response_item.go index 375b8e0c8..26868a961 100644 --- a/services/rabbitmq/v1api/model_create_backup_response_item.go +++ b/services/rabbitmq/v1api/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_create_credentials_payload.go b/services/rabbitmq/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..f81ca29b6 --- /dev/null +++ b/services/rabbitmq/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters *CredentialsParameters `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() CredentialsParameters { + if o == nil || IsNil(o.Parameters) { + var ret CredentialsParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (*CredentialsParameters, 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 *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given CredentialsParameters and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v CredentialsParameters) { + o.Parameters = &v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_create_instance_payload.go b/services/rabbitmq/v1api/model_create_instance_payload.go index c12196fa1..d8ec8bd80 100644 --- a/services/rabbitmq/v1api/model_create_instance_payload.go +++ b/services/rabbitmq/v1api/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_create_instance_response.go b/services/rabbitmq/v1api/model_create_instance_response.go index 2108c1064..486d67990 100644 --- a/services/rabbitmq/v1api/model_create_instance_response.go +++ b/services/rabbitmq/v1api/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_credentials.go b/services/rabbitmq/v1api/model_credentials.go index e4e2f616b..51534e584 100644 --- a/services/rabbitmq/v1api/model_credentials.go +++ b/services/rabbitmq/v1api/model_credentials.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_credentials_list_item.go b/services/rabbitmq/v1api/model_credentials_list_item.go index 8cd368b20..9c597ae23 100644 --- a/services/rabbitmq/v1api/model_credentials_list_item.go +++ b/services/rabbitmq/v1api/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_credentials_parameters.go b/services/rabbitmq/v1api/model_credentials_parameters.go new file mode 100644 index 000000000..0f9ceff71 --- /dev/null +++ b/services/rabbitmq/v1api/model_credentials_parameters.go @@ -0,0 +1,154 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CredentialsParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsParameters{} + +// CredentialsParameters struct for CredentialsParameters +type CredentialsParameters struct { + // A list of roles to assign to the generated credentials. If not provided, standard default role 'policymaker' will be assigned. + Roles []CredentialsParametersRolesInner `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsParameters CredentialsParameters + +// NewCredentialsParameters instantiates a new CredentialsParameters 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 NewCredentialsParameters() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// NewCredentialsParametersWithDefaults instantiates a new CredentialsParameters 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 NewCredentialsParametersWithDefaults() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CredentialsParameters) GetRoles() []CredentialsParametersRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []CredentialsParametersRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsParameters) GetRolesOk() ([]CredentialsParametersRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CredentialsParameters) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []CredentialsParametersRolesInner and assigns it to the Roles field. +func (o *CredentialsParameters) SetRoles(v []CredentialsParametersRolesInner) { + o.Roles = v +} + +func (o CredentialsParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsParameters) UnmarshalJSON(data []byte) (err error) { + varCredentialsParameters := _CredentialsParameters{} + + err = json.Unmarshal(data, &varCredentialsParameters) + + if err != nil { + return err + } + + *o = CredentialsParameters(varCredentialsParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsParameters struct { + value *CredentialsParameters + isSet bool +} + +func (v NullableCredentialsParameters) Get() *CredentialsParameters { + return v.value +} + +func (v *NullableCredentialsParameters) Set(val *CredentialsParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsParameters(val *CredentialsParameters) *NullableCredentialsParameters { + return &NullableCredentialsParameters{value: val, isSet: true} +} + +func (v NullableCredentialsParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_credentials_parameters_roles_inner.go b/services/rabbitmq/v1api/model_credentials_parameters_roles_inner.go new file mode 100644 index 000000000..e424b0fda --- /dev/null +++ b/services/rabbitmq/v1api/model_credentials_parameters_roles_inner.go @@ -0,0 +1,117 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CredentialsParametersRolesInner the model 'CredentialsParametersRolesInner' +type CredentialsParametersRolesInner string + +// List of CredentialsParameters_roles_inner +const ( + CREDENTIALSPARAMETERSROLESINNER_MANAGEMENT CredentialsParametersRolesInner = "management" + CREDENTIALSPARAMETERSROLESINNER_POLICYMAKER CredentialsParametersRolesInner = "policymaker" + CREDENTIALSPARAMETERSROLESINNER_MONITORING CredentialsParametersRolesInner = "monitoring" + CREDENTIALSPARAMETERSROLESINNER_ADMINISTRATOR CredentialsParametersRolesInner = "administrator" + CREDENTIALSPARAMETERSROLESINNER_UNKNOWN_DEFAULT_OPEN_API CredentialsParametersRolesInner = "unknown_default_open_api" +) + +// All allowed values of CredentialsParametersRolesInner enum +var AllowedCredentialsParametersRolesInnerEnumValues = []CredentialsParametersRolesInner{ + "management", + "policymaker", + "monitoring", + "administrator", + "unknown_default_open_api", +} + +func (v *CredentialsParametersRolesInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialsParametersRolesInner(value) + for _, existing := range AllowedCredentialsParametersRolesInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREDENTIALSPARAMETERSROLESINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCredentialsParametersRolesInnerFromValue returns a pointer to a valid CredentialsParametersRolesInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialsParametersRolesInnerFromValue(v string) (*CredentialsParametersRolesInner, error) { + ev := CredentialsParametersRolesInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialsParametersRolesInner: valid values are %v", v, AllowedCredentialsParametersRolesInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialsParametersRolesInner) IsValid() bool { + for _, existing := range AllowedCredentialsParametersRolesInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialsParameters_roles_inner value +func (v CredentialsParametersRolesInner) Ptr() *CredentialsParametersRolesInner { + return &v +} + +type NullableCredentialsParametersRolesInner struct { + value *CredentialsParametersRolesInner + isSet bool +} + +func (v NullableCredentialsParametersRolesInner) Get() *CredentialsParametersRolesInner { + return v.value +} + +func (v *NullableCredentialsParametersRolesInner) Set(val *CredentialsParametersRolesInner) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsParametersRolesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsParametersRolesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsParametersRolesInner(val *CredentialsParametersRolesInner) *NullableCredentialsParametersRolesInner { + return &NullableCredentialsParametersRolesInner{value: val, isSet: true} +} + +func (v NullableCredentialsParametersRolesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsParametersRolesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_credentials_response.go b/services/rabbitmq/v1api/model_credentials_response.go index 5e4d74e57..497c683c8 100644 --- a/services/rabbitmq/v1api/model_credentials_response.go +++ b/services/rabbitmq/v1api/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_error.go b/services/rabbitmq/v1api/model_error.go index eab03b7ab..18dd64372 100644 --- a/services/rabbitmq/v1api/model_error.go +++ b/services/rabbitmq/v1api/model_error.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_get_metrics_response.go b/services/rabbitmq/v1api/model_get_metrics_response.go index 4fd19b58a..ef50db805 100644 --- a/services/rabbitmq/v1api/model_get_metrics_response.go +++ b/services/rabbitmq/v1api/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance.go b/services/rabbitmq/v1api/model_instance.go index d1605e40b..fb277219d 100644 --- a/services/rabbitmq/v1api/model_instance.go +++ b/services/rabbitmq/v1api/model_instance.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_last_operation.go b/services/rabbitmq/v1api/model_instance_last_operation.go index a8d46dfc1..3d77e2b29 100644 --- a/services/rabbitmq/v1api/model_instance_last_operation.go +++ b/services/rabbitmq/v1api/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_last_operation_state.go b/services/rabbitmq/v1api/model_instance_last_operation_state.go index c7c0d336b..1c95ab756 100644 --- a/services/rabbitmq/v1api/model_instance_last_operation_state.go +++ b/services/rabbitmq/v1api/model_instance_last_operation_state.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_last_operation_type.go b/services/rabbitmq/v1api/model_instance_last_operation_type.go index 6ac33814c..024dce149 100644 --- a/services/rabbitmq/v1api/model_instance_last_operation_type.go +++ b/services/rabbitmq/v1api/model_instance_last_operation_type.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_parameters.go b/services/rabbitmq/v1api/model_instance_parameters.go index f0b339ae2..bbf2e8d53 100644 --- a/services/rabbitmq/v1api/model_instance_parameters.go +++ b/services/rabbitmq/v1api/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -32,11 +32,17 @@ type InstanceParameters struct { MetricsPrefix *string `json:"metrics_prefix,omitempty"` MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` Plugins []InstanceParametersPluginsInner `json:"plugins,omitempty"` - Roles []string `json:"roles,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + Roles []string `json:"roles,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog []string `json:"syslog,omitempty"` - TlsCiphers []string `json:"tls-ciphers,omitempty"` + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -333,6 +339,7 @@ func (o *InstanceParameters) SetPlugins(v []InstanceParametersPluginsInner) { } // GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetRoles() []string { if o == nil || IsNil(o.Roles) { var ret []string @@ -343,6 +350,7 @@ func (o *InstanceParameters) GetRoles() []string { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetRolesOk() ([]string, bool) { if o == nil || IsNil(o.Roles) { return nil, false @@ -360,6 +368,7 @@ func (o *InstanceParameters) HasRoles() bool { } // SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated func (o *InstanceParameters) SetRoles(v []string) { o.Roles = v } @@ -429,6 +438,7 @@ func (o *InstanceParameters) SetSyslog(v []string) { } // GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsCiphers() []string { if o == nil || IsNil(o.TlsCiphers) { var ret []string @@ -439,6 +449,7 @@ func (o *InstanceParameters) GetTlsCiphers() []string { // GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { if o == nil || IsNil(o.TlsCiphers) { return nil, false @@ -456,11 +467,13 @@ func (o *InstanceParameters) HasTlsCiphers() bool { } // SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated func (o *InstanceParameters) SetTlsCiphers(v []string) { o.TlsCiphers = v } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { if o == nil || IsNil(o.TlsProtocols) { var ret []InstanceParametersTlsProtocolsInner @@ -471,6 +484,7 @@ func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsI // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false @@ -488,6 +502,7 @@ func (o *InstanceParameters) HasTlsProtocols() bool { } // SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +// Deprecated func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { o.TlsProtocols = v } diff --git a/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go b/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go index 46777c791..a4a118568 100644 --- a/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go +++ b/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go b/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go index 7ee2c0538..fb6be130f 100644 --- a/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go +++ b/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_schema.go b/services/rabbitmq/v1api/model_instance_schema.go index e22533886..f028ca34f 100644 --- a/services/rabbitmq/v1api/model_instance_schema.go +++ b/services/rabbitmq/v1api/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_instance_status.go b/services/rabbitmq/v1api/model_instance_status.go index 70fb1fa69..69d7f1270 100644 --- a/services/rabbitmq/v1api/model_instance_status.go +++ b/services/rabbitmq/v1api/model_instance_status.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_list_backups_response.go b/services/rabbitmq/v1api/model_list_backups_response.go index 5b78f2df9..08d642dee 100644 --- a/services/rabbitmq/v1api/model_list_backups_response.go +++ b/services/rabbitmq/v1api/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_list_credentials_response.go b/services/rabbitmq/v1api/model_list_credentials_response.go index 7ad5f2cc7..8001e567a 100644 --- a/services/rabbitmq/v1api/model_list_credentials_response.go +++ b/services/rabbitmq/v1api/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_list_instances_response.go b/services/rabbitmq/v1api/model_list_instances_response.go index 5109610bf..492eb0103 100644 --- a/services/rabbitmq/v1api/model_list_instances_response.go +++ b/services/rabbitmq/v1api/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_list_offerings_response.go b/services/rabbitmq/v1api/model_list_offerings_response.go index 2f57a5887..42b7e99c1 100644 --- a/services/rabbitmq/v1api/model_list_offerings_response.go +++ b/services/rabbitmq/v1api/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_list_restores_response.go b/services/rabbitmq/v1api/model_list_restores_response.go index 9667e2e9d..e8566f7a6 100644 --- a/services/rabbitmq/v1api/model_list_restores_response.go +++ b/services/rabbitmq/v1api/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_offering.go b/services/rabbitmq/v1api/model_offering.go index e3abacb2b..f4a97e0cf 100644 --- a/services/rabbitmq/v1api/model_offering.go +++ b/services/rabbitmq/v1api/model_offering.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_partial_update_instance_payload.go b/services/rabbitmq/v1api/model_partial_update_instance_payload.go index 312ee79c3..c49463f5d 100644 --- a/services/rabbitmq/v1api/model_partial_update_instance_payload.go +++ b/services/rabbitmq/v1api/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_plan.go b/services/rabbitmq/v1api/model_plan.go index 37d325109..4d21c4e73 100644 --- a/services/rabbitmq/v1api/model_plan.go +++ b/services/rabbitmq/v1api/model_plan.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_raw_credentials.go b/services/rabbitmq/v1api/model_raw_credentials.go index b9b7d2fda..89153c185 100644 --- a/services/rabbitmq/v1api/model_raw_credentials.go +++ b/services/rabbitmq/v1api/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_restore.go b/services/rabbitmq/v1api/model_restore.go index ab5a9e4ff..091f77714 100644 --- a/services/rabbitmq/v1api/model_restore.go +++ b/services/rabbitmq/v1api/model_restore.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_schema.go b/services/rabbitmq/v1api/model_schema.go index d7951338c..cd39efb42 100644 --- a/services/rabbitmq/v1api/model_schema.go +++ b/services/rabbitmq/v1api/model_schema.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_trigger_restore_response.go b/services/rabbitmq/v1api/model_trigger_restore_response.go index 32fd0c086..15e679c3e 100644 --- a/services/rabbitmq/v1api/model_trigger_restore_response.go +++ b/services/rabbitmq/v1api/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_update_backups_config_payload.go b/services/rabbitmq/v1api/model_update_backups_config_payload.go index cb0c5e487..ecec76ef8 100644 --- a/services/rabbitmq/v1api/model_update_backups_config_payload.go +++ b/services/rabbitmq/v1api/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/model_update_backups_config_response.go b/services/rabbitmq/v1api/model_update_backups_config_response.go index 9ff2a6a2d..9aa517267 100644 --- a/services/rabbitmq/v1api/model_update_backups_config_response.go +++ b/services/rabbitmq/v1api/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/response.go b/services/rabbitmq/v1api/response.go index 6c704b5b2..70ef9ca55 100644 --- a/services/rabbitmq/v1api/response.go +++ b/services/rabbitmq/v1api/response.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v1api/utils.go b/services/rabbitmq/v1api/utils.go index a274b173d..86ec0fb54 100644 --- a/services/rabbitmq/v1api/utils.go +++ b/services/rabbitmq/v1api/utils.go @@ -3,7 +3,7 @@ STACKIT RabbitMQ API The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.3.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/rabbitmq/v2api/api_default.go b/services/rabbitmq/v2api/api_default.go new file mode 100644 index 000000000..1263affbf --- /dev/null +++ b/services/rabbitmq/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 410 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupsConfigPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/rabbitmq/v2api/api_default_mock.go b/services/rabbitmq/v2api/api_default_mock.go new file mode 100644 index 000000000..062adc4c1 --- /dev/null +++ b/services/rabbitmq/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/rabbitmq/v2api/client.go b/services/rabbitmq/v2api/client.go new file mode 100644 index 000000000..dc2c69b74 --- /dev/null +++ b/services/rabbitmq/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT RabbitMQ API API v2.2.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/rabbitmq/v2api/configuration.go b/services/rabbitmq/v2api/configuration.go new file mode 100644 index 000000000..2f5331ca1 --- /dev/null +++ b/services/rabbitmq/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/rabbitmq", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://rabbitmq.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/rabbitmq/v2api/model_backup.go b/services/rabbitmq/v2api/model_backup.go new file mode 100644 index 000000000..621fc1625 --- /dev/null +++ b/services/rabbitmq/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_create_backup_response_item.go b/services/rabbitmq/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..da89ae372 --- /dev/null +++ b/services/rabbitmq/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_create_credentials_payload.go b/services/rabbitmq/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..84e49b98d --- /dev/null +++ b/services/rabbitmq/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters *CredentialsParameters `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() CredentialsParameters { + if o == nil || IsNil(o.Parameters) { + var ret CredentialsParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (*CredentialsParameters, 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 *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given CredentialsParameters and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v CredentialsParameters) { + o.Parameters = &v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_create_instance_payload.go b/services/rabbitmq/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..edbd444ef --- /dev/null +++ b/services/rabbitmq/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_create_instance_response.go b/services/rabbitmq/v2api/model_create_instance_response.go new file mode 100644 index 000000000..5bddfd462 --- /dev/null +++ b/services/rabbitmq/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_credentials.go b/services/rabbitmq/v2api/model_credentials.go new file mode 100644 index 000000000..7c7ac40ee --- /dev/null +++ b/services/rabbitmq/v2api/model_credentials.go @@ -0,0 +1,558 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Hosts []string `json:"hosts,omitempty"` + // for rabbitmq only + HttpApiUri *string `json:"http_api_uri,omitempty"` + HttpApiUris []string `json:"http_api_uris,omitempty"` + Management *string `json:"management,omitempty"` + Mqtt *string `json:"mqtt,omitempty"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + Stomp *string `json:"stomp,omitempty"` + Uri *string `json:"uri,omitempty"` + Uris []string `json:"uris,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *Credentials) GetHosts() []string { + if o == nil || IsNil(o.Hosts) { + var ret []string + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostsOk() ([]string, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *Credentials) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []string and assigns it to the Hosts field. +func (o *Credentials) SetHosts(v []string) { + o.Hosts = v +} + +// GetHttpApiUri returns the HttpApiUri field value if set, zero value otherwise. +func (o *Credentials) GetHttpApiUri() string { + if o == nil || IsNil(o.HttpApiUri) { + var ret string + return ret + } + return *o.HttpApiUri +} + +// GetHttpApiUriOk returns a tuple with the HttpApiUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHttpApiUriOk() (*string, bool) { + if o == nil || IsNil(o.HttpApiUri) { + return nil, false + } + return o.HttpApiUri, true +} + +// HasHttpApiUri returns a boolean if a field has been set. +func (o *Credentials) HasHttpApiUri() bool { + if o != nil && !IsNil(o.HttpApiUri) { + return true + } + + return false +} + +// SetHttpApiUri gets a reference to the given string and assigns it to the HttpApiUri field. +func (o *Credentials) SetHttpApiUri(v string) { + o.HttpApiUri = &v +} + +// GetHttpApiUris returns the HttpApiUris field value if set, zero value otherwise. +func (o *Credentials) GetHttpApiUris() []string { + if o == nil || IsNil(o.HttpApiUris) { + var ret []string + return ret + } + return o.HttpApiUris +} + +// GetHttpApiUrisOk returns a tuple with the HttpApiUris field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHttpApiUrisOk() ([]string, bool) { + if o == nil || IsNil(o.HttpApiUris) { + return nil, false + } + return o.HttpApiUris, true +} + +// HasHttpApiUris returns a boolean if a field has been set. +func (o *Credentials) HasHttpApiUris() bool { + if o != nil && !IsNil(o.HttpApiUris) { + return true + } + + return false +} + +// SetHttpApiUris gets a reference to the given []string and assigns it to the HttpApiUris field. +func (o *Credentials) SetHttpApiUris(v []string) { + o.HttpApiUris = v +} + +// GetManagement returns the Management field value if set, zero value otherwise. +func (o *Credentials) GetManagement() string { + if o == nil || IsNil(o.Management) { + var ret string + return ret + } + return *o.Management +} + +// GetManagementOk returns a tuple with the Management field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetManagementOk() (*string, bool) { + if o == nil || IsNil(o.Management) { + return nil, false + } + return o.Management, true +} + +// HasManagement returns a boolean if a field has been set. +func (o *Credentials) HasManagement() bool { + if o != nil && !IsNil(o.Management) { + return true + } + + return false +} + +// SetManagement gets a reference to the given string and assigns it to the Management field. +func (o *Credentials) SetManagement(v string) { + o.Management = &v +} + +// GetMqtt returns the Mqtt field value if set, zero value otherwise. +func (o *Credentials) GetMqtt() string { + if o == nil || IsNil(o.Mqtt) { + var ret string + return ret + } + return *o.Mqtt +} + +// GetMqttOk returns a tuple with the Mqtt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetMqttOk() (*string, bool) { + if o == nil || IsNil(o.Mqtt) { + return nil, false + } + return o.Mqtt, true +} + +// HasMqtt returns a boolean if a field has been set. +func (o *Credentials) HasMqtt() bool { + if o != nil && !IsNil(o.Mqtt) { + return true + } + + return false +} + +// SetMqtt gets a reference to the given string and assigns it to the Mqtt field. +func (o *Credentials) SetMqtt(v string) { + o.Mqtt = &v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetStomp returns the Stomp field value if set, zero value otherwise. +func (o *Credentials) GetStomp() string { + if o == nil || IsNil(o.Stomp) { + var ret string + return ret + } + return *o.Stomp +} + +// GetStompOk returns a tuple with the Stomp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetStompOk() (*string, bool) { + if o == nil || IsNil(o.Stomp) { + return nil, false + } + return o.Stomp, true +} + +// HasStomp returns a boolean if a field has been set. +func (o *Credentials) HasStomp() bool { + if o != nil && !IsNil(o.Stomp) { + return true + } + + return false +} + +// SetStomp gets a reference to the given string and assigns it to the Stomp field. +func (o *Credentials) SetStomp(v string) { + o.Stomp = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUris returns the Uris field value if set, zero value otherwise. +func (o *Credentials) GetUris() []string { + if o == nil || IsNil(o.Uris) { + var ret []string + return ret + } + return o.Uris +} + +// GetUrisOk returns a tuple with the Uris field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUrisOk() ([]string, bool) { + if o == nil || IsNil(o.Uris) { + return nil, false + } + return o.Uris, true +} + +// HasUris returns a boolean if a field has been set. +func (o *Credentials) HasUris() bool { + if o != nil && !IsNil(o.Uris) { + return true + } + + return false +} + +// SetUris gets a reference to the given []string and assigns it to the Uris field. +func (o *Credentials) SetUris(v []string) { + o.Uris = v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + if !IsNil(o.HttpApiUri) { + toSerialize["http_api_uri"] = o.HttpApiUri + } + if !IsNil(o.HttpApiUris) { + toSerialize["http_api_uris"] = o.HttpApiUris + } + if !IsNil(o.Management) { + toSerialize["management"] = o.Management + } + if !IsNil(o.Mqtt) { + toSerialize["mqtt"] = o.Mqtt + } + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Stomp) { + toSerialize["stomp"] = o.Stomp + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + if !IsNil(o.Uris) { + toSerialize["uris"] = o.Uris + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "hosts") + delete(additionalProperties, "http_api_uri") + delete(additionalProperties, "http_api_uris") + delete(additionalProperties, "management") + delete(additionalProperties, "mqtt") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "stomp") + delete(additionalProperties, "uri") + delete(additionalProperties, "uris") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_credentials_list_item.go b/services/rabbitmq/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..4afeba241 --- /dev/null +++ b/services/rabbitmq/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_credentials_parameters.go b/services/rabbitmq/v2api/model_credentials_parameters.go new file mode 100644 index 000000000..8f3586415 --- /dev/null +++ b/services/rabbitmq/v2api/model_credentials_parameters.go @@ -0,0 +1,154 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CredentialsParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsParameters{} + +// CredentialsParameters struct for CredentialsParameters +type CredentialsParameters struct { + // A list of roles to assign to the generated credentials. If not provided, standard default role 'policymaker' will be assigned. + Roles []CredentialsParametersRolesInner `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsParameters CredentialsParameters + +// NewCredentialsParameters instantiates a new CredentialsParameters 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 NewCredentialsParameters() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// NewCredentialsParametersWithDefaults instantiates a new CredentialsParameters 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 NewCredentialsParametersWithDefaults() *CredentialsParameters { + this := CredentialsParameters{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CredentialsParameters) GetRoles() []CredentialsParametersRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []CredentialsParametersRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsParameters) GetRolesOk() ([]CredentialsParametersRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CredentialsParameters) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []CredentialsParametersRolesInner and assigns it to the Roles field. +func (o *CredentialsParameters) SetRoles(v []CredentialsParametersRolesInner) { + o.Roles = v +} + +func (o CredentialsParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsParameters) UnmarshalJSON(data []byte) (err error) { + varCredentialsParameters := _CredentialsParameters{} + + err = json.Unmarshal(data, &varCredentialsParameters) + + if err != nil { + return err + } + + *o = CredentialsParameters(varCredentialsParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsParameters struct { + value *CredentialsParameters + isSet bool +} + +func (v NullableCredentialsParameters) Get() *CredentialsParameters { + return v.value +} + +func (v *NullableCredentialsParameters) Set(val *CredentialsParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsParameters(val *CredentialsParameters) *NullableCredentialsParameters { + return &NullableCredentialsParameters{value: val, isSet: true} +} + +func (v NullableCredentialsParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_credentials_parameters_roles_inner.go b/services/rabbitmq/v2api/model_credentials_parameters_roles_inner.go new file mode 100644 index 000000000..6c76cb613 --- /dev/null +++ b/services/rabbitmq/v2api/model_credentials_parameters_roles_inner.go @@ -0,0 +1,117 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CredentialsParametersRolesInner the model 'CredentialsParametersRolesInner' +type CredentialsParametersRolesInner string + +// List of CredentialsParameters_roles_inner +const ( + CREDENTIALSPARAMETERSROLESINNER_MANAGEMENT CredentialsParametersRolesInner = "management" + CREDENTIALSPARAMETERSROLESINNER_POLICYMAKER CredentialsParametersRolesInner = "policymaker" + CREDENTIALSPARAMETERSROLESINNER_MONITORING CredentialsParametersRolesInner = "monitoring" + CREDENTIALSPARAMETERSROLESINNER_ADMINISTRATOR CredentialsParametersRolesInner = "administrator" + CREDENTIALSPARAMETERSROLESINNER_UNKNOWN_DEFAULT_OPEN_API CredentialsParametersRolesInner = "unknown_default_open_api" +) + +// All allowed values of CredentialsParametersRolesInner enum +var AllowedCredentialsParametersRolesInnerEnumValues = []CredentialsParametersRolesInner{ + "management", + "policymaker", + "monitoring", + "administrator", + "unknown_default_open_api", +} + +func (v *CredentialsParametersRolesInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialsParametersRolesInner(value) + for _, existing := range AllowedCredentialsParametersRolesInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREDENTIALSPARAMETERSROLESINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCredentialsParametersRolesInnerFromValue returns a pointer to a valid CredentialsParametersRolesInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialsParametersRolesInnerFromValue(v string) (*CredentialsParametersRolesInner, error) { + ev := CredentialsParametersRolesInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialsParametersRolesInner: valid values are %v", v, AllowedCredentialsParametersRolesInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialsParametersRolesInner) IsValid() bool { + for _, existing := range AllowedCredentialsParametersRolesInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialsParameters_roles_inner value +func (v CredentialsParametersRolesInner) Ptr() *CredentialsParametersRolesInner { + return &v +} + +type NullableCredentialsParametersRolesInner struct { + value *CredentialsParametersRolesInner + isSet bool +} + +func (v NullableCredentialsParametersRolesInner) Get() *CredentialsParametersRolesInner { + return v.value +} + +func (v *NullableCredentialsParametersRolesInner) Set(val *CredentialsParametersRolesInner) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsParametersRolesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsParametersRolesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsParametersRolesInner(val *CredentialsParametersRolesInner) *NullableCredentialsParametersRolesInner { + return &NullableCredentialsParametersRolesInner{value: val, isSet: true} +} + +func (v NullableCredentialsParametersRolesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsParametersRolesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_credentials_response.go b/services/rabbitmq/v2api/model_credentials_response.go new file mode 100644 index 000000000..aa7a11e5b --- /dev/null +++ b/services/rabbitmq/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_error.go b/services/rabbitmq/v2api/model_error.go new file mode 100644 index 000000000..4f5f682a5 --- /dev/null +++ b/services/rabbitmq/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_get_metrics_response.go b/services/rabbitmq/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..e83689e3a --- /dev/null +++ b/services/rabbitmq/v2api/model_get_metrics_response.go @@ -0,0 +1,828 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance.go b/services/rabbitmq/v2api/model_instance.go new file mode 100644 index 000000000..4887fdb71 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *InstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) GetStatus() InstanceStatus { + if o == nil || IsNil(o.Status) { + var ret InstanceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Instance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_last_operation.go b/services/rabbitmq/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..6308cca2c --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { + if o == nil { + var ret InstanceLastOperationState + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { + if o == nil { + var ret InstanceLastOperationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_last_operation_state.go b/services/rabbitmq/v2api/model_instance_last_operation_state.go new file mode 100644 index 000000000..e2ac2c373 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_last_operation_type.go b/services/rabbitmq/v2api/model_instance_last_operation_type.go new file mode 100644 index 000000000..34401f6a5 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_parameters.go b/services/rabbitmq/v2api/model_instance_parameters.go new file mode 100644 index 000000000..aaef29857 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_parameters.go @@ -0,0 +1,634 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + // The unit is milliseconds. + ConsumerTimeout *int32 `json:"consumer_timeout,omitempty"` + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + Plugins []InstanceParametersPluginsInner `json:"plugins,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + Roles []string `json:"roles,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var consumerTimeout int32 = 1800000 + this.ConsumerTimeout = &consumerTimeout + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var consumerTimeout int32 = 1800000 + this.ConsumerTimeout = &consumerTimeout + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// GetConsumerTimeout returns the ConsumerTimeout field value if set, zero value otherwise. +func (o *InstanceParameters) GetConsumerTimeout() int32 { + if o == nil || IsNil(o.ConsumerTimeout) { + var ret int32 + return ret + } + return *o.ConsumerTimeout +} + +// GetConsumerTimeoutOk returns a tuple with the ConsumerTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetConsumerTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.ConsumerTimeout) { + return nil, false + } + return o.ConsumerTimeout, true +} + +// HasConsumerTimeout returns a boolean if a field has been set. +func (o *InstanceParameters) HasConsumerTimeout() bool { + if o != nil && !IsNil(o.ConsumerTimeout) { + return true + } + + return false +} + +// SetConsumerTimeout gets a reference to the given int32 and assigns it to the ConsumerTimeout field. +func (o *InstanceParameters) SetConsumerTimeout(v int32) { + o.ConsumerTimeout = &v +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetPlugins returns the Plugins field value if set, zero value otherwise. +func (o *InstanceParameters) GetPlugins() []InstanceParametersPluginsInner { + if o == nil || IsNil(o.Plugins) { + var ret []InstanceParametersPluginsInner + return ret + } + return o.Plugins +} + +// GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetPluginsOk() ([]InstanceParametersPluginsInner, bool) { + if o == nil || IsNil(o.Plugins) { + return nil, false + } + return o.Plugins, true +} + +// HasPlugins returns a boolean if a field has been set. +func (o *InstanceParameters) HasPlugins() bool { + if o != nil && !IsNil(o.Plugins) { + return true + } + + return false +} + +// SetPlugins gets a reference to the given []InstanceParametersPluginsInner and assigns it to the Plugins field. +func (o *InstanceParameters) SetPlugins(v []InstanceParametersPluginsInner) { + o.Plugins = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *InstanceParameters) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +// Deprecated +func (o *InstanceParameters) SetRoles(v []string) { + o.Roles = v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +// GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsCiphers() []string { + if o == nil || IsNil(o.TlsCiphers) { + var ret []string + return ret + } + return o.TlsCiphers +} + +// GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { + if o == nil || IsNil(o.TlsCiphers) { + return nil, false + } + return o.TlsCiphers, true +} + +// HasTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsCiphers() bool { + if o != nil && !IsNil(o.TlsCiphers) { + return true + } + + return false +} + +// SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetTlsCiphers(v []string) { + o.TlsCiphers = v +} + +// GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { + if o == nil || IsNil(o.TlsProtocols) { + var ret []InstanceParametersTlsProtocolsInner + return ret + } + return o.TlsProtocols +} + +// GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { + if o == nil || IsNil(o.TlsProtocols) { + return nil, false + } + return o.TlsProtocols, true +} + +// HasTlsProtocols returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsProtocols() bool { + if o != nil && !IsNil(o.TlsProtocols) { + return true + } + + return false +} + +// SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +// Deprecated +func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { + o.TlsProtocols = v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConsumerTimeout) { + toSerialize["consumer_timeout"] = o.ConsumerTimeout + } + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.Plugins) { + toSerialize["plugins"] = o.Plugins + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + if !IsNil(o.TlsCiphers) { + toSerialize["tls-ciphers"] = o.TlsCiphers + } + if !IsNil(o.TlsProtocols) { + toSerialize["tls-protocols"] = o.TlsProtocols + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "consumer_timeout") + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "graphite") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "plugins") + delete(additionalProperties, "roles") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "syslog") + delete(additionalProperties, "tls-ciphers") + delete(additionalProperties, "tls-protocols") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_parameters_plugins_inner.go b/services/rabbitmq/v2api/model_instance_parameters_plugins_inner.go new file mode 100644 index 000000000..05b7f797c --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_parameters_plugins_inner.go @@ -0,0 +1,129 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersPluginsInner the model 'InstanceParametersPluginsInner' +type InstanceParametersPluginsInner string + +// List of InstanceParameters_plugins_inner +const ( + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_CONSISTENT_HASH_EXCHANGE InstanceParametersPluginsInner = "rabbitmq_consistent_hash_exchange" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_FEDERATION InstanceParametersPluginsInner = "rabbitmq_federation" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_FEDERATION_MANAGEMENT InstanceParametersPluginsInner = "rabbitmq_federation_management" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_MQTT InstanceParametersPluginsInner = "rabbitmq_mqtt" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHARDING InstanceParametersPluginsInner = "rabbitmq_sharding" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHOVEL InstanceParametersPluginsInner = "rabbitmq_shovel" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHOVEL_MANAGEMENT InstanceParametersPluginsInner = "rabbitmq_shovel_management" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_STOMP InstanceParametersPluginsInner = "rabbitmq_stomp" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_TRACING InstanceParametersPluginsInner = "rabbitmq_tracing" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_EVENT_EXCHANGE InstanceParametersPluginsInner = "rabbitmq_event_exchange" + INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersPluginsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersPluginsInner enum +var AllowedInstanceParametersPluginsInnerEnumValues = []InstanceParametersPluginsInner{ + "rabbitmq_consistent_hash_exchange", + "rabbitmq_federation", + "rabbitmq_federation_management", + "rabbitmq_mqtt", + "rabbitmq_sharding", + "rabbitmq_shovel", + "rabbitmq_shovel_management", + "rabbitmq_stomp", + "rabbitmq_tracing", + "rabbitmq_event_exchange", + "unknown_default_open_api", +} + +func (v *InstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersPluginsInner(value) + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersPluginsInnerFromValue returns a pointer to a valid InstanceParametersPluginsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersPluginsInnerFromValue(v string) (*InstanceParametersPluginsInner, error) { + ev := InstanceParametersPluginsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersPluginsInner: valid values are %v", v, AllowedInstanceParametersPluginsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersPluginsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_plugins_inner value +func (v InstanceParametersPluginsInner) Ptr() *InstanceParametersPluginsInner { + return &v +} + +type NullableInstanceParametersPluginsInner struct { + value *InstanceParametersPluginsInner + isSet bool +} + +func (v NullableInstanceParametersPluginsInner) Get() *InstanceParametersPluginsInner { + return v.value +} + +func (v *NullableInstanceParametersPluginsInner) Set(val *InstanceParametersPluginsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersPluginsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersPluginsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersPluginsInner(val *InstanceParametersPluginsInner) *NullableInstanceParametersPluginsInner { + return &NullableInstanceParametersPluginsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersPluginsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_parameters_tls_protocols_inner.go b/services/rabbitmq/v2api/model_instance_parameters_tls_protocols_inner.go new file mode 100644 index 000000000..3ec560ee7 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_parameters_tls_protocols_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocolsInner the model 'InstanceParametersTlsProtocolsInner' +type InstanceParametersTlsProtocolsInner string + +// List of InstanceParameters_tls_protocols_inner +const ( + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_2 InstanceParametersTlsProtocolsInner = "tlsv1.2" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_3 InstanceParametersTlsProtocolsInner = "tlsv1.3" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocolsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocolsInner enum +var AllowedInstanceParametersTlsProtocolsInnerEnumValues = []InstanceParametersTlsProtocolsInner{ + "tlsv1.2", + "tlsv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocolsInner(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersTlsProtocolsInnerFromValue returns a pointer to a valid InstanceParametersTlsProtocolsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersTlsProtocolsInnerFromValue(v string) (*InstanceParametersTlsProtocolsInner, error) { + ev := InstanceParametersTlsProtocolsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocolsInner: valid values are %v", v, AllowedInstanceParametersTlsProtocolsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersTlsProtocolsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_tls_protocols_inner value +func (v InstanceParametersTlsProtocolsInner) Ptr() *InstanceParametersTlsProtocolsInner { + return &v +} + +type NullableInstanceParametersTlsProtocolsInner struct { + value *InstanceParametersTlsProtocolsInner + isSet bool +} + +func (v NullableInstanceParametersTlsProtocolsInner) Get() *InstanceParametersTlsProtocolsInner { + return v.value +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Set(val *InstanceParametersTlsProtocolsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersTlsProtocolsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersTlsProtocolsInner(val *InstanceParametersTlsProtocolsInner) *NullableInstanceParametersTlsProtocolsInner { + return &NullableInstanceParametersTlsProtocolsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersTlsProtocolsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_schema.go b/services/rabbitmq/v2api/model_instance_schema.go new file mode 100644 index 000000000..98c974935 --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_instance_status.go b/services/rabbitmq/v2api/model_instance_status.go new file mode 100644 index 000000000..7ba795c0b --- /dev/null +++ b/services/rabbitmq/v2api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_list_backups_response.go b/services/rabbitmq/v2api/model_list_backups_response.go new file mode 100644 index 000000000..882bf6a9f --- /dev/null +++ b/services/rabbitmq/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_list_credentials_response.go b/services/rabbitmq/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..bf73afc33 --- /dev/null +++ b/services/rabbitmq/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_list_instances_response.go b/services/rabbitmq/v2api/model_list_instances_response.go new file mode 100644 index 000000000..17322cfe5 --- /dev/null +++ b/services/rabbitmq/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_list_offerings_response.go b/services/rabbitmq/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..dc5e76644 --- /dev/null +++ b/services/rabbitmq/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_list_restores_response.go b/services/rabbitmq/v2api/model_list_restores_response.go new file mode 100644 index 000000000..ff00b6e36 --- /dev/null +++ b/services/rabbitmq/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_offering.go b/services/rabbitmq/v2api/model_offering.go new file mode 100644 index 000000000..ebc2f740f --- /dev/null +++ b/services/rabbitmq/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_partial_update_instance_payload.go b/services/rabbitmq/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..4f9e35660 --- /dev/null +++ b/services/rabbitmq/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_plan.go b/services/rabbitmq/v2api/model_plan.go new file mode 100644 index 000000000..64e4ae233 --- /dev/null +++ b/services/rabbitmq/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_raw_credentials.go b/services/rabbitmq/v2api/model_raw_credentials.go new file mode 100644 index 000000000..7dad94491 --- /dev/null +++ b/services/rabbitmq/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_restore.go b/services/rabbitmq/v2api/model_restore.go new file mode 100644 index 000000000..8e3642aca --- /dev/null +++ b/services/rabbitmq/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_schema.go b/services/rabbitmq/v2api/model_schema.go new file mode 100644 index 000000000..12e7f032b --- /dev/null +++ b/services/rabbitmq/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_trigger_restore_response.go b/services/rabbitmq/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..7d7ab360b --- /dev/null +++ b/services/rabbitmq/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_update_backups_config_payload.go b/services/rabbitmq/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..f07dde0c4 --- /dev/null +++ b/services/rabbitmq/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/model_update_backups_config_response.go b/services/rabbitmq/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..9ac87d3a0 --- /dev/null +++ b/services/rabbitmq/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v2api/response.go b/services/rabbitmq/v2api/response.go new file mode 100644 index 000000000..78a07fc2c --- /dev/null +++ b/services/rabbitmq/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/rabbitmq/v2api/utils.go b/services/rabbitmq/v2api/utils.go new file mode 100644 index 000000000..2f72dd263 --- /dev/null +++ b/services/rabbitmq/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/redis/CHANGELOG.md b/services/redis/CHANGELOG.md index 487631353..f3e0297cd 100644 --- a/services/redis/CHANGELOG.md +++ b/services/redis/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v2api`: + - New package which can be used for communication with the redis v2 API + - The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- `v1api`: + - **Feature:** Added optional `CreateCredentialsPayload` to `ApiCreateCredentialsRequest`. + - **Deprecation:** `TlsCiphers`, `TlsCiphersuites`, `TlsProtocols` from `InstanceParameters` model are deprecated and will be removed 2026-12-10. + ## v0.30.0 - `v1api`: **Improvement**: Use new `WaiterHandler` struct in the Redis WaitHandler diff --git a/services/redis/VERSION b/services/redis/VERSION index 29e939cda..60453e690 100644 --- a/services/redis/VERSION +++ b/services/redis/VERSION @@ -1 +1 @@ -v0.30.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/redis/api_default.go b/services/redis/api_default.go index 0e24f9207..42924d47d 100644 --- a/services/redis/api_default.go +++ b/services/redis/api_default.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/redis/client.go b/services/redis/client.go index 17c0905a9..65ea35aec 100644 --- a/services/redis/client.go +++ b/services/redis/client.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Redis API API v1.1.0 +// APIClient manages communication with the STACKIT Redis API API v2.1.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/redis/configuration.go b/services/redis/configuration.go index 3807f6f4e..801cb0481 100644 --- a/services/redis/configuration.go +++ b/services/redis/configuration.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://redis.api.{region}stackit.cloud", + URL: "https://redis.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/redis/model_backup.go b/services/redis/model_backup.go index 2bcb944a1..9727dde73 100644 --- a/services/redis/model_backup.go +++ b/services/redis/model_backup.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/redis/model_backup_test.go b/services/redis/model_backup_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_backup_test.go +++ b/services/redis/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_create_backup_response_item.go b/services/redis/model_create_backup_response_item.go index e064cc228..5c677ee8b 100644 --- a/services/redis/model_create_backup_response_item.go +++ b/services/redis/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/redis/model_create_backup_response_item_test.go b/services/redis/model_create_backup_response_item_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_create_backup_response_item_test.go +++ b/services/redis/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_create_credentials_payload.go b/services/redis/model_create_credentials_payload.go new file mode 100644 index 000000000..eb4c94255 --- /dev/null +++ b/services/redis/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package redis + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/model_create_credentials_payload_test.go b/services/redis/model_create_credentials_payload_test.go new file mode 100644 index 000000000..f560af6fb --- /dev/null +++ b/services/redis/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package redis diff --git a/services/redis/model_create_instance_payload.go b/services/redis/model_create_instance_payload.go index 43a75e10e..59bbd8355 100644 --- a/services/redis/model_create_instance_payload.go +++ b/services/redis/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_create_instance_payload_test.go b/services/redis/model_create_instance_payload_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_create_instance_payload_test.go +++ b/services/redis/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_create_instance_response.go b/services/redis/model_create_instance_response.go index 4e9e502b4..2555df7b9 100644 --- a/services/redis/model_create_instance_response.go +++ b/services/redis/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_create_instance_response_test.go b/services/redis/model_create_instance_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_create_instance_response_test.go +++ b/services/redis/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials.go b/services/redis/model_credentials.go index 387745a8e..88b652a8c 100644 --- a/services/redis/model_credentials.go +++ b/services/redis/model_credentials.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials_list_item.go b/services/redis/model_credentials_list_item.go index ea80046d4..ee9d6528c 100644 --- a/services/redis/model_credentials_list_item.go +++ b/services/redis/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials_list_item_test.go b/services/redis/model_credentials_list_item_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_credentials_list_item_test.go +++ b/services/redis/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials_response.go b/services/redis/model_credentials_response.go index 74707d92a..a35808984 100644 --- a/services/redis/model_credentials_response.go +++ b/services/redis/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials_response_test.go b/services/redis/model_credentials_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_credentials_response_test.go +++ b/services/redis/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_credentials_test.go b/services/redis/model_credentials_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_credentials_test.go +++ b/services/redis/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_error.go b/services/redis/model_error.go index 8c286541a..7e6756731 100644 --- a/services/redis/model_error.go +++ b/services/redis/model_error.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_error_test.go b/services/redis/model_error_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_error_test.go +++ b/services/redis/model_error_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_get_metrics_response.go b/services/redis/model_get_metrics_response.go index 26c9813a8..5cb9fa7f9 100644 --- a/services/redis/model_get_metrics_response.go +++ b/services/redis/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_get_metrics_response_test.go b/services/redis/model_get_metrics_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_get_metrics_response_test.go +++ b/services/redis/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance.go b/services/redis/model_instance.go index 3e411936b..0c4158400 100644 --- a/services/redis/model_instance.go +++ b/services/redis/model_instance.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_last_operation.go b/services/redis/model_instance_last_operation.go index 4b35e66f3..35e446c2a 100644 --- a/services/redis/model_instance_last_operation.go +++ b/services/redis/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_last_operation_test.go b/services/redis/model_instance_last_operation_test.go index 66d507451..e5ca08dd2 100644 --- a/services/redis/model_instance_last_operation_test.go +++ b/services/redis/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_parameters.go b/services/redis/model_instance_parameters.go index a436b0ce7..5586368bb 100644 --- a/services/redis/model_instance_parameters.go +++ b/services/redis/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -964,7 +964,7 @@ type InstanceParametersGetTlsCiphersuitesRetType = string // isEnum -// InstanceParametersTlsProtocols the model 'InstanceParameters' +// InstanceParametersTlsProtocols This property is deprecated and will be removed in a future release. // value type for enums // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceParametersTlsProtocols string @@ -1143,11 +1143,14 @@ type InstanceParameters struct { // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` // This setting must follow the original Redis configuration for RDB. - Snapshot InstanceParametersGetSnapshotAttributeType `json:"snapshot,omitempty"` - Syslog InstanceParametersGetSyslogAttributeType `json:"syslog,omitempty"` - TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + Snapshot InstanceParametersGetSnapshotAttributeType `json:"snapshot,omitempty"` + Syslog InstanceParametersGetSyslogAttributeType `json:"syslog,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + TlsCiphers InstanceParametersGetTlsCiphersAttributeType `json:"tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. TlsCiphersuites InstanceParametersGetTlsCiphersuitesAttributeType `json:"tls-ciphersuites,omitempty"` - TlsProtocols InstanceParametersGetTlsProtocolsAttributeType `json:"tls-protocols,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + TlsProtocols InstanceParametersGetTlsProtocolsAttributeType `json:"tls-protocols,omitempty"` } // NewInstanceParameters instantiates a new InstanceParameters object diff --git a/services/redis/model_instance_parameters_test.go b/services/redis/model_instance_parameters_test.go index a336a74d4..df7167402 100644 --- a/services/redis/model_instance_parameters_test.go +++ b/services/redis/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_schema.go b/services/redis/model_instance_schema.go index 4c1c2f1bd..46a5fc0d0 100644 --- a/services/redis/model_instance_schema.go +++ b/services/redis/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_schema_test.go b/services/redis/model_instance_schema_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_instance_schema_test.go +++ b/services/redis/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_instance_test.go b/services/redis/model_instance_test.go index cd36fc731..b1be7db9e 100644 --- a/services/redis/model_instance_test.go +++ b/services/redis/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_backups_response.go b/services/redis/model_list_backups_response.go index 236efb49f..7132be62c 100644 --- a/services/redis/model_list_backups_response.go +++ b/services/redis/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_backups_response_test.go b/services/redis/model_list_backups_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_list_backups_response_test.go +++ b/services/redis/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_credentials_response.go b/services/redis/model_list_credentials_response.go index c4cf02869..83400568d 100644 --- a/services/redis/model_list_credentials_response.go +++ b/services/redis/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_credentials_response_test.go b/services/redis/model_list_credentials_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_list_credentials_response_test.go +++ b/services/redis/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_instances_response.go b/services/redis/model_list_instances_response.go index 956ce807c..84fe88ab6 100644 --- a/services/redis/model_list_instances_response.go +++ b/services/redis/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_instances_response_test.go b/services/redis/model_list_instances_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_list_instances_response_test.go +++ b/services/redis/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_offerings_response.go b/services/redis/model_list_offerings_response.go index 9ed3d3813..aecbbfa12 100644 --- a/services/redis/model_list_offerings_response.go +++ b/services/redis/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_offerings_response_test.go b/services/redis/model_list_offerings_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_list_offerings_response_test.go +++ b/services/redis/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_restores_response.go b/services/redis/model_list_restores_response.go index ba1971da8..7ecc2fd78 100644 --- a/services/redis/model_list_restores_response.go +++ b/services/redis/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_list_restores_response_test.go b/services/redis/model_list_restores_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_list_restores_response_test.go +++ b/services/redis/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_offering.go b/services/redis/model_offering.go index 6e0a26bf2..1cbebeb43 100644 --- a/services/redis/model_offering.go +++ b/services/redis/model_offering.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/redis/model_offering_test.go b/services/redis/model_offering_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_offering_test.go +++ b/services/redis/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_partial_update_instance_payload.go b/services/redis/model_partial_update_instance_payload.go index 3fda94095..4eaceed92 100644 --- a/services/redis/model_partial_update_instance_payload.go +++ b/services/redis/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_partial_update_instance_payload_test.go b/services/redis/model_partial_update_instance_payload_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_partial_update_instance_payload_test.go +++ b/services/redis/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_plan.go b/services/redis/model_plan.go index 46dfe416c..e24a77c78 100644 --- a/services/redis/model_plan.go +++ b/services/redis/model_plan.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_plan_test.go b/services/redis/model_plan_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_plan_test.go +++ b/services/redis/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_raw_credentials.go b/services/redis/model_raw_credentials.go index 978222e55..1573aa2a7 100644 --- a/services/redis/model_raw_credentials.go +++ b/services/redis/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_raw_credentials_test.go b/services/redis/model_raw_credentials_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_raw_credentials_test.go +++ b/services/redis/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_restore.go b/services/redis/model_restore.go index 8dccaa185..3f8c48004 100644 --- a/services/redis/model_restore.go +++ b/services/redis/model_restore.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/redis/model_restore_test.go b/services/redis/model_restore_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_restore_test.go +++ b/services/redis/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_schema.go b/services/redis/model_schema.go index 3a3b9d09d..813d30b7e 100644 --- a/services/redis/model_schema.go +++ b/services/redis/model_schema.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_schema_test.go b/services/redis/model_schema_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_schema_test.go +++ b/services/redis/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_trigger_restore_response.go b/services/redis/model_trigger_restore_response.go index 400d96b1d..960d5837c 100644 --- a/services/redis/model_trigger_restore_response.go +++ b/services/redis/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/redis/model_trigger_restore_response_test.go b/services/redis/model_trigger_restore_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_trigger_restore_response_test.go +++ b/services/redis/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_update_backups_config_payload.go b/services/redis/model_update_backups_config_payload.go index bb581beb9..5e55e5836 100644 --- a/services/redis/model_update_backups_config_payload.go +++ b/services/redis/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_update_backups_config_payload_test.go b/services/redis/model_update_backups_config_payload_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_update_backups_config_payload_test.go +++ b/services/redis/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_update_backups_config_response.go b/services/redis/model_update_backups_config_response.go index d954dfc27..a8d8c73ca 100644 --- a/services/redis/model_update_backups_config_response.go +++ b/services/redis/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/model_update_backups_config_response_test.go b/services/redis/model_update_backups_config_response_test.go index 1fc82495e..f560af6fb 100644 --- a/services/redis/model_update_backups_config_response_test.go +++ b/services/redis/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/oas_commit b/services/redis/oas_commit index c08a6770d..78b94c5e2 100644 --- a/services/redis/oas_commit +++ b/services/redis/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +2f86390a8636a9c44010faf5e2f7f6321b17442f diff --git a/services/redis/utils.go b/services/redis/utils.go index 59f012786..82e6b66c3 100644 --- a/services/redis/utils.go +++ b/services/redis/utils.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/api_default.go b/services/redis/v1api/api_default.go index 052672feb..8d7e731c8 100644 --- a/services/redis/v1api/api_default.go +++ b/services/redis/v1api/api_default.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/redis/v1api/api_default_mock.go b/services/redis/v1api/api_default_mock.go index 5a907e429..ba4cb3b0b 100644 --- a/services/redis/v1api/api_default_mock.go +++ b/services/redis/v1api/api_default_mock.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/client.go b/services/redis/v1api/client.go index 89c3e54cf..142273f2a 100644 --- a/services/redis/v1api/client.go +++ b/services/redis/v1api/client.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Redis API API v1.1.0 +// APIClient manages communication with the STACKIT Redis API API v1.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/redis/v1api/configuration.go b/services/redis/v1api/configuration.go index 99525d388..24d7d12ac 100644 --- a/services/redis/v1api/configuration.go +++ b/services/redis/v1api/configuration.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_backup.go b/services/redis/v1api/model_backup.go index 23df4e835..7fa781996 100644 --- a/services/redis/v1api/model_backup.go +++ b/services/redis/v1api/model_backup.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_create_backup_response_item.go b/services/redis/v1api/model_create_backup_response_item.go index 602ea2ebb..655188fbd 100644 --- a/services/redis/v1api/model_create_backup_response_item.go +++ b/services/redis/v1api/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_create_credentials_payload.go b/services/redis/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..d3b77e7af --- /dev/null +++ b/services/redis/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_create_instance_payload.go b/services/redis/v1api/model_create_instance_payload.go index 60259ced3..1f4a01082 100644 --- a/services/redis/v1api/model_create_instance_payload.go +++ b/services/redis/v1api/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_create_instance_response.go b/services/redis/v1api/model_create_instance_response.go index 90067dd9c..5071a6fec 100644 --- a/services/redis/v1api/model_create_instance_response.go +++ b/services/redis/v1api/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_credentials.go b/services/redis/v1api/model_credentials.go index 33270156f..0ef42dd22 100644 --- a/services/redis/v1api/model_credentials.go +++ b/services/redis/v1api/model_credentials.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_credentials_list_item.go b/services/redis/v1api/model_credentials_list_item.go index d4b4f8614..c729fefb8 100644 --- a/services/redis/v1api/model_credentials_list_item.go +++ b/services/redis/v1api/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_credentials_response.go b/services/redis/v1api/model_credentials_response.go index 52006117b..afcc5d331 100644 --- a/services/redis/v1api/model_credentials_response.go +++ b/services/redis/v1api/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_error.go b/services/redis/v1api/model_error.go index 5d3c53edf..51d6dd381 100644 --- a/services/redis/v1api/model_error.go +++ b/services/redis/v1api/model_error.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_get_metrics_response.go b/services/redis/v1api/model_get_metrics_response.go index ac7164438..684d9fc2b 100644 --- a/services/redis/v1api/model_get_metrics_response.go +++ b/services/redis/v1api/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance.go b/services/redis/v1api/model_instance.go index ab5970791..975f4f481 100644 --- a/services/redis/v1api/model_instance.go +++ b/services/redis/v1api/model_instance.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_last_operation.go b/services/redis/v1api/model_instance_last_operation.go index 7c83e8c6b..0785c10dd 100644 --- a/services/redis/v1api/model_instance_last_operation.go +++ b/services/redis/v1api/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_last_operation_state.go b/services/redis/v1api/model_instance_last_operation_state.go index db8383a8f..938863416 100644 --- a/services/redis/v1api/model_instance_last_operation_state.go +++ b/services/redis/v1api/model_instance_last_operation_state.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_last_operation_type.go b/services/redis/v1api/model_instance_last_operation_type.go index 161492422..2069524cb 100644 --- a/services/redis/v1api/model_instance_last_operation_type.go +++ b/services/redis/v1api/model_instance_last_operation_type.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_parameters.go b/services/redis/v1api/model_instance_parameters.go index 01423d4e4..62b61b454 100644 --- a/services/redis/v1api/model_instance_parameters.go +++ b/services/redis/v1api/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -46,10 +46,15 @@ type InstanceParameters struct { // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` // This setting must follow the original Redis configuration for RDB. - Snapshot *string `json:"snapshot,omitempty"` - Syslog []string `json:"syslog,omitempty"` - TlsCiphers []string `json:"tls-ciphers,omitempty"` - TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + Syslog []string `json:"syslog,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` + // Deprecated TlsProtocols *InstanceParametersTlsProtocols `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -734,6 +739,7 @@ func (o *InstanceParameters) SetSyslog(v []string) { } // GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsCiphers() []string { if o == nil || IsNil(o.TlsCiphers) { var ret []string @@ -744,6 +750,7 @@ func (o *InstanceParameters) GetTlsCiphers() []string { // GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { if o == nil || IsNil(o.TlsCiphers) { return nil, false @@ -761,11 +768,13 @@ func (o *InstanceParameters) HasTlsCiphers() bool { } // SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated func (o *InstanceParameters) SetTlsCiphers(v []string) { o.TlsCiphers = v } // GetTlsCiphersuites returns the TlsCiphersuites field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsCiphersuites() string { if o == nil || IsNil(o.TlsCiphersuites) { var ret string @@ -776,6 +785,7 @@ func (o *InstanceParameters) GetTlsCiphersuites() string { // GetTlsCiphersuitesOk returns a tuple with the TlsCiphersuites field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsCiphersuitesOk() (*string, bool) { if o == nil || IsNil(o.TlsCiphersuites) { return nil, false @@ -793,11 +803,13 @@ func (o *InstanceParameters) HasTlsCiphersuites() bool { } // SetTlsCiphersuites gets a reference to the given string and assigns it to the TlsCiphersuites field. +// Deprecated func (o *InstanceParameters) SetTlsCiphersuites(v string) { o.TlsCiphersuites = &v } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetTlsProtocols() InstanceParametersTlsProtocols { if o == nil || IsNil(o.TlsProtocols) { var ret InstanceParametersTlsProtocols @@ -808,6 +820,7 @@ func (o *InstanceParameters) GetTlsProtocols() InstanceParametersTlsProtocols { // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetTlsProtocolsOk() (*InstanceParametersTlsProtocols, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false @@ -825,6 +838,7 @@ func (o *InstanceParameters) HasTlsProtocols() bool { } // SetTlsProtocols gets a reference to the given InstanceParametersTlsProtocols and assigns it to the TlsProtocols field. +// Deprecated func (o *InstanceParameters) SetTlsProtocols(v InstanceParametersTlsProtocols) { o.TlsProtocols = &v } diff --git a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go index 5250eaf89..a2a017cf5 100644 --- a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go +++ b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go index c594cbe6b..4cbeaa286 100644 --- a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go +++ b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_parameters_maxmemory_policy.go b/services/redis/v1api/model_instance_parameters_maxmemory_policy.go index 21b107586..a3425e631 100644 --- a/services/redis/v1api/model_instance_parameters_maxmemory_policy.go +++ b/services/redis/v1api/model_instance_parameters_maxmemory_policy.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_parameters_tls_protocols.go b/services/redis/v1api/model_instance_parameters_tls_protocols.go index 2f099aeb8..8eb8cc2b3 100644 --- a/services/redis/v1api/model_instance_parameters_tls_protocols.go +++ b/services/redis/v1api/model_instance_parameters_tls_protocols.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,7 +15,7 @@ import ( "fmt" ) -// InstanceParametersTlsProtocols the model 'InstanceParametersTlsProtocols' +// InstanceParametersTlsProtocols This property is deprecated and will be removed in a future release. type InstanceParametersTlsProtocols string // List of InstanceParameters_tls_protocols diff --git a/services/redis/v1api/model_instance_schema.go b/services/redis/v1api/model_instance_schema.go index a451572ef..0b4232633 100644 --- a/services/redis/v1api/model_instance_schema.go +++ b/services/redis/v1api/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_instance_status.go b/services/redis/v1api/model_instance_status.go index b55d45fb6..a4dc2b524 100644 --- a/services/redis/v1api/model_instance_status.go +++ b/services/redis/v1api/model_instance_status.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_list_backups_response.go b/services/redis/v1api/model_list_backups_response.go index ab42c26be..4b381bf9e 100644 --- a/services/redis/v1api/model_list_backups_response.go +++ b/services/redis/v1api/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_list_credentials_response.go b/services/redis/v1api/model_list_credentials_response.go index 2f2d70672..e91569e16 100644 --- a/services/redis/v1api/model_list_credentials_response.go +++ b/services/redis/v1api/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_list_instances_response.go b/services/redis/v1api/model_list_instances_response.go index 89a7ed3d7..d079dc9c6 100644 --- a/services/redis/v1api/model_list_instances_response.go +++ b/services/redis/v1api/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_list_offerings_response.go b/services/redis/v1api/model_list_offerings_response.go index b375d0e3e..cbe5fc399 100644 --- a/services/redis/v1api/model_list_offerings_response.go +++ b/services/redis/v1api/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_list_restores_response.go b/services/redis/v1api/model_list_restores_response.go index b4b5eebb6..a7fbef477 100644 --- a/services/redis/v1api/model_list_restores_response.go +++ b/services/redis/v1api/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_offering.go b/services/redis/v1api/model_offering.go index 3cae0f676..836e4ca82 100644 --- a/services/redis/v1api/model_offering.go +++ b/services/redis/v1api/model_offering.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_partial_update_instance_payload.go b/services/redis/v1api/model_partial_update_instance_payload.go index 74db9d7ea..bbe1d1014 100644 --- a/services/redis/v1api/model_partial_update_instance_payload.go +++ b/services/redis/v1api/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_plan.go b/services/redis/v1api/model_plan.go index 057ede519..54107118a 100644 --- a/services/redis/v1api/model_plan.go +++ b/services/redis/v1api/model_plan.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_raw_credentials.go b/services/redis/v1api/model_raw_credentials.go index 3ed7cfbf5..1b4f62288 100644 --- a/services/redis/v1api/model_raw_credentials.go +++ b/services/redis/v1api/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_restore.go b/services/redis/v1api/model_restore.go index 7c58de587..c1876affa 100644 --- a/services/redis/v1api/model_restore.go +++ b/services/redis/v1api/model_restore.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_schema.go b/services/redis/v1api/model_schema.go index b61a80dd8..2e075c38d 100644 --- a/services/redis/v1api/model_schema.go +++ b/services/redis/v1api/model_schema.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_trigger_restore_response.go b/services/redis/v1api/model_trigger_restore_response.go index 0e3816e4a..21d915aff 100644 --- a/services/redis/v1api/model_trigger_restore_response.go +++ b/services/redis/v1api/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_update_backups_config_payload.go b/services/redis/v1api/model_update_backups_config_payload.go index 1d59c70b5..42da18590 100644 --- a/services/redis/v1api/model_update_backups_config_payload.go +++ b/services/redis/v1api/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/model_update_backups_config_response.go b/services/redis/v1api/model_update_backups_config_response.go index b3aaa485b..cf2e5bb2a 100644 --- a/services/redis/v1api/model_update_backups_config_response.go +++ b/services/redis/v1api/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/response.go b/services/redis/v1api/response.go index 7315eca66..71e712f05 100644 --- a/services/redis/v1api/response.go +++ b/services/redis/v1api/response.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v1api/utils.go b/services/redis/v1api/utils.go index bcef3d8c4..5a1eb83e7 100644 --- a/services/redis/v1api/utils.go +++ b/services/redis/v1api/utils.go @@ -3,7 +3,7 @@ STACKIT Redis API The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/redis/v2api/api_default.go b/services/redis/v2api/api_default.go new file mode 100644 index 000000000..d33c3ebbf --- /dev/null +++ b/services/redis/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 410 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupsConfigPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/redis/v2api/api_default_mock.go b/services/redis/v2api/api_default_mock.go new file mode 100644 index 000000000..16d9af842 --- /dev/null +++ b/services/redis/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/redis/v2api/client.go b/services/redis/v2api/client.go new file mode 100644 index 000000000..a7f5e2160 --- /dev/null +++ b/services/redis/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Redis API API v2.1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/redis/v2api/configuration.go b/services/redis/v2api/configuration.go new file mode 100644 index 000000000..d1822d420 --- /dev/null +++ b/services/redis/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/redis", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://redis.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/redis/v2api/model_backup.go b/services/redis/v2api/model_backup.go new file mode 100644 index 000000000..3185bda42 --- /dev/null +++ b/services/redis/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_create_backup_response_item.go b/services/redis/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..e93a136a4 --- /dev/null +++ b/services/redis/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_create_credentials_payload.go b/services/redis/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..d43da50a1 --- /dev/null +++ b/services/redis/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_create_instance_payload.go b/services/redis/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..657371652 --- /dev/null +++ b/services/redis/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_create_instance_response.go b/services/redis/v2api/model_create_instance_response.go new file mode 100644 index 000000000..4626b7a36 --- /dev/null +++ b/services/redis/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_credentials.go b/services/redis/v2api/model_credentials.go new file mode 100644 index 000000000..df1afc999 --- /dev/null +++ b/services/redis/v2api/model_credentials.go @@ -0,0 +1,372 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Hosts []string `json:"hosts,omitempty"` + LoadBalancedHost *string `json:"load_balanced_host,omitempty"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + Uri *string `json:"uri,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetHosts returns the Hosts field value if set, zero value otherwise. +func (o *Credentials) GetHosts() []string { + if o == nil || IsNil(o.Hosts) { + var ret []string + return ret + } + return o.Hosts +} + +// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostsOk() ([]string, bool) { + if o == nil || IsNil(o.Hosts) { + return nil, false + } + return o.Hosts, true +} + +// HasHosts returns a boolean if a field has been set. +func (o *Credentials) HasHosts() bool { + if o != nil && !IsNil(o.Hosts) { + return true + } + + return false +} + +// SetHosts gets a reference to the given []string and assigns it to the Hosts field. +func (o *Credentials) SetHosts(v []string) { + o.Hosts = v +} + +// GetLoadBalancedHost returns the LoadBalancedHost field value if set, zero value otherwise. +func (o *Credentials) GetLoadBalancedHost() string { + if o == nil || IsNil(o.LoadBalancedHost) { + var ret string + return ret + } + return *o.LoadBalancedHost +} + +// GetLoadBalancedHostOk returns a tuple with the LoadBalancedHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetLoadBalancedHostOk() (*string, bool) { + if o == nil || IsNil(o.LoadBalancedHost) { + return nil, false + } + return o.LoadBalancedHost, true +} + +// HasLoadBalancedHost returns a boolean if a field has been set. +func (o *Credentials) HasLoadBalancedHost() bool { + if o != nil && !IsNil(o.LoadBalancedHost) { + return true + } + + return false +} + +// SetLoadBalancedHost gets a reference to the given string and assigns it to the LoadBalancedHost field. +func (o *Credentials) SetLoadBalancedHost(v string) { + o.LoadBalancedHost = &v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + if !IsNil(o.Hosts) { + toSerialize["hosts"] = o.Hosts + } + if !IsNil(o.LoadBalancedHost) { + toSerialize["load_balanced_host"] = o.LoadBalancedHost + } + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "hosts") + delete(additionalProperties, "load_balanced_host") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "uri") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_credentials_list_item.go b/services/redis/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..5f598e5ed --- /dev/null +++ b/services/redis/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_credentials_response.go b/services/redis/v2api/model_credentials_response.go new file mode 100644 index 000000000..2027903ab --- /dev/null +++ b/services/redis/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_error.go b/services/redis/v2api/model_error.go new file mode 100644 index 000000000..0510bb696 --- /dev/null +++ b/services/redis/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_get_metrics_response.go b/services/redis/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..a59c463b8 --- /dev/null +++ b/services/redis/v2api/model_get_metrics_response.go @@ -0,0 +1,828 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance.go b/services/redis/v2api/model_instance.go new file mode 100644 index 000000000..09a19f4bd --- /dev/null +++ b/services/redis/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *InstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) GetStatus() InstanceStatus { + if o == nil || IsNil(o.Status) { + var ret InstanceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Instance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_last_operation.go b/services/redis/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..c8e71c50e --- /dev/null +++ b/services/redis/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { + if o == nil { + var ret InstanceLastOperationState + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { + if o == nil { + var ret InstanceLastOperationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_last_operation_state.go b/services/redis/v2api/model_instance_last_operation_state.go new file mode 100644 index 000000000..f92a9c0e0 --- /dev/null +++ b/services/redis/v2api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_last_operation_type.go b/services/redis/v2api/model_instance_last_operation_type.go new file mode 100644 index 000000000..08ce41400 --- /dev/null +++ b/services/redis/v2api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_parameters.go b/services/redis/v2api/model_instance_parameters.go new file mode 100644 index 000000000..060ba6408 --- /dev/null +++ b/services/redis/v2api/model_instance_parameters.go @@ -0,0 +1,1006 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + // The unit is milliseconds. + DownAfterMilliseconds *int32 `json:"down-after-milliseconds,omitempty"` + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + // The unit is milliseconds. + FailoverTimeout *int32 `json:"failover-timeout,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + LazyfreeLazyEviction *InstanceParametersLazyfreeLazyEviction `json:"lazyfree-lazy-eviction,omitempty"` + LazyfreeLazyExpire *InstanceParametersLazyfreeLazyExpire `json:"lazyfree-lazy-expire,omitempty"` + LuaTimeLimit *int32 `json:"lua-time-limit,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + Maxclients *int32 `json:"maxclients,omitempty"` + MaxmemoryPolicy *InstanceParametersMaxmemoryPolicy `json:"maxmemory-policy,omitempty"` + MaxmemorySamples *int32 `json:"maxmemory-samples,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + // The unit is seconds. + MinReplicasMaxLag *int32 `json:"min_replicas_max_lag,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // The allowed value must include the following characters only: [K,E,g,$,l,s,h,z,x,e,A,t] + NotifyKeyspaceEvents *string `json:"notify-keyspace-events,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + // This setting must follow the original Redis configuration for RDB. + Snapshot *string `json:"snapshot,omitempty"` + Syslog []string `json:"syslog,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphers []string `json:"tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` + // Deprecated + TlsProtocols *InstanceParametersTlsProtocols `json:"tls-protocols,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var downAfterMilliseconds int32 = 10000 + this.DownAfterMilliseconds = &downAfterMilliseconds + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var failoverTimeout int32 = 30000 + this.FailoverTimeout = &failoverTimeout + var lazyfreeLazyEviction InstanceParametersLazyfreeLazyEviction = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO + this.LazyfreeLazyEviction = &lazyfreeLazyEviction + var lazyfreeLazyExpire InstanceParametersLazyfreeLazyExpire = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO + this.LazyfreeLazyExpire = &lazyfreeLazyExpire + var luaTimeLimit int32 = 5000 + this.LuaTimeLimit = &luaTimeLimit + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var maxclients int32 = 10000 + this.Maxclients = &maxclients + var maxmemoryPolicy InstanceParametersMaxmemoryPolicy = INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU + this.MaxmemoryPolicy = &maxmemoryPolicy + var maxmemorySamples int32 = 5 + this.MaxmemorySamples = &maxmemorySamples + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + var minReplicasMaxLag int32 = 10 + this.MinReplicasMaxLag = &minReplicasMaxLag + var notifyKeyspaceEvents string = "" + this.NotifyKeyspaceEvents = ¬ifyKeyspaceEvents + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var downAfterMilliseconds int32 = 10000 + this.DownAfterMilliseconds = &downAfterMilliseconds + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var failoverTimeout int32 = 30000 + this.FailoverTimeout = &failoverTimeout + var lazyfreeLazyEviction InstanceParametersLazyfreeLazyEviction = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO + this.LazyfreeLazyEviction = &lazyfreeLazyEviction + var lazyfreeLazyExpire InstanceParametersLazyfreeLazyExpire = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO + this.LazyfreeLazyExpire = &lazyfreeLazyExpire + var luaTimeLimit int32 = 5000 + this.LuaTimeLimit = &luaTimeLimit + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var maxclients int32 = 10000 + this.Maxclients = &maxclients + var maxmemoryPolicy InstanceParametersMaxmemoryPolicy = INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU + this.MaxmemoryPolicy = &maxmemoryPolicy + var maxmemorySamples int32 = 5 + this.MaxmemorySamples = &maxmemorySamples + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + var minReplicasMaxLag int32 = 10 + this.MinReplicasMaxLag = &minReplicasMaxLag + var notifyKeyspaceEvents string = "" + this.NotifyKeyspaceEvents = ¬ifyKeyspaceEvents + return &this +} + +// GetDownAfterMilliseconds returns the DownAfterMilliseconds field value if set, zero value otherwise. +func (o *InstanceParameters) GetDownAfterMilliseconds() int32 { + if o == nil || IsNil(o.DownAfterMilliseconds) { + var ret int32 + return ret + } + return *o.DownAfterMilliseconds +} + +// GetDownAfterMillisecondsOk returns a tuple with the DownAfterMilliseconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetDownAfterMillisecondsOk() (*int32, bool) { + if o == nil || IsNil(o.DownAfterMilliseconds) { + return nil, false + } + return o.DownAfterMilliseconds, true +} + +// HasDownAfterMilliseconds returns a boolean if a field has been set. +func (o *InstanceParameters) HasDownAfterMilliseconds() bool { + if o != nil && !IsNil(o.DownAfterMilliseconds) { + return true + } + + return false +} + +// SetDownAfterMilliseconds gets a reference to the given int32 and assigns it to the DownAfterMilliseconds field. +func (o *InstanceParameters) SetDownAfterMilliseconds(v int32) { + o.DownAfterMilliseconds = &v +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetFailoverTimeout returns the FailoverTimeout field value if set, zero value otherwise. +func (o *InstanceParameters) GetFailoverTimeout() int32 { + if o == nil || IsNil(o.FailoverTimeout) { + var ret int32 + return ret + } + return *o.FailoverTimeout +} + +// GetFailoverTimeoutOk returns a tuple with the FailoverTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetFailoverTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.FailoverTimeout) { + return nil, false + } + return o.FailoverTimeout, true +} + +// HasFailoverTimeout returns a boolean if a field has been set. +func (o *InstanceParameters) HasFailoverTimeout() bool { + if o != nil && !IsNil(o.FailoverTimeout) { + return true + } + + return false +} + +// SetFailoverTimeout gets a reference to the given int32 and assigns it to the FailoverTimeout field. +func (o *InstanceParameters) SetFailoverTimeout(v int32) { + o.FailoverTimeout = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetLazyfreeLazyEviction returns the LazyfreeLazyEviction field value if set, zero value otherwise. +func (o *InstanceParameters) GetLazyfreeLazyEviction() InstanceParametersLazyfreeLazyEviction { + if o == nil || IsNil(o.LazyfreeLazyEviction) { + var ret InstanceParametersLazyfreeLazyEviction + return ret + } + return *o.LazyfreeLazyEviction +} + +// GetLazyfreeLazyEvictionOk returns a tuple with the LazyfreeLazyEviction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetLazyfreeLazyEvictionOk() (*InstanceParametersLazyfreeLazyEviction, bool) { + if o == nil || IsNil(o.LazyfreeLazyEviction) { + return nil, false + } + return o.LazyfreeLazyEviction, true +} + +// HasLazyfreeLazyEviction returns a boolean if a field has been set. +func (o *InstanceParameters) HasLazyfreeLazyEviction() bool { + if o != nil && !IsNil(o.LazyfreeLazyEviction) { + return true + } + + return false +} + +// SetLazyfreeLazyEviction gets a reference to the given InstanceParametersLazyfreeLazyEviction and assigns it to the LazyfreeLazyEviction field. +func (o *InstanceParameters) SetLazyfreeLazyEviction(v InstanceParametersLazyfreeLazyEviction) { + o.LazyfreeLazyEviction = &v +} + +// GetLazyfreeLazyExpire returns the LazyfreeLazyExpire field value if set, zero value otherwise. +func (o *InstanceParameters) GetLazyfreeLazyExpire() InstanceParametersLazyfreeLazyExpire { + if o == nil || IsNil(o.LazyfreeLazyExpire) { + var ret InstanceParametersLazyfreeLazyExpire + return ret + } + return *o.LazyfreeLazyExpire +} + +// GetLazyfreeLazyExpireOk returns a tuple with the LazyfreeLazyExpire field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetLazyfreeLazyExpireOk() (*InstanceParametersLazyfreeLazyExpire, bool) { + if o == nil || IsNil(o.LazyfreeLazyExpire) { + return nil, false + } + return o.LazyfreeLazyExpire, true +} + +// HasLazyfreeLazyExpire returns a boolean if a field has been set. +func (o *InstanceParameters) HasLazyfreeLazyExpire() bool { + if o != nil && !IsNil(o.LazyfreeLazyExpire) { + return true + } + + return false +} + +// SetLazyfreeLazyExpire gets a reference to the given InstanceParametersLazyfreeLazyExpire and assigns it to the LazyfreeLazyExpire field. +func (o *InstanceParameters) SetLazyfreeLazyExpire(v InstanceParametersLazyfreeLazyExpire) { + o.LazyfreeLazyExpire = &v +} + +// GetLuaTimeLimit returns the LuaTimeLimit field value if set, zero value otherwise. +func (o *InstanceParameters) GetLuaTimeLimit() int32 { + if o == nil || IsNil(o.LuaTimeLimit) { + var ret int32 + return ret + } + return *o.LuaTimeLimit +} + +// GetLuaTimeLimitOk returns a tuple with the LuaTimeLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetLuaTimeLimitOk() (*int32, bool) { + if o == nil || IsNil(o.LuaTimeLimit) { + return nil, false + } + return o.LuaTimeLimit, true +} + +// HasLuaTimeLimit returns a boolean if a field has been set. +func (o *InstanceParameters) HasLuaTimeLimit() bool { + if o != nil && !IsNil(o.LuaTimeLimit) { + return true + } + + return false +} + +// SetLuaTimeLimit gets a reference to the given int32 and assigns it to the LuaTimeLimit field. +func (o *InstanceParameters) SetLuaTimeLimit(v int32) { + o.LuaTimeLimit = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMaxclients returns the Maxclients field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxclients() int32 { + if o == nil || IsNil(o.Maxclients) { + var ret int32 + return ret + } + return *o.Maxclients +} + +// GetMaxclientsOk returns a tuple with the Maxclients field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxclientsOk() (*int32, bool) { + if o == nil || IsNil(o.Maxclients) { + return nil, false + } + return o.Maxclients, true +} + +// HasMaxclients returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxclients() bool { + if o != nil && !IsNil(o.Maxclients) { + return true + } + + return false +} + +// SetMaxclients gets a reference to the given int32 and assigns it to the Maxclients field. +func (o *InstanceParameters) SetMaxclients(v int32) { + o.Maxclients = &v +} + +// GetMaxmemoryPolicy returns the MaxmemoryPolicy field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxmemoryPolicy() InstanceParametersMaxmemoryPolicy { + if o == nil || IsNil(o.MaxmemoryPolicy) { + var ret InstanceParametersMaxmemoryPolicy + return ret + } + return *o.MaxmemoryPolicy +} + +// GetMaxmemoryPolicyOk returns a tuple with the MaxmemoryPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxmemoryPolicyOk() (*InstanceParametersMaxmemoryPolicy, bool) { + if o == nil || IsNil(o.MaxmemoryPolicy) { + return nil, false + } + return o.MaxmemoryPolicy, true +} + +// HasMaxmemoryPolicy returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxmemoryPolicy() bool { + if o != nil && !IsNil(o.MaxmemoryPolicy) { + return true + } + + return false +} + +// SetMaxmemoryPolicy gets a reference to the given InstanceParametersMaxmemoryPolicy and assigns it to the MaxmemoryPolicy field. +func (o *InstanceParameters) SetMaxmemoryPolicy(v InstanceParametersMaxmemoryPolicy) { + o.MaxmemoryPolicy = &v +} + +// GetMaxmemorySamples returns the MaxmemorySamples field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxmemorySamples() int32 { + if o == nil || IsNil(o.MaxmemorySamples) { + var ret int32 + return ret + } + return *o.MaxmemorySamples +} + +// GetMaxmemorySamplesOk returns a tuple with the MaxmemorySamples field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxmemorySamplesOk() (*int32, bool) { + if o == nil || IsNil(o.MaxmemorySamples) { + return nil, false + } + return o.MaxmemorySamples, true +} + +// HasMaxmemorySamples returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxmemorySamples() bool { + if o != nil && !IsNil(o.MaxmemorySamples) { + return true + } + + return false +} + +// SetMaxmemorySamples gets a reference to the given int32 and assigns it to the MaxmemorySamples field. +func (o *InstanceParameters) SetMaxmemorySamples(v int32) { + o.MaxmemorySamples = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMinReplicasMaxLag returns the MinReplicasMaxLag field value if set, zero value otherwise. +func (o *InstanceParameters) GetMinReplicasMaxLag() int32 { + if o == nil || IsNil(o.MinReplicasMaxLag) { + var ret int32 + return ret + } + return *o.MinReplicasMaxLag +} + +// GetMinReplicasMaxLagOk returns a tuple with the MinReplicasMaxLag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMinReplicasMaxLagOk() (*int32, bool) { + if o == nil || IsNil(o.MinReplicasMaxLag) { + return nil, false + } + return o.MinReplicasMaxLag, true +} + +// HasMinReplicasMaxLag returns a boolean if a field has been set. +func (o *InstanceParameters) HasMinReplicasMaxLag() bool { + if o != nil && !IsNil(o.MinReplicasMaxLag) { + return true + } + + return false +} + +// SetMinReplicasMaxLag gets a reference to the given int32 and assigns it to the MinReplicasMaxLag field. +func (o *InstanceParameters) SetMinReplicasMaxLag(v int32) { + o.MinReplicasMaxLag = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetNotifyKeyspaceEvents returns the NotifyKeyspaceEvents field value if set, zero value otherwise. +func (o *InstanceParameters) GetNotifyKeyspaceEvents() string { + if o == nil || IsNil(o.NotifyKeyspaceEvents) { + var ret string + return ret + } + return *o.NotifyKeyspaceEvents +} + +// GetNotifyKeyspaceEventsOk returns a tuple with the NotifyKeyspaceEvents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetNotifyKeyspaceEventsOk() (*string, bool) { + if o == nil || IsNil(o.NotifyKeyspaceEvents) { + return nil, false + } + return o.NotifyKeyspaceEvents, true +} + +// HasNotifyKeyspaceEvents returns a boolean if a field has been set. +func (o *InstanceParameters) HasNotifyKeyspaceEvents() bool { + if o != nil && !IsNil(o.NotifyKeyspaceEvents) { + return true + } + + return false +} + +// SetNotifyKeyspaceEvents gets a reference to the given string and assigns it to the NotifyKeyspaceEvents field. +func (o *InstanceParameters) SetNotifyKeyspaceEvents(v string) { + o.NotifyKeyspaceEvents = &v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSnapshot returns the Snapshot field value if set, zero value otherwise. +func (o *InstanceParameters) GetSnapshot() string { + if o == nil || IsNil(o.Snapshot) { + var ret string + return ret + } + return *o.Snapshot +} + +// GetSnapshotOk returns a tuple with the Snapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSnapshotOk() (*string, bool) { + if o == nil || IsNil(o.Snapshot) { + return nil, false + } + return o.Snapshot, true +} + +// HasSnapshot returns a boolean if a field has been set. +func (o *InstanceParameters) HasSnapshot() bool { + if o != nil && !IsNil(o.Snapshot) { + return true + } + + return false +} + +// SetSnapshot gets a reference to the given string and assigns it to the Snapshot field. +func (o *InstanceParameters) SetSnapshot(v string) { + o.Snapshot = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +// GetTlsCiphers returns the TlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsCiphers() []string { + if o == nil || IsNil(o.TlsCiphers) { + var ret []string + return ret + } + return o.TlsCiphers +} + +// GetTlsCiphersOk returns a tuple with the TlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsCiphersOk() ([]string, bool) { + if o == nil || IsNil(o.TlsCiphers) { + return nil, false + } + return o.TlsCiphers, true +} + +// HasTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsCiphers() bool { + if o != nil && !IsNil(o.TlsCiphers) { + return true + } + + return false +} + +// SetTlsCiphers gets a reference to the given []string and assigns it to the TlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetTlsCiphers(v []string) { + o.TlsCiphers = v +} + +// GetTlsCiphersuites returns the TlsCiphersuites field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsCiphersuites() string { + if o == nil || IsNil(o.TlsCiphersuites) { + var ret string + return ret + } + return *o.TlsCiphersuites +} + +// GetTlsCiphersuitesOk returns a tuple with the TlsCiphersuites field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsCiphersuitesOk() (*string, bool) { + if o == nil || IsNil(o.TlsCiphersuites) { + return nil, false + } + return o.TlsCiphersuites, true +} + +// HasTlsCiphersuites returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsCiphersuites() bool { + if o != nil && !IsNil(o.TlsCiphersuites) { + return true + } + + return false +} + +// SetTlsCiphersuites gets a reference to the given string and assigns it to the TlsCiphersuites field. +// Deprecated +func (o *InstanceParameters) SetTlsCiphersuites(v string) { + o.TlsCiphersuites = &v +} + +// GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetTlsProtocols() InstanceParametersTlsProtocols { + if o == nil || IsNil(o.TlsProtocols) { + var ret InstanceParametersTlsProtocols + return ret + } + return *o.TlsProtocols +} + +// GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetTlsProtocolsOk() (*InstanceParametersTlsProtocols, bool) { + if o == nil || IsNil(o.TlsProtocols) { + return nil, false + } + return o.TlsProtocols, true +} + +// HasTlsProtocols returns a boolean if a field has been set. +func (o *InstanceParameters) HasTlsProtocols() bool { + if o != nil && !IsNil(o.TlsProtocols) { + return true + } + + return false +} + +// SetTlsProtocols gets a reference to the given InstanceParametersTlsProtocols and assigns it to the TlsProtocols field. +// Deprecated +func (o *InstanceParameters) SetTlsProtocols(v InstanceParametersTlsProtocols) { + o.TlsProtocols = &v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DownAfterMilliseconds) { + toSerialize["down-after-milliseconds"] = o.DownAfterMilliseconds + } + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.FailoverTimeout) { + toSerialize["failover-timeout"] = o.FailoverTimeout + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.LazyfreeLazyEviction) { + toSerialize["lazyfree-lazy-eviction"] = o.LazyfreeLazyEviction + } + if !IsNil(o.LazyfreeLazyExpire) { + toSerialize["lazyfree-lazy-expire"] = o.LazyfreeLazyExpire + } + if !IsNil(o.LuaTimeLimit) { + toSerialize["lua-time-limit"] = o.LuaTimeLimit + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.Maxclients) { + toSerialize["maxclients"] = o.Maxclients + } + if !IsNil(o.MaxmemoryPolicy) { + toSerialize["maxmemory-policy"] = o.MaxmemoryPolicy + } + if !IsNil(o.MaxmemorySamples) { + toSerialize["maxmemory-samples"] = o.MaxmemorySamples + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MinReplicasMaxLag) { + toSerialize["min_replicas_max_lag"] = o.MinReplicasMaxLag + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.NotifyKeyspaceEvents) { + toSerialize["notify-keyspace-events"] = o.NotifyKeyspaceEvents + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Snapshot) { + toSerialize["snapshot"] = o.Snapshot + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + if !IsNil(o.TlsCiphers) { + toSerialize["tls-ciphers"] = o.TlsCiphers + } + if !IsNil(o.TlsCiphersuites) { + toSerialize["tls-ciphersuites"] = o.TlsCiphersuites + } + if !IsNil(o.TlsProtocols) { + toSerialize["tls-protocols"] = o.TlsProtocols + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "down-after-milliseconds") + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "failover-timeout") + delete(additionalProperties, "graphite") + delete(additionalProperties, "lazyfree-lazy-eviction") + delete(additionalProperties, "lazyfree-lazy-expire") + delete(additionalProperties, "lua-time-limit") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "maxclients") + delete(additionalProperties, "maxmemory-policy") + delete(additionalProperties, "maxmemory-samples") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "min_replicas_max_lag") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "notify-keyspace-events") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "snapshot") + delete(additionalProperties, "syslog") + delete(additionalProperties, "tls-ciphers") + delete(additionalProperties, "tls-ciphersuites") + delete(additionalProperties, "tls-protocols") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_parameters_lazyfree_lazy_eviction.go b/services/redis/v2api/model_instance_parameters_lazyfree_lazy_eviction.go new file mode 100644 index 000000000..4de942d83 --- /dev/null +++ b/services/redis/v2api/model_instance_parameters_lazyfree_lazy_eviction.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersLazyfreeLazyEviction the model 'InstanceParametersLazyfreeLazyEviction' +type InstanceParametersLazyfreeLazyEviction string + +// List of InstanceParameters_lazyfree_lazy_eviction +const ( + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_YES InstanceParametersLazyfreeLazyEviction = "yes" + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO InstanceParametersLazyfreeLazyEviction = "no" + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_UNKNOWN_DEFAULT_OPEN_API InstanceParametersLazyfreeLazyEviction = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersLazyfreeLazyEviction enum +var AllowedInstanceParametersLazyfreeLazyEvictionEnumValues = []InstanceParametersLazyfreeLazyEviction{ + "yes", + "no", + "unknown_default_open_api", +} + +func (v *InstanceParametersLazyfreeLazyEviction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersLazyfreeLazyEviction(value) + for _, existing := range AllowedInstanceParametersLazyfreeLazyEvictionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersLazyfreeLazyEvictionFromValue returns a pointer to a valid InstanceParametersLazyfreeLazyEviction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersLazyfreeLazyEvictionFromValue(v string) (*InstanceParametersLazyfreeLazyEviction, error) { + ev := InstanceParametersLazyfreeLazyEviction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersLazyfreeLazyEviction: valid values are %v", v, AllowedInstanceParametersLazyfreeLazyEvictionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersLazyfreeLazyEviction) IsValid() bool { + for _, existing := range AllowedInstanceParametersLazyfreeLazyEvictionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_lazyfree_lazy_eviction value +func (v InstanceParametersLazyfreeLazyEviction) Ptr() *InstanceParametersLazyfreeLazyEviction { + return &v +} + +type NullableInstanceParametersLazyfreeLazyEviction struct { + value *InstanceParametersLazyfreeLazyEviction + isSet bool +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) Get() *InstanceParametersLazyfreeLazyEviction { + return v.value +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) Set(val *InstanceParametersLazyfreeLazyEviction) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersLazyfreeLazyEviction(val *InstanceParametersLazyfreeLazyEviction) *NullableInstanceParametersLazyfreeLazyEviction { + return &NullableInstanceParametersLazyfreeLazyEviction{value: val, isSet: true} +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_parameters_lazyfree_lazy_expire.go b/services/redis/v2api/model_instance_parameters_lazyfree_lazy_expire.go new file mode 100644 index 000000000..c0f77407d --- /dev/null +++ b/services/redis/v2api/model_instance_parameters_lazyfree_lazy_expire.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersLazyfreeLazyExpire the model 'InstanceParametersLazyfreeLazyExpire' +type InstanceParametersLazyfreeLazyExpire string + +// List of InstanceParameters_lazyfree_lazy_expire +const ( + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_YES InstanceParametersLazyfreeLazyExpire = "yes" + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO InstanceParametersLazyfreeLazyExpire = "no" + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_UNKNOWN_DEFAULT_OPEN_API InstanceParametersLazyfreeLazyExpire = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersLazyfreeLazyExpire enum +var AllowedInstanceParametersLazyfreeLazyExpireEnumValues = []InstanceParametersLazyfreeLazyExpire{ + "yes", + "no", + "unknown_default_open_api", +} + +func (v *InstanceParametersLazyfreeLazyExpire) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersLazyfreeLazyExpire(value) + for _, existing := range AllowedInstanceParametersLazyfreeLazyExpireEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersLazyfreeLazyExpireFromValue returns a pointer to a valid InstanceParametersLazyfreeLazyExpire +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersLazyfreeLazyExpireFromValue(v string) (*InstanceParametersLazyfreeLazyExpire, error) { + ev := InstanceParametersLazyfreeLazyExpire(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersLazyfreeLazyExpire: valid values are %v", v, AllowedInstanceParametersLazyfreeLazyExpireEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersLazyfreeLazyExpire) IsValid() bool { + for _, existing := range AllowedInstanceParametersLazyfreeLazyExpireEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_lazyfree_lazy_expire value +func (v InstanceParametersLazyfreeLazyExpire) Ptr() *InstanceParametersLazyfreeLazyExpire { + return &v +} + +type NullableInstanceParametersLazyfreeLazyExpire struct { + value *InstanceParametersLazyfreeLazyExpire + isSet bool +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) Get() *InstanceParametersLazyfreeLazyExpire { + return v.value +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) Set(val *InstanceParametersLazyfreeLazyExpire) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersLazyfreeLazyExpire(val *InstanceParametersLazyfreeLazyExpire) *NullableInstanceParametersLazyfreeLazyExpire { + return &NullableInstanceParametersLazyfreeLazyExpire{value: val, isSet: true} +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_parameters_maxmemory_policy.go b/services/redis/v2api/model_instance_parameters_maxmemory_policy.go new file mode 100644 index 000000000..ae00f488b --- /dev/null +++ b/services/redis/v2api/model_instance_parameters_maxmemory_policy.go @@ -0,0 +1,121 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersMaxmemoryPolicy the model 'InstanceParametersMaxmemoryPolicy' +type InstanceParametersMaxmemoryPolicy string + +// List of InstanceParameters_maxmemory_policy +const ( + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU InstanceParametersMaxmemoryPolicy = "volatile-lru" + INSTANCEPARAMETERSMAXMEMORYPOLICY_ALLKEYS_LRU InstanceParametersMaxmemoryPolicy = "allkeys-lru" + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_RANDOM InstanceParametersMaxmemoryPolicy = "volatile-random" + INSTANCEPARAMETERSMAXMEMORYPOLICY_ALLKEYS_RANDOM InstanceParametersMaxmemoryPolicy = "allkeys-random" + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_TTL InstanceParametersMaxmemoryPolicy = "volatile-ttl" + INSTANCEPARAMETERSMAXMEMORYPOLICY_NOEVICTION InstanceParametersMaxmemoryPolicy = "noeviction" + INSTANCEPARAMETERSMAXMEMORYPOLICY_UNKNOWN_DEFAULT_OPEN_API InstanceParametersMaxmemoryPolicy = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersMaxmemoryPolicy enum +var AllowedInstanceParametersMaxmemoryPolicyEnumValues = []InstanceParametersMaxmemoryPolicy{ + "volatile-lru", + "allkeys-lru", + "volatile-random", + "allkeys-random", + "volatile-ttl", + "noeviction", + "unknown_default_open_api", +} + +func (v *InstanceParametersMaxmemoryPolicy) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersMaxmemoryPolicy(value) + for _, existing := range AllowedInstanceParametersMaxmemoryPolicyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSMAXMEMORYPOLICY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersMaxmemoryPolicyFromValue returns a pointer to a valid InstanceParametersMaxmemoryPolicy +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersMaxmemoryPolicyFromValue(v string) (*InstanceParametersMaxmemoryPolicy, error) { + ev := InstanceParametersMaxmemoryPolicy(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersMaxmemoryPolicy: valid values are %v", v, AllowedInstanceParametersMaxmemoryPolicyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersMaxmemoryPolicy) IsValid() bool { + for _, existing := range AllowedInstanceParametersMaxmemoryPolicyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_maxmemory_policy value +func (v InstanceParametersMaxmemoryPolicy) Ptr() *InstanceParametersMaxmemoryPolicy { + return &v +} + +type NullableInstanceParametersMaxmemoryPolicy struct { + value *InstanceParametersMaxmemoryPolicy + isSet bool +} + +func (v NullableInstanceParametersMaxmemoryPolicy) Get() *InstanceParametersMaxmemoryPolicy { + return v.value +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) Set(val *InstanceParametersMaxmemoryPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersMaxmemoryPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersMaxmemoryPolicy(val *InstanceParametersMaxmemoryPolicy) *NullableInstanceParametersMaxmemoryPolicy { + return &NullableInstanceParametersMaxmemoryPolicy{value: val, isSet: true} +} + +func (v NullableInstanceParametersMaxmemoryPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_parameters_tls_protocols.go b/services/redis/v2api/model_instance_parameters_tls_protocols.go new file mode 100644 index 000000000..2b7622608 --- /dev/null +++ b/services/redis/v2api/model_instance_parameters_tls_protocols.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocols This property is deprecated and will be removed in a future release. +type InstanceParametersTlsProtocols string + +// List of InstanceParameters_tls_protocols +const ( + INSTANCEPARAMETERSTLSPROTOCOLS_TLSV1_2 InstanceParametersTlsProtocols = "TLSv1.2" + INSTANCEPARAMETERSTLSPROTOCOLS_TLSV1_3 InstanceParametersTlsProtocols = "TLSv1.3" + INSTANCEPARAMETERSTLSPROTOCOLS_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocols = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocols enum +var AllowedInstanceParametersTlsProtocolsEnumValues = []InstanceParametersTlsProtocols{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocols) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocols(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersTlsProtocolsFromValue returns a pointer to a valid InstanceParametersTlsProtocols +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersTlsProtocolsFromValue(v string) (*InstanceParametersTlsProtocols, error) { + ev := InstanceParametersTlsProtocols(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocols: valid values are %v", v, AllowedInstanceParametersTlsProtocolsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersTlsProtocols) IsValid() bool { + for _, existing := range AllowedInstanceParametersTlsProtocolsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_tls_protocols value +func (v InstanceParametersTlsProtocols) Ptr() *InstanceParametersTlsProtocols { + return &v +} + +type NullableInstanceParametersTlsProtocols struct { + value *InstanceParametersTlsProtocols + isSet bool +} + +func (v NullableInstanceParametersTlsProtocols) Get() *InstanceParametersTlsProtocols { + return v.value +} + +func (v *NullableInstanceParametersTlsProtocols) Set(val *InstanceParametersTlsProtocols) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersTlsProtocols) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersTlsProtocols) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersTlsProtocols(val *InstanceParametersTlsProtocols) *NullableInstanceParametersTlsProtocols { + return &NullableInstanceParametersTlsProtocols{value: val, isSet: true} +} + +func (v NullableInstanceParametersTlsProtocols) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersTlsProtocols) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_schema.go b/services/redis/v2api/model_instance_schema.go new file mode 100644 index 000000000..c67c753bb --- /dev/null +++ b/services/redis/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_instance_status.go b/services/redis/v2api/model_instance_status.go new file mode 100644 index 000000000..6401bef5c --- /dev/null +++ b/services/redis/v2api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_list_backups_response.go b/services/redis/v2api/model_list_backups_response.go new file mode 100644 index 000000000..73b330f9b --- /dev/null +++ b/services/redis/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_list_credentials_response.go b/services/redis/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..b4a5daf4e --- /dev/null +++ b/services/redis/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_list_instances_response.go b/services/redis/v2api/model_list_instances_response.go new file mode 100644 index 000000000..e7b981198 --- /dev/null +++ b/services/redis/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_list_offerings_response.go b/services/redis/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..42b735385 --- /dev/null +++ b/services/redis/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_list_restores_response.go b/services/redis/v2api/model_list_restores_response.go new file mode 100644 index 000000000..330d0a72c --- /dev/null +++ b/services/redis/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_offering.go b/services/redis/v2api/model_offering.go new file mode 100644 index 000000000..d1979a513 --- /dev/null +++ b/services/redis/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_partial_update_instance_payload.go b/services/redis/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..51094e320 --- /dev/null +++ b/services/redis/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_plan.go b/services/redis/v2api/model_plan.go new file mode 100644 index 000000000..56686379a --- /dev/null +++ b/services/redis/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_raw_credentials.go b/services/redis/v2api/model_raw_credentials.go new file mode 100644 index 000000000..8b5eb7d72 --- /dev/null +++ b/services/redis/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_restore.go b/services/redis/v2api/model_restore.go new file mode 100644 index 000000000..4b5a6f57f --- /dev/null +++ b/services/redis/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_schema.go b/services/redis/v2api/model_schema.go new file mode 100644 index 000000000..584b006f1 --- /dev/null +++ b/services/redis/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_trigger_restore_response.go b/services/redis/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..f9be98951 --- /dev/null +++ b/services/redis/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_update_backups_config_payload.go b/services/redis/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..f821dc88a --- /dev/null +++ b/services/redis/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/model_update_backups_config_response.go b/services/redis/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..95587cee7 --- /dev/null +++ b/services/redis/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v2api/response.go b/services/redis/v2api/response.go new file mode 100644 index 000000000..9fa33bc5f --- /dev/null +++ b/services/redis/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/redis/v2api/utils.go b/services/redis/v2api/utils.go new file mode 100644 index 000000000..af8486057 --- /dev/null +++ b/services/redis/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index 2df13ef68..9f87203cb 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.18.0 +- **Improvement:** Use new WaiterHelper for ske waiters +- **Deprecation:** `CreateOrUpdateClusterWaitHandler` will be removed after 2026-12-08. Use the `CreateClusterWaitHandler` or `UpdateClusterWaitHandler` instead. + ## v1.17.0 - **Feature:** New field `ServiceAccountIssuer` for `ClusterStatus` model struct diff --git a/services/ske/VERSION b/services/ske/VERSION index 07c3efad8..f72019128 100644 --- a/services/ske/VERSION +++ b/services/ske/VERSION @@ -1 +1 @@ -v1.17.0 +v1.18.0 diff --git a/services/ske/v2api/wait/wait.go b/services/ske/v2api/wait/wait.go index fa46dc32b..aa3398852 100644 --- a/services/ske/v2api/wait/wait.go +++ b/services/ske/v2api/wait/wait.go @@ -2,7 +2,7 @@ package wait import ( "context" - "fmt" + "errors" "time" "github.com/stackitcloud/stackit-sdk-go/core/wait" @@ -31,7 +31,17 @@ const ( RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND = ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND ) -// CreateOrUpdateClusterWaitHandler will wait for cluster creation or update +// CreateClusterWaitHandler will wait for cluster creation +func CreateClusterWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[ske.Cluster] { + return CreateOrUpdateClusterWaitHandler(ctx, a, projectId, region, name) +} + +// UpdateClusterWaitHandler will wait for cluster update +func UpdateClusterWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[ske.Cluster] { + return CreateOrUpdateClusterWaitHandler(ctx, a, projectId, region, name) +} + +// Deprecated: Will be removed after 2026-12-08. Use the CreateClusterWaitHandler or UpdateClusterWaitHandler instead. func CreateOrUpdateClusterWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { s, err := a.GetCluster(ctx, projectId, region, name).Execute() @@ -151,72 +161,73 @@ func TriggerClusterWakeupWaitHandler(ctx context.Context, a ske.DefaultAPI, proj // RotateCredentialsWaitHandler will wait for credentials rotation func RotateCredentialsWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { - handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetCluster(ctx, projectId, region, clusterName).Execute() - if err != nil { - return false, nil, err - } - state := *s.Status.Aggregated - - if state == ske.CLUSTERSTATUSSTATE_STATE_HEALTHY || state == ske.CLUSTERSTATUSSTATE_STATE_HIBERNATED { - return true, s, nil - } - - if state == ske.CLUSTERSTATUSSTATE_STATE_RECONCILING { - return false, nil, nil - } - - return true, s, fmt.Errorf("unexpected state %s while waiting for cluster reconciliation", state) - }) - + waitConfig := wait.WaiterHelper[ske.Cluster, ske.ClusterStatusState]{ + FetchInstance: a.GetCluster(ctx, projectId, region, clusterName).Execute, + GetState: func(s *ske.Cluster) (ske.ClusterStatusState, error) { + if s == nil || s.Status == nil || s.Status.Aggregated == nil { + return "", errors.New("empty response or status") + } + return *s.Status.Aggregated, nil + }, + ActiveState: []ske.ClusterStatusState{ + ske.CLUSTERSTATUSSTATE_STATE_HEALTHY, + ske.CLUSTERSTATUSSTATE_STATE_HIBERNATED, + }, + ErrorState: []ske.ClusterStatusState{ + ske.CLUSTERSTATUSSTATE_STATE_UNHEALTHY, + ske.CLUSTERSTATUSSTATE_STATE_DELETING, + ske.CLUSTERSTATUSSTATE_STATE_HIBERNATING, + ske.CLUSTERSTATUSSTATE_STATE_WAKINGUP, + }, + } + + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } // StartCredentialsRotationWaitHandler will wait for credentials rotation func StartCredentialsRotationWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { - handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetCluster(ctx, projectId, region, clusterName).Execute() - if err != nil { - return false, nil, err - } - state := *s.Status.CredentialsRotation.Phase - - if state == ske.CREDENTIALSROTATIONSTATEPHASE_PREPARED { - return true, s, nil - } - - if state == ske.CREDENTIALSROTATIONSTATEPHASE_PREPARING { - return false, nil, nil - } - - return true, s, fmt.Errorf("unexpected status %s while waiting for cluster credentials rotation to be prepared", state) - }) - + waitConfig := wait.WaiterHelper[ske.Cluster, ske.CredentialsRotationStatePhase]{ + FetchInstance: a.GetCluster(ctx, projectId, region, clusterName).Execute, + GetState: func(s *ske.Cluster) (ske.CredentialsRotationStatePhase, error) { + if s == nil || s.Status == nil || s.Status.CredentialsRotation == nil || s.Status.CredentialsRotation.Phase == nil { + return "", errors.New("empty response or credentials rotation phase") + } + return *s.Status.CredentialsRotation.Phase, nil + }, + ActiveState: []ske.CredentialsRotationStatePhase{ske.CREDENTIALSROTATIONSTATEPHASE_PREPARED}, + ErrorState: []ske.CredentialsRotationStatePhase{ + ske.CREDENTIALSROTATIONSTATEPHASE_NEVER, + ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETING, + ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED, + }, + } + + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(45 * time.Minute) return handler } // CompleteCredentialsRotationWaitHandler will wait for credentials rotation func CompleteCredentialsRotationWaitHandler(ctx context.Context, a ske.DefaultAPI, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { - handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetCluster(ctx, projectId, region, clusterName).Execute() - if err != nil { - return false, nil, err - } - state := *s.Status.CredentialsRotation.Phase - - if state == ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED { - return true, s, nil - } - - if state == ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETING { - return false, nil, nil - } - - return true, s, fmt.Errorf("unexpected status %s while waiting for cluster credentials rotation to be completed", state) - }) - + waitConfig := wait.WaiterHelper[ske.Cluster, ske.CredentialsRotationStatePhase]{ + FetchInstance: a.GetCluster(ctx, projectId, region, clusterName).Execute, + GetState: func(s *ske.Cluster) (ske.CredentialsRotationStatePhase, error) { + if s == nil || s.Status == nil || s.Status.CredentialsRotation == nil || s.Status.CredentialsRotation.Phase == nil { + return "", errors.New("empty response or credentials rotation phase") + } + return *s.Status.CredentialsRotation.Phase, nil + }, + ActiveState: []ske.CredentialsRotationStatePhase{ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED}, + ErrorState: []ske.CredentialsRotationStatePhase{ + ske.CREDENTIALSROTATIONSTATEPHASE_NEVER, + ske.CREDENTIALSROTATIONSTATEPHASE_PREPARING, + ske.CREDENTIALSROTATIONSTATEPHASE_PREPARED, + }, + } + + handler := wait.New(waitConfig.Wait()) handler.SetTimeout(45 * time.Minute) return handler } diff --git a/services/ske/v2api/wait/wait_test.go b/services/ske/v2api/wait/wait_test.go index 29dd38751..f24ee4f6a 100644 --- a/services/ske/v2api/wait/wait_test.go +++ b/services/ske/v2api/wait/wait_test.go @@ -2,6 +2,7 @@ package wait import ( "context" + "fmt" "net/http" "testing" "testing/synctest" @@ -11,6 +12,7 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" + "github.com/stackitcloud/stackit-sdk-go/core/wait" ske "github.com/stackitcloud/stackit-sdk-go/services/ske/v2api" ) @@ -84,7 +86,7 @@ func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { wantResp bool }{ { - desc: "create_succeeded", + desc: "succeeded", getFails: false, resourceState: ske.CLUSTERSTATUSSTATE_STATE_HEALTHY, wantErr: false, @@ -119,48 +121,56 @@ func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { wantResp: false, }, } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - name := "cluster" - apiClient := newAPIMock(mockSettings{ - getFails: tt.getFails, - name: name, - resourceState: tt.resourceState, - invalidArgusInstance: tt.invalidArgusInstance, - }) + handlers := map[string]func(context.Context, ske.DefaultAPI, string, string, string) *wait.AsyncActionHandler[ske.Cluster]{ + "common logic": CreateOrUpdateClusterWaitHandler, + "create": CreateClusterWaitHandler, + "update": UpdateClusterWaitHandler, + } - var wantRes *ske.Cluster - rs := ske.ClusterStatusState(tt.resourceState) - if tt.wantResp { - wantRes = &ske.Cluster{ - Name: &name, - Status: &ske.ClusterStatus{ - Aggregated: &rs, - }, - } + for handlerDesc, handlerFn := range handlers { + for _, tt := range tests { + t.Run(fmt.Sprintf("%s - %s", handlerDesc, tt.desc), func(t *testing.T) { + synctest.Test(t, func(t *testing.T) { + name := "cluster" + + apiClient := newAPIMock(mockSettings{ + getFails: tt.getFails, + name: name, + resourceState: tt.resourceState, + invalidArgusInstance: tt.invalidArgusInstance, + }) + + var wantRes *ske.Cluster + rs := ske.ClusterStatusState(tt.resourceState) + if tt.wantResp { + wantRes = &ske.Cluster{ + Name: &name, + Status: &ske.ClusterStatus{ + Aggregated: &rs, + }, + } - if tt.invalidArgusInstance { - wantRes.Status.Error = &ske.RuntimeError{ - Code: utils.Ptr(ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND), - Message: utils.Ptr("invalid argus instance"), + if tt.invalidArgusInstance { + wantRes.Status.Error = &ske.RuntimeError{ + Code: utils.Ptr(ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND), + Message: utils.Ptr("invalid argus instance"), + } } } - } - - handler := CreateOrUpdateClusterWaitHandler(context.Background(), apiClient, "", testRegion, name) - gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) + handler := handlerFn(context.Background(), apiClient, "", testRegion, name) + gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(gotRes, wantRes) { - t.Fatalf("handler gotRes = %+v, want %+v", gotRes, wantRes) - } + if (err != nil) != tt.wantErr { + t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(gotRes, wantRes) { + t.Fatalf("handler gotRes = %+v, want %+v", gotRes, wantRes) + } + }) }) - }) + } } }