From d46223896cd447ed60a22a93606316a668d9d3a4 Mon Sep 17 00:00:00 2001 From: adeatcu-ionos Date: Tue, 28 Jan 2025 13:14:56 +0200 Subject: [PATCH] refactor: Use bundle instead of SDK for Cert Manager --- go.mod | 2 +- go.sum | 4 +- ...ce_certificate_manager_auto_certificate.go | 6 +- ..._source_certificate_manager_certificate.go | 15 +- ...ata_source_certificate_manager_provider.go | 6 +- ...ce_certificate_manager_auto_certificate.go | 2 +- ...rtificate_manager_auto_certificate_test.go | 2 +- ...esource_certificate_manager_certificate.go | 2 +- .../resource_certificate_manager_provider.go | 2 +- ...ource_certificate_manager_provider_test.go | 2 +- services/cert/auto_certificate.go | 84 +- services/cert/certificate.go | 66 +- services/cert/client.go | 25 +- services/cert/provider.go | 69 +- .../products/cert/v2}/.gitignore | 0 .../products/cert/v2}/.travis.yml | 0 .../sdk-go-bundle/products/cert/v2/LICENSE | 201 +++++ .../sdk-go-bundle/products/cert/v2/README.md | 274 +++++++ .../products/cert/v2}/api_auto_certificate.go | 318 +++---- .../products/cert/v2}/api_certificate.go | 320 ++++---- .../products/cert/v2}/api_provider.go | 316 +++---- .../products/cert/v2}/client.go | 266 +++--- .../cert/v2}/model_auto_certificate.go | 180 ++-- .../cert/v2}/model_auto_certificate_create.go | 83 +- .../cert/v2}/model_auto_certificate_patch.go | 83 +- .../cert/v2}/model_auto_certificate_read.go | 174 ++-- .../v2}/model_auto_certificate_read_list.go | 246 ++---- ...model_auto_certificate_read_list_all_of.go | 147 ++-- .../products/cert/v2}/model_certificate.go | 141 +--- .../cert/v2}/model_certificate_create.go | 83 +- .../cert/v2}/model_certificate_patch.go | 83 +- .../cert/v2}/model_certificate_read.go | 174 ++-- .../cert/v2}/model_certificate_read_list.go | 246 ++---- .../v2}/model_certificate_read_list_all_of.go | 147 ++-- .../products/cert/v2}/model_connection.go | 108 +-- .../cert/v2}/model_day_of_the_week.go | 3 +- .../products/cert/v2}/model_error.go | 85 +- .../products/cert/v2}/model_error_messages.go | 83 +- .../products/cert/v2}/model_links.go | 120 ++- .../cert/v2}/model_maintenance_window.go | 75 +- .../products/cert/v2}/model_metadata.go | 281 +++---- ...adata_with_auto_certificate_information.go | 384 ++++----- ...ith_auto_certificate_information_all_of.go | 46 +- ...l_metadata_with_certificate_information.go | 619 +++++--------- ...ata_with_certificate_information_all_of.go | 282 ++----- .../cert/v2}/model_metadata_with_status.go | 347 +++----- .../v2}/model_metadata_with_status_all_of.go | 75 +- .../products/cert/v2}/model_pagination.go | 108 +-- .../products/cert/v2}/model_patch_name.go | 42 +- .../products/cert/v2}/model_provider.go | 145 +--- .../cert/v2}/model_provider_create.go | 83 +- ...model_provider_external_account_binding.go | 83 +- .../products/cert/v2}/model_provider_patch.go | 83 +- .../products/cert/v2}/model_provider_read.go | 174 ++-- .../cert/v2}/model_provider_read_list.go | 246 ++---- .../v2}/model_provider_read_list_all_of.go | 147 ++-- .../sdk-go-bundle/products/cert/v2/utils.go | 362 ++++++++ .../sdk-go-cert-manager/.gitbook.yaml | 4 - .../ionos-cloud/sdk-go-cert-manager/README.md | 141 ---- .../sdk-go-cert-manager/configuration.go | 292 ------- .../ionos-cloud/sdk-go-cert-manager/logger.go | 80 -- .../sdk-go-cert-manager/response.go | 73 -- .../sonar-project.properties | 12 - .../ionos-cloud/sdk-go-cert-manager/utils.go | 776 ------------------ vendor/modules.txt | 6 +- 65 files changed, 3395 insertions(+), 5739 deletions(-) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/.gitignore (100%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/.travis.yml (100%) create mode 100644 vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/LICENSE create mode 100644 vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/README.md rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/api_auto_certificate.go (82%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/api_certificate.go (82%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/api_provider.go (82%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/client.go (74%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate.go (62%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate_create.go (69%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate_patch.go (69%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate_read.go (60%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate_read_list.go (58%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_auto_certificate_read_list_all_of.go (65%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate.go (64%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate_create.go (69%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate_patch.go (69%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate_read.go (60%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate_read_list.go (58%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_certificate_read_list_all_of.go (64%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_connection.go (67%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_day_of_the_week.go (99%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_error.go (70%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_error_messages.go (74%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_links.go (70%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_maintenance_window.go (71%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata.go (64%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_auto_certificate_information.go (68%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_auto_certificate_information_all_of.go (83%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_certificate_information.go (61%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_certificate_information_all_of.go (65%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_status.go (63%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_metadata_with_status_all_of.go (73%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_pagination.go (68%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_patch_name.go (80%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider.go (65%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_create.go (68%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_external_account_binding.go (76%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_patch.go (68%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_read.go (60%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_read_list.go (58%) rename vendor/github.com/ionos-cloud/{sdk-go-cert-manager => sdk-go-bundle/products/cert/v2}/model_provider_read_list_all_of.go (64%) create mode 100644 vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/utils.go delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitbook.yaml delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/README.md delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/configuration.go delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/logger.go delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/response.go delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/sonar-project.properties delete mode 100644 vendor/github.com/ionos-cloud/sdk-go-cert-manager/utils.go diff --git a/go.mod b/go.mod index bccf957f4..4044f18d6 100644 --- a/go.mod +++ b/go.mod @@ -17,11 +17,11 @@ require ( github.com/iancoleman/strcase v0.3.0 github.com/ionos-cloud/sdk-go-api-gateway v1.0.0 github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0 + github.com/ionos-cloud/sdk-go-bundle/products/cert/v2 v2.1.0 github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1 github.com/ionos-cloud/sdk-go-bundle/products/monitoring/v2 v2.0.0 github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2 github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1 - github.com/ionos-cloud/sdk-go-cert-manager v1.3.0 github.com/ionos-cloud/sdk-go-container-registry v1.2.0 github.com/ionos-cloud/sdk-go-dataplatform v1.1.1 github.com/ionos-cloud/sdk-go-dbaas-in-memory-db v1.0.1 diff --git a/go.sum b/go.sum index 808fbb186..4328c64a1 100644 --- a/go.sum +++ b/go.sum @@ -116,6 +116,8 @@ github.com/ionos-cloud/sdk-go-api-gateway v1.0.0 h1:T+JzarV1Iw7NjWQfEuv5bESnHoCL github.com/ionos-cloud/sdk-go-api-gateway v1.0.0/go.mod h1:TkSlamP+qKRT8cgBaZEN8rawanVluOR0dXbXXdmmwTY= github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0 h1:8fRICa4i+GJHrCgnLe8t3uwfahkg7pcDDwoLkH3B2Xc= github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0/go.mod h1:BF6R+j1GdJEMImxkeh32qjIVWqsBfgi6VgyfsY5ezIA= +github.com/ionos-cloud/sdk-go-bundle/products/cert/v2 v2.1.0 h1:nZbFVqm+nfMsp2HxBFQVsF5qDNKjtCjYWteJHZf4c/k= +github.com/ionos-cloud/sdk-go-bundle/products/cert/v2 v2.1.0/go.mod h1:7ONrlRb2n7qjLR5O7oCQzOJAiRhj/D4ywvpJUPQr1q0= github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1 h1:GXxdNKl7haQnHO1QewZeXazur5+LDCpHqvP+nNObGaA= github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1/go.mod h1:N0ifRq3ENqGg6qht1WPrVgSkcavPS5SRWlNfkHUZbfQ= github.com/ionos-cloud/sdk-go-bundle/products/monitoring/v2 v2.0.0 h1:gVh+jd0o8ROtJLWqUB6/VU8vSLdj/kRYAz/qbMO7z7I= @@ -124,8 +126,6 @@ github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2 h1:qR/ul88v/3ZF+ZLFF github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2/go.mod h1:V6WHbWsQDlZsLtHqgsXO81Z9eJBsczE3Q6VY8J+rutc= github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1 h1:NWobgIhmUJKG6ohFXefMj+KmpEEvLYEDUgGzpns6HQE= github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1/go.mod h1:cLIl4zmB1yMdPSNgTzaRmXeuusEAY1O3Lp/iXSc/R6E= -github.com/ionos-cloud/sdk-go-cert-manager v1.3.0 h1:VMbD/XgLmMV2d7uI1+xf/uzRZWKJd8Ayan9IZ6gH1pM= -github.com/ionos-cloud/sdk-go-cert-manager v1.3.0/go.mod h1:8CPWJBuryfrUpiPNrVIPry6qQjZWfIhmRpFkqKiaO2w= github.com/ionos-cloud/sdk-go-container-registry v1.2.0 h1:C5r2XleKLbSFw9kmb4N8ImqJ/HtLus3yh/R5BHy/6sg= github.com/ionos-cloud/sdk-go-container-registry v1.2.0/go.mod h1:woBP1+A4N0KXiRj9jG4y/hEXgrVjJv0CUlAvc24mCeo= github.com/ionos-cloud/sdk-go-dataplatform v1.1.1 h1:Wu9TAiphRyMEweUcQlMblhVCl9qVxQlOYEOw+jJS+Ss= diff --git a/ionoscloud/data_source_certificate_manager_auto_certificate.go b/ionoscloud/data_source_certificate_manager_auto_certificate.go index fb88a2060..2a0ffef3e 100644 --- a/ionoscloud/data_source_certificate_manager_auto_certificate.go +++ b/ionoscloud/data_source_certificate_manager_auto_certificate.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - certSDK "github.com/ionos-cloud/sdk-go-cert-manager" + certSDK "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" certService "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/cert" @@ -98,8 +98,8 @@ func dataSourceAutoCertificateRead(ctx context.Context, d *schema.ResourceData, } var results []certSDK.AutoCertificateRead if autoCertificates.Items != nil { - for _, autoCertificateItem := range *autoCertificates.Items { - if autoCertificateItem.Properties != nil && autoCertificateItem.Properties.Name != nil && strings.EqualFold(*autoCertificateItem.Properties.Name, name.(string)) { + for _, autoCertificateItem := range autoCertificates.Items { + if strings.EqualFold(autoCertificateItem.Properties.Name, name.(string)) { results = append(results, autoCertificateItem) } } diff --git a/ionoscloud/data_source_certificate_manager_certificate.go b/ionoscloud/data_source_certificate_manager_certificate.go index 210ef30d3..f6f84135b 100644 --- a/ionoscloud/data_source_certificate_manager_certificate.go +++ b/ionoscloud/data_source_certificate_manager_certificate.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - certmanager "github.com/ionos-cloud/sdk-go-cert-manager" + certmanager "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/cert" @@ -70,15 +70,12 @@ func dataSourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(fmt.Errorf("error getting certificate with id %s %w", idStr, err)) } if nameOk { - if certificate.Properties != nil && certificate.Properties.Name != nil && - !strings.EqualFold(*certificate.Properties.Name, name) { + if !strings.EqualFold(certificate.Properties.Name, name) { return diag.FromErr(fmt.Errorf("name of cert (UUID=%s, name=%s) does not match expected name: %s", - *certificate.Id, *certificate.Properties.Name, name)) + certificate.Id, certificate.Properties.Name, name)) } } - if certificate.Properties != nil { - log.Printf("[INFO] Got certificate [Name=%s]", *certificate.Properties.Name) - } + log.Printf("[INFO] Got certificate [Name=%s]", certificate.Properties.Name) } else { log.Printf("[INFO] Using data source for certificate with name: %s", name) @@ -92,8 +89,8 @@ func dataSourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta if certificates.Items != nil { var certsFound []certmanager.CertificateRead - for _, certItem := range *certificates.Items { - if certItem.Properties != nil && certItem.Properties.Name != nil && *certItem.Properties.Name == name { + for _, certItem := range certificates.Items { + if certItem.Properties.Name == name { certsFound = append(certsFound, certItem) } } diff --git a/ionoscloud/data_source_certificate_manager_provider.go b/ionoscloud/data_source_certificate_manager_provider.go index ebf96c7fa..17f59d927 100644 --- a/ionoscloud/data_source_certificate_manager_provider.go +++ b/ionoscloud/data_source_certificate_manager_provider.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - certSDK "github.com/ionos-cloud/sdk-go-cert-manager" + certSDK "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" certService "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/cert" @@ -94,8 +94,8 @@ func dataSourceProviderRead(ctx context.Context, d *schema.ResourceData, meta in } var results []certSDK.ProviderRead if providers.Items != nil { - for _, providerItem := range *providers.Items { - if providerItem.Properties != nil && providerItem.Properties.Name != nil && strings.EqualFold(*providerItem.Properties.Name, name.(string)) { + for _, providerItem := range providers.Items { + if strings.EqualFold(providerItem.Properties.Name, name.(string)) { results = append(results, providerItem) } } diff --git a/ionoscloud/resource_certificate_manager_auto_certificate.go b/ionoscloud/resource_certificate_manager_auto_certificate.go index 2257985af..85f656fec 100644 --- a/ionoscloud/resource_certificate_manager_auto_certificate.go +++ b/ionoscloud/resource_certificate_manager_auto_certificate.go @@ -81,7 +81,7 @@ func autoCertificateCreate(ctx context.Context, d *schema.ResourceData, meta int if err != nil { return diag.FromErr(fmt.Errorf("an error occurred while creating an auto-certificate: %w", err)) } - autoCertificateID := *response.Id + autoCertificateID := response.Id d.SetId(autoCertificateID) err = utils.WaitForResourceToBeReady(ctx, d, client.IsAutoCertificateReady) diff --git a/ionoscloud/resource_certificate_manager_auto_certificate_test.go b/ionoscloud/resource_certificate_manager_auto_certificate_test.go index 8b9b7dd44..63b863b8a 100644 --- a/ionoscloud/resource_certificate_manager_auto_certificate_test.go +++ b/ionoscloud/resource_certificate_manager_auto_certificate_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - certSDK "github.com/ionos-cloud/sdk-go-cert-manager" + certSDK "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" diff --git a/ionoscloud/resource_certificate_manager_certificate.go b/ionoscloud/resource_certificate_manager_certificate.go index 6ebbfa413..9c1d8a8a8 100644 --- a/ionoscloud/resource_certificate_manager_certificate.go +++ b/ionoscloud/resource_certificate_manager_certificate.go @@ -108,7 +108,7 @@ func resourceCertificateManagerCreate(ctx context.Context, d *schema.ResourceDat return diags } - d.SetId(*certificateDto.Id) + d.SetId(certificateDto.Id) if err = utils.WaitForResourceToBeReady(ctx, d, client.IsCertReady); err != nil { return diag.FromErr(err) diff --git a/ionoscloud/resource_certificate_manager_provider.go b/ionoscloud/resource_certificate_manager_provider.go index 7b767e2b9..22a6a8ec2 100644 --- a/ionoscloud/resource_certificate_manager_provider.go +++ b/ionoscloud/resource_certificate_manager_provider.go @@ -84,7 +84,7 @@ func providerCreate(ctx context.Context, d *schema.ResourceData, meta interface{ if err != nil { return diag.FromErr(fmt.Errorf("an error occurred while creating an auto-certificate provider: %w", err)) } - providerID := *response.Id + providerID := response.Id d.SetId(providerID) err = utils.WaitForResourceToBeReady(ctx, d, client.IsProviderReady) diff --git a/ionoscloud/resource_certificate_manager_provider_test.go b/ionoscloud/resource_certificate_manager_provider_test.go index 4c2313c94..431ecdb2c 100644 --- a/ionoscloud/resource_certificate_manager_provider_test.go +++ b/ionoscloud/resource_certificate_manager_provider_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - certSDK "github.com/ionos-cloud/sdk-go-cert-manager" + certSDK "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" diff --git a/services/cert/auto_certificate.go b/services/cert/auto_certificate.go index 1c62f59f8..e8f619829 100644 --- a/services/cert/auto_certificate.go +++ b/services/cert/auto_certificate.go @@ -6,7 +6,8 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - certmanager "github.com/ionos-cloud/sdk-go-cert-manager" + certmanager "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" + "github.com/ionos-cloud/sdk-go-bundle/shared" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" @@ -16,7 +17,7 @@ import ( // are suggestive enough). // //nolint:golint -func (c *Client) GetAutoCertificate(ctx context.Context, autoCertificateID, location string) (certmanager.AutoCertificateRead, *certmanager.APIResponse, error) { +func (c *Client) GetAutoCertificate(ctx context.Context, autoCertificateID, location string) (certmanager.AutoCertificateRead, *shared.APIResponse, error) { c.modifyConfigURL(location) autoCertificate, apiResponse, err := c.sdkClient.AutoCertificateApi.AutoCertificatesFindById(ctx, autoCertificateID).Execute() apiResponse.LogInfo() @@ -24,7 +25,7 @@ func (c *Client) GetAutoCertificate(ctx context.Context, autoCertificateID, loca } //nolint:golint -func (c *Client) ListAutoCertificates(ctx context.Context, location string) (certmanager.AutoCertificateReadList, *certmanager.APIResponse, error) { +func (c *Client) ListAutoCertificates(ctx context.Context, location string) (certmanager.AutoCertificateReadList, *shared.APIResponse, error) { c.modifyConfigURL(location) autoCertificates, apiResponse, err := c.sdkClient.AutoCertificateApi.AutoCertificatesGet(ctx).Execute() apiResponse.LogInfo() @@ -32,7 +33,7 @@ func (c *Client) ListAutoCertificates(ctx context.Context, location string) (cer } //nolint:golint -func (c *Client) CreateAutoCertificate(ctx context.Context, location string, autoCertificatePostData certmanager.AutoCertificateCreate) (certmanager.AutoCertificateRead, *certmanager.APIResponse, error) { +func (c *Client) CreateAutoCertificate(ctx context.Context, location string, autoCertificatePostData certmanager.AutoCertificateCreate) (certmanager.AutoCertificateRead, *shared.APIResponse, error) { c.modifyConfigURL(location) autoCertificate, apiResponse, err := c.sdkClient.AutoCertificateApi.AutoCertificatesPost(ctx).AutoCertificateCreate(autoCertificatePostData).Execute() apiResponse.LogInfo() @@ -40,7 +41,7 @@ func (c *Client) CreateAutoCertificate(ctx context.Context, location string, aut } //nolint:golint -func (c *Client) UpdateAutoCertificate(ctx context.Context, autoCertificateID, location string, autoCertificatePatchData certmanager.AutoCertificatePatch) (certmanager.AutoCertificateRead, *certmanager.APIResponse, error) { +func (c *Client) UpdateAutoCertificate(ctx context.Context, autoCertificateID, location string, autoCertificatePatchData certmanager.AutoCertificatePatch) (certmanager.AutoCertificateRead, *shared.APIResponse, error) { c.modifyConfigURL(location) autoCertificate, apiResponse, err := c.sdkClient.AutoCertificateApi.AutoCertificatesPatch(ctx, autoCertificateID).AutoCertificatePatch(autoCertificatePatchData).Execute() apiResponse.LogInfo() @@ -48,7 +49,7 @@ func (c *Client) UpdateAutoCertificate(ctx context.Context, autoCertificateID, l } //nolint:golint -func (c *Client) DeleteAutoCertificate(ctx context.Context, autoCertificateID, location string) (*certmanager.APIResponse, error) { +func (c *Client) DeleteAutoCertificate(ctx context.Context, autoCertificateID, location string) (*shared.APIResponse, error) { c.modifyConfigURL(location) apiResponse, err := c.sdkClient.AutoCertificateApi.AutoCertificatesDelete(ctx, autoCertificateID).Execute() apiResponse.LogInfo() @@ -63,13 +64,10 @@ func (c *Client) IsAutoCertificateReady(ctx context.Context, d *schema.ResourceD if err != nil { return false, fmt.Errorf("error checking auto-certificate status: %w", err) } - if autoCertificate.Metadata == nil || autoCertificate.Metadata.State == nil { - return false, fmt.Errorf("metadata or state is empty for auto-certificate with ID: %v", autoCertificateID) + if utils.IsStateFailed(autoCertificate.Metadata.State) { + return false, fmt.Errorf("error while checking if auto-certificate is ready, auto-certificate ID: %v, state: %v", autoCertificateID, autoCertificate.Metadata.State) } - if utils.IsStateFailed(*autoCertificate.Metadata.State) { - return false, fmt.Errorf("error while checking if auto-certificate is ready, auto-certificate ID: %v, state: %v", autoCertificateID, *autoCertificate.Metadata.State) - } - return strings.EqualFold(*autoCertificate.Metadata.State, constant.Available), nil + return strings.EqualFold(autoCertificate.Metadata.State, constant.Available), nil } //nolint:golint @@ -83,8 +81,8 @@ func (c *Client) IsAutoCertificateDeleted(ctx context.Context, d *schema.Resourc } return false, fmt.Errorf("error while checking deletion status for auto-certificate with ID: %v, error: %w", d.Id(), err) } - if autoCertificate.Metadata != nil && autoCertificate.Metadata.State != nil && utils.IsStateFailed(*autoCertificate.Metadata.State) { - return false, fmt.Errorf("error while checking if auto-certificate is deleted properly, auto-certificate ID: %v, state: %v", autoCertificateID, *autoCertificate.Metadata.State) + if utils.IsStateFailed(autoCertificate.Metadata.State) { + return false, fmt.Errorf("error while checking if auto-certificate is deleted properly, auto-certificate ID: %v, state: %v", autoCertificateID, autoCertificate.Metadata.State) } return false, nil } @@ -92,17 +90,17 @@ func (c *Client) IsAutoCertificateDeleted(ctx context.Context, d *schema.Resourc //nolint:golint func GetAutoCertificateDataCreate(d *schema.ResourceData) *certmanager.AutoCertificateCreate { autoCertificate := certmanager.AutoCertificateCreate{ - Properties: &certmanager.AutoCertificate{}, + Properties: certmanager.AutoCertificate{}, } providerID := d.Get("provider_id").(string) - autoCertificate.Properties.Provider = &providerID + autoCertificate.Properties.Provider = providerID commonName := d.Get("common_name").(string) - autoCertificate.Properties.CommonName = &commonName + autoCertificate.Properties.CommonName = commonName name := d.Get("name").(string) - autoCertificate.Properties.Name = &name + autoCertificate.Properties.Name = name keyAlgorithm := d.Get("key_algorithm").(string) - autoCertificate.Properties.KeyAlgorithm = &keyAlgorithm + autoCertificate.Properties.KeyAlgorithm = keyAlgorithm if subjectAlternativeNames, subjectAlternativeNamesOk := d.GetOk("subject_alternative_names"); subjectAlternativeNamesOk { subjectAlternativeNames := subjectAlternativeNames.([]interface{}) var subjectAlternativeNamesList []string @@ -110,7 +108,7 @@ func GetAutoCertificateDataCreate(d *schema.ResourceData) *certmanager.AutoCerti subjectAlternativeName := subjectAlternativeName.(string) subjectAlternativeNamesList = append(subjectAlternativeNamesList, subjectAlternativeName) } - autoCertificate.Properties.SubjectAlternativeNames = &subjectAlternativeNamesList + autoCertificate.Properties.SubjectAlternativeNames = subjectAlternativeNamesList } return &autoCertificate } @@ -118,12 +116,12 @@ func GetAutoCertificateDataCreate(d *schema.ResourceData) *certmanager.AutoCerti //nolint:golint func GetAutoCertificateDataUpdate(d *schema.ResourceData) *certmanager.AutoCertificatePatch { autoCertificate := certmanager.AutoCertificatePatch{ - Properties: &certmanager.PatchName{}, + Properties: certmanager.PatchName{}, } if d.HasChange("name") { _, newValue := d.GetChange("name") newValueStr := newValue.(string) - autoCertificate.Properties.Name = &newValueStr + autoCertificate.Properties.Name = newValueStr } return &autoCertificate } @@ -131,43 +129,29 @@ func GetAutoCertificateDataUpdate(d *schema.ResourceData) *certmanager.AutoCerti //nolint:golint func SetAutoCertificateData(d *schema.ResourceData, autoCertificate certmanager.AutoCertificateRead) error { resourceName := "Auto-certificate" - if autoCertificate.Id != nil { - d.SetId(*autoCertificate.Id) - } - if autoCertificate.Metadata == nil || autoCertificate.Properties == nil { - return fmt.Errorf("response properties/metadata should not be empty for auto-certificate with ID: %v", *autoCertificate.Id) - } + d.SetId(autoCertificate.Id) + if autoCertificate.Metadata.LastIssuedCertificate != nil { if err := d.Set("last_issued_certificate_id", *autoCertificate.Metadata.LastIssuedCertificate); err != nil { return utils.GenerateSetError(resourceName, "last_issued_certificate_id", err) } } - if autoCertificate.Properties.Provider != nil { - if err := d.Set("provider_id", *autoCertificate.Properties.Provider); err != nil { - return utils.GenerateSetError(resourceName, "provider_id", err) - } + if err := d.Set("provider_id", autoCertificate.Properties.Provider); err != nil { + return utils.GenerateSetError(resourceName, "provider_id", err) } - if autoCertificate.Properties.CommonName != nil { - if err := d.Set("common_name", *autoCertificate.Properties.CommonName); err != nil { - return utils.GenerateSetError(resourceName, "common_name", err) - } + if err := d.Set("common_name", autoCertificate.Properties.CommonName); err != nil { + return utils.GenerateSetError(resourceName, "common_name", err) } - if autoCertificate.Properties.KeyAlgorithm != nil { - if err := d.Set("key_algorithm", *autoCertificate.Properties.KeyAlgorithm); err != nil { - return utils.GenerateSetError(resourceName, "key_algorithm", err) - } + if err := d.Set("key_algorithm", autoCertificate.Properties.KeyAlgorithm); err != nil { + return utils.GenerateSetError(resourceName, "key_algorithm", err) } - if autoCertificate.Properties.Name != nil { - if err := d.Set("name", *autoCertificate.Properties.Name); err != nil { - return utils.GenerateSetError(resourceName, "name", err) - } + if err := d.Set("name", autoCertificate.Properties.Name); err != nil { + return utils.GenerateSetError(resourceName, "name", err) } - if autoCertificate.Properties.SubjectAlternativeNames != nil { - subjectAlternativeNames := []string{} - subjectAlternativeNames = append(subjectAlternativeNames, *autoCertificate.Properties.SubjectAlternativeNames...) - if err := d.Set("subject_alternative_names", subjectAlternativeNames); err != nil { - return utils.GenerateSetError(resourceName, "subject_alternative_names", err) - } + subjectAlternativeNames := []string{} + subjectAlternativeNames = append(subjectAlternativeNames, autoCertificate.Properties.SubjectAlternativeNames...) + if err := d.Set("subject_alternative_names", subjectAlternativeNames); err != nil { + return utils.GenerateSetError(resourceName, "subject_alternative_names", err) } return nil } diff --git a/services/cert/certificate.go b/services/cert/certificate.go index 338d4c76e..8eb9910ef 100644 --- a/services/cert/certificate.go +++ b/services/cert/certificate.go @@ -8,39 +8,40 @@ import ( "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - certmanager "github.com/ionos-cloud/sdk-go-cert-manager" + certmanager "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" + "github.com/ionos-cloud/sdk-go-bundle/shared" ) //nolint:golint -func (c *Client) GetCertificate(ctx context.Context, certId string) (certmanager.CertificateRead, *certmanager.APIResponse, error) { +func (c *Client) GetCertificate(ctx context.Context, certId string) (certmanager.CertificateRead, *shared.APIResponse, error) { cert, apiResponse, err := c.sdkClient.CertificateApi.CertificatesFindById(ctx, certId).Execute() apiResponse.LogInfo() return cert, apiResponse, err } //nolint:golint -func (c *Client) ListCertificates(ctx context.Context) (certmanager.CertificateReadList, *certmanager.APIResponse, error) { +func (c *Client) ListCertificates(ctx context.Context) (certmanager.CertificateReadList, *shared.APIResponse, error) { certs, apiResponse, err := c.sdkClient.CertificateApi.CertificatesGet(ctx).Execute() apiResponse.LogInfo() return certs, apiResponse, err } //nolint:golint -func (c *Client) CreateCertificate(ctx context.Context, certPostDto certmanager.CertificateCreate) (certmanager.CertificateRead, *certmanager.APIResponse, error) { +func (c *Client) CreateCertificate(ctx context.Context, certPostDto certmanager.CertificateCreate) (certmanager.CertificateRead, *shared.APIResponse, error) { certResponse, apiResponse, err := c.sdkClient.CertificateApi.CertificatesPost(ctx).CertificateCreate(certPostDto).Execute() apiResponse.LogInfo() return certResponse, apiResponse, err } //nolint:golint -func (c *Client) UpdateCertificate(ctx context.Context, certId string, certPatch certmanager.CertificatePatch) (certmanager.CertificateRead, *certmanager.APIResponse, error) { +func (c *Client) UpdateCertificate(ctx context.Context, certId string, certPatch certmanager.CertificatePatch) (certmanager.CertificateRead, *shared.APIResponse, error) { certResponse, apiResponse, err := c.sdkClient.CertificateApi.CertificatesPatch(ctx, certId).CertificatePatch(certPatch).Execute() apiResponse.LogInfo() return certResponse, apiResponse, err } //nolint:golint -func (c *Client) DeleteCertificate(ctx context.Context, certId string) (*certmanager.APIResponse, error) { +func (c *Client) DeleteCertificate(ctx context.Context, certId string) (*shared.APIResponse, error) { apiResponse, err := c.sdkClient.CertificateApi.CertificatesDelete(ctx, certId).Execute() apiResponse.LogInfo() return apiResponse, err @@ -52,10 +53,7 @@ func (c *Client) IsCertReady(ctx context.Context, d *schema.ResourceData) (bool, if err != nil { return true, fmt.Errorf("error checking certificate status: %w", err) } - if cert.Metadata == nil || cert.Metadata.State == nil { - return false, fmt.Errorf("cert metadata or state is empty for id %s", d.Id()) - } - return strings.EqualFold(*cert.Metadata.State, constant.Available), nil + return strings.EqualFold(cert.Metadata.State, constant.Available), nil } //nolint:golint @@ -72,29 +70,19 @@ func (c *Client) IsCertDeleted(ctx context.Context, d *schema.ResourceData) (boo //nolint:golint func SetCertificateData(d *schema.ResourceData, cert *certmanager.CertificateRead) error { - if cert.Id != nil { - d.SetId(*cert.Id) - } + d.SetId(cert.Id) - if cert.Properties != nil { - if cert.Properties.Name != nil { - err := d.Set("name", *cert.Properties.Name) - if err != nil { - return fmt.Errorf("error while setting name property for certificate %s: %w", d.Id(), err) - } - } - if cert.Properties.Certificate != nil { - err := d.Set("certificate", *cert.Properties.Certificate) - if err != nil { - return fmt.Errorf("error while setting certificate property for certificate %s: %w", d.Id(), err) - } - } - if cert.Properties.CertificateChain != nil { - err := d.Set("certificate_chain", *cert.Properties.CertificateChain) - if err != nil { - return fmt.Errorf("error while setting certificate_chain property for certificate %s: %w", d.Id(), err) - } - } + err := d.Set("name", cert.Properties.Name) + if err != nil { + return fmt.Errorf("error while setting name property for certificate %s: %w", d.Id(), err) + } + err = d.Set("certificate", cert.Properties.Certificate) + if err != nil { + return fmt.Errorf("error while setting certificate property for certificate %s: %w", d.Id(), err) + } + err = d.Set("certificate_chain", cert.Properties.CertificateChain) + if err != nil { + return fmt.Errorf("error while setting certificate_chain property for certificate %s: %w", d.Id(), err) } return nil } @@ -103,33 +91,33 @@ func SetCertificateData(d *schema.ResourceData, cert *certmanager.CertificateRea func GetCertPostDto(d *schema.ResourceData) (*certmanager.CertificateCreate, error) { certificatePostDto := certmanager.CertificateCreate{ - Properties: &certmanager.Certificate{}, + Properties: certmanager.Certificate{}, } if name, nameOk := d.GetOk("name"); nameOk { name := name.(string) - certificatePostDto.Properties.Name = &name + certificatePostDto.Properties.Name = name } else { return nil, fmt.Errorf("name must be provided for the certificate") } if certField, certOk := d.GetOk("certificate"); certOk { certificate := certField.(string) - certificatePostDto.Properties.Certificate = &certificate + certificatePostDto.Properties.Certificate = certificate } else { return nil, fmt.Errorf("certificate(body) must be provided for the certificate") } if certificateChain, ok := d.GetOk("certificate_chain"); ok { certChain := certificateChain.(string) - certificatePostDto.Properties.CertificateChain = &certChain + certificatePostDto.Properties.CertificateChain = certChain } else { return nil, fmt.Errorf("certificate_chain must be provided for the certificate") } if privateKey, ok := d.GetOk("private_key"); ok { keyStr := privateKey.(string) - certificatePostDto.Properties.PrivateKey = &keyStr + certificatePostDto.Properties.PrivateKey = keyStr } else { return nil, fmt.Errorf("private_key must be provided for the certificate") } @@ -140,13 +128,13 @@ func GetCertPostDto(d *schema.ResourceData) (*certmanager.CertificateCreate, err //nolint:golint func GetCertPatchDto(d *schema.ResourceData) *certmanager.CertificatePatch { certificatePatchDto := certmanager.CertificatePatch{ - Properties: &certmanager.PatchName{}, + Properties: certmanager.PatchName{}, } if d.HasChange("name") { _, v := d.GetChange("name") vStr := v.(string) - certificatePatchDto.Properties.Name = &vStr + certificatePatchDto.Properties.Name = vStr } return &certificatePatchDto diff --git a/services/cert/client.go b/services/cert/client.go index aaf63079e..3c5f79f08 100644 --- a/services/cert/client.go +++ b/services/cert/client.go @@ -3,36 +3,33 @@ package cert import ( "fmt" "net/http" - "os" "runtime" + "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils" + "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" "github.com/hashicorp/terraform-plugin-sdk/v2/meta" - certmanager "github.com/ionos-cloud/sdk-go-cert-manager" - - "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils" + certmanager "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" + "github.com/ionos-cloud/sdk-go-bundle/shared" ) type Client struct { - sdkClient *certmanager.APIClient + sdkClient certmanager.APIClient } func NewClient(username, password, token, url, version, terraformVersion string, insecure bool) *Client { - certConfig := certmanager.NewConfiguration(username, password, token, url) + certConfig := shared.NewConfiguration(username, password, token, url) - if os.Getenv(constant.IonosDebug) != "" { - certConfig.Debug = true - } certConfig.MaxRetries = constant.MaxRetries certConfig.MaxWaitTime = constant.MaxWaitTime - - certConfig.HTTPClient = &http.Client{Transport: utils.CreateTransport(insecure)} certConfig.UserAgent = fmt.Sprintf( "terraform-provider/%s_ionos-cloud-sdk-go-cert-manager/%s_hashicorp-terraform/%s_terraform-plugin-sdk/%s_os/%s_arch/%s", version, certmanager.Version, terraformVersion, meta.SDKVersionString(), runtime.GOOS, runtime.GOARCH) - - return &Client{ - sdkClient: certmanager.NewAPIClient(certConfig), + certClient := &Client{ + sdkClient: *certmanager.NewAPIClient(certConfig), } + certClient.sdkClient.GetConfig().HTTPClient = &http.Client{Transport: utils.CreateTransport(insecure)} + + return certClient } diff --git a/services/cert/provider.go b/services/cert/provider.go index 10bcbb781..7d30aacf7 100644 --- a/services/cert/provider.go +++ b/services/cert/provider.go @@ -7,7 +7,8 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - certmanager "github.com/ionos-cloud/sdk-go-cert-manager" + certmanager "github.com/ionos-cloud/sdk-go-bundle/products/cert/v2" + "github.com/ionos-cloud/sdk-go-bundle/shared" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/utils/constant" @@ -24,14 +25,14 @@ var ionosAPIURLCert = "IONOS_API_URL_CERT" func (c *Client) modifyConfigURL(location string) { clientConfig := c.sdkClient.GetConfig() if location == "" && os.Getenv(ionosAPIURLCert) != "" { - clientConfig.Servers = certmanager.ServerConfigurations{ + clientConfig.Servers = shared.ServerConfigurations{ { URL: utils.CleanURL(os.Getenv(ionosAPIURLCert)), }, } return } - clientConfig.Servers = certmanager.ServerConfigurations{ + clientConfig.Servers = shared.ServerConfigurations{ { URL: locationToURL[location], }, @@ -39,7 +40,7 @@ func (c *Client) modifyConfigURL(location string) { } //nolint:golint -func (c *Client) GetProvider(ctx context.Context, providerID, location string) (certmanager.ProviderRead, *certmanager.APIResponse, error) { +func (c *Client) GetProvider(ctx context.Context, providerID, location string) (certmanager.ProviderRead, *shared.APIResponse, error) { c.modifyConfigURL(location) provider, apiResponse, err := c.sdkClient.ProviderApi.ProvidersFindById(ctx, providerID).Execute() apiResponse.LogInfo() @@ -47,7 +48,7 @@ func (c *Client) GetProvider(ctx context.Context, providerID, location string) ( } //nolint:golint -func (c *Client) ListProviders(ctx context.Context, location string) (certmanager.ProviderReadList, *certmanager.APIResponse, error) { +func (c *Client) ListProviders(ctx context.Context, location string) (certmanager.ProviderReadList, *shared.APIResponse, error) { c.modifyConfigURL(location) providers, apiResponse, err := c.sdkClient.ProviderApi.ProvidersGet(ctx).Execute() apiResponse.LogInfo() @@ -55,7 +56,7 @@ func (c *Client) ListProviders(ctx context.Context, location string) (certmanage } //nolint:golint -func (c *Client) CreateProvider(ctx context.Context, providerPostData certmanager.ProviderCreate, location string) (certmanager.ProviderRead, *certmanager.APIResponse, error) { +func (c *Client) CreateProvider(ctx context.Context, providerPostData certmanager.ProviderCreate, location string) (certmanager.ProviderRead, *shared.APIResponse, error) { c.modifyConfigURL(location) provider, apiResponse, err := c.sdkClient.ProviderApi.ProvidersPost(ctx).ProviderCreate(providerPostData).Execute() apiResponse.LogInfo() @@ -63,7 +64,7 @@ func (c *Client) CreateProvider(ctx context.Context, providerPostData certmanage } //nolint:golint -func (c *Client) UpdateProvider(ctx context.Context, providerID, location string, providerPatchData certmanager.ProviderPatch) (certmanager.ProviderRead, *certmanager.APIResponse, error) { +func (c *Client) UpdateProvider(ctx context.Context, providerID, location string, providerPatchData certmanager.ProviderPatch) (certmanager.ProviderRead, *shared.APIResponse, error) { c.modifyConfigURL(location) provider, apiResponse, err := c.sdkClient.ProviderApi.ProvidersPatch(ctx, providerID).ProviderPatch(providerPatchData).Execute() apiResponse.LogInfo() @@ -71,7 +72,7 @@ func (c *Client) UpdateProvider(ctx context.Context, providerID, location string } //nolint:golint -func (c *Client) DeleteProvider(ctx context.Context, providerID, location string) (*certmanager.APIResponse, error) { +func (c *Client) DeleteProvider(ctx context.Context, providerID, location string) (*shared.APIResponse, error) { c.modifyConfigURL(location) apiResponse, err := c.sdkClient.ProviderApi.ProvidersDelete(ctx, providerID).Execute() apiResponse.LogInfo() @@ -86,13 +87,10 @@ func (c *Client) IsProviderReady(ctx context.Context, d *schema.ResourceData) (b if err != nil { return false, fmt.Errorf("error checking certificate manager provider status: %w", err) } - if provider.Metadata == nil || provider.Metadata.State == nil { - return false, fmt.Errorf("metadata or state is empty for certificate manager provider with ID: %v", d.Id()) + if utils.IsStateFailed(provider.Metadata.State) { + return false, fmt.Errorf("error while checking if auto-certificate provider is ready, provider ID: %v, state: %v", provider.Id, provider.Metadata.State) } - if utils.IsStateFailed(*provider.Metadata.State) { - return false, fmt.Errorf("error while checking if auto-certificate provider is ready, provider ID: %v, state: %v", *provider.Id, *provider.Metadata.State) - } - return strings.EqualFold(*provider.Metadata.State, constant.Available), nil + return strings.EqualFold(provider.Metadata.State, constant.Available), nil } //nolint:golint @@ -106,8 +104,8 @@ func (c *Client) IsProviderDeleted(ctx context.Context, d *schema.ResourceData) } return false, fmt.Errorf("error while checking deletion status for certificate manager provider with ID: %v, error: %w", d.Id(), err) } - if provider.Metadata != nil && provider.Metadata.State != nil && utils.IsStateFailed(*provider.Metadata.State) { - return false, fmt.Errorf("error while checking if auto-certificate provider is deleted properly, provider ID: %v, state: %v", *provider.Id, *provider.Metadata.State) + if utils.IsStateFailed(provider.Metadata.State) { + return false, fmt.Errorf("error while checking if auto-certificate provider is deleted properly, provider ID: %v, state: %v", provider.Id, provider.Metadata.State) } return false, nil } @@ -115,15 +113,15 @@ func (c *Client) IsProviderDeleted(ctx context.Context, d *schema.ResourceData) //nolint:golint func GetProviderDataCreate(d *schema.ResourceData) *certmanager.ProviderCreate { provider := certmanager.ProviderCreate{ - Properties: &certmanager.Provider{}, + Properties: certmanager.Provider{}, } name := d.Get("name").(string) - provider.Properties.Name = &name + provider.Properties.Name = name email := d.Get("email").(string) - provider.Properties.Email = &email + provider.Properties.Email = email server := d.Get("server").(string) - provider.Properties.Server = &server + provider.Properties.Server = server if _, ok := d.GetOk("external_account_binding"); ok { keyId := d.Get("external_account_binding.0.key_id").(string) keySecret := d.Get("external_account_binding.0.key_secret").(string) @@ -138,26 +136,17 @@ func GetProviderDataCreate(d *schema.ResourceData) *certmanager.ProviderCreate { //nolint:golint func SetProviderData(d *schema.ResourceData, provider certmanager.ProviderRead) error { resourceName := "Auto-certificate provider" - if provider.Id != nil { - d.SetId(*provider.Id) - } - if provider.Properties == nil { - return fmt.Errorf("response properties should not be empty for auto-certificate provider with ID: %v", *provider.Id) - } - if provider.Properties.Name != nil { - if err := d.Set("name", *provider.Properties.Name); err != nil { - return utils.GenerateSetError(resourceName, "name", err) - } + d.SetId(provider.Id) + + if err := d.Set("name", provider.Properties.Name); err != nil { + return utils.GenerateSetError(resourceName, "name", err) } - if provider.Properties.Email != nil { - if err := d.Set("email", *provider.Properties.Email); err != nil { - return utils.GenerateSetError(resourceName, "email", err) - } + + if err := d.Set("email", provider.Properties.Email); err != nil { + return utils.GenerateSetError(resourceName, "email", err) } - if provider.Properties.Server != nil { - if err := d.Set("server", *provider.Properties.Server); err != nil { - return utils.GenerateSetError(resourceName, "server", err) - } + if err := d.Set("server", provider.Properties.Server); err != nil { + return utils.GenerateSetError(resourceName, "server", err) } return nil } @@ -165,13 +154,13 @@ func SetProviderData(d *schema.ResourceData, provider certmanager.ProviderRead) //nolint:golint func GetProviderDataUpdate(d *schema.ResourceData) *certmanager.ProviderPatch { provider := certmanager.ProviderPatch{ - Properties: &certmanager.PatchName{}, + Properties: certmanager.PatchName{}, } if d.HasChange("name") { _, newValue := d.GetChange("name") newValueStr := newValue.(string) - provider.Properties.Name = &newValueStr + provider.Properties.Name = newValueStr } return &provider } diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitignore b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/.gitignore similarity index 100% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitignore rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/.gitignore diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/.travis.yml b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/.travis.yml similarity index 100% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/.travis.yml rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/.travis.yml diff --git a/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/LICENSE b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/README.md b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/README.md new file mode 100644 index 000000000..20807a910 --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/README.md @@ -0,0 +1,274 @@ +# Go API client for cert + +Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates +with IONOS services and your internal connected resources. + +For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), +you usually need a certificate to encrypt your HTTPS traffic. +The service provides the basic functions of uploading and deleting your certificates for this purpose. + +## Overview +The IONOS Cloud SDK for GO provides you with access to the IONOS Cloud API. The client library supports both simple and complex requests. +It is designed for developers who are building applications in GO . The SDK for GO wraps the IONOS Cloud API. All API operations are performed over SSL and authenticated using your IONOS Cloud portal credentials. +The API can be accessed within an instance running in IONOS Cloud or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response. + +## Installing + +### Use go get to retrieve the SDK to add it to your GOPATH workspace, or project's Go module dependencies. +```bash +go get github.com/ionos-cloud/sdk-go-bundle/products/cert.git +``` +To update the SDK use go get -u to retrieve the latest version of the SDK. +```bash +go get -u github.com/ionos-cloud/sdk-go-bundle/products/cert.git +``` +### Go Modules + +If you are using Go modules, your go get will default to the latest tagged release version of the SDK. To get a specific release version of the SDK use @ in your go get command. + +To get the latest SDK repository, use @latest. +```bash +go get github.com/ionos-cloud/sdk-go-bundle/products/cert@latest +``` + +## Environment Variables + +| Environment Variable | Description | +|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `IONOS_USERNAME` | Specify the username used to login, to authenticate against the IONOS Cloud API | +| `IONOS_PASSWORD` | Specify the password used to login, to authenticate against the IONOS Cloud API | +| `IONOS_TOKEN` | Specify the token used to login, if a token is being used instead of username and password | +| `IONOS_API_URL` | Specify the API URL. It will overwrite the API endpoint default value `api.ionos.com`. Note: the host URL does not contain the `/cloudapi/v6` path, so it should _not_ be included in the `IONOS_API_URL` environment variable | +| `IONOS_LOG_LEVEL` | Specify the Log Level used to log messages. Possible values: Off, Debug, Trace | +| `IONOS_PINNED_CERT` | Specify the SHA-256 public fingerprint here, enables certificate pinning | + +⚠️ **_Note: To overwrite the api endpoint - `api.ionos.com`, the environment variable `IONOS_API_URL` can be set, and used with `NewConfigurationFromEnv()` function._** + +## Examples + +Examples for creating resources using the Go SDK can be found [here](examples/) + +## Authentication + +All available server URLs are: + +- *https://certificate-manager.de-fra.ionos.com* - Frankfurt + +By default, *https://certificate-manager.de-fra.ionos.com* is used, however this can be overriden at authentication, either +by setting the `IONOS_API_URL` environment variable or by specifying the `hostUrl` parameter when +initializing the sdk client. + +### Basic Authentication + +- **Type**: HTTP basic authentication + +Example + +```golang +import ( + "context" + "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" + cert "github.com/ionos-cloud/sdk-go-bundle/products/cert" + "log" +) + +func basicAuthExample() error { + cfg := shared.NewConfiguration("username_here", "pwd_here", "", "hostUrl_here") + cfg.LogLevel = Trace + apiClient := cert.NewAPIClient(cfg) + return nil +} +``` +### Token Authentication +There are 2 ways to generate your token: + + ### Generate token using sdk for [auth](https://github.com/ionos-cloud/products/auth): +```golang + import ( + "context" + "fmt" + "github.com/ionos-cloud/sdk-go-bundle/products/auth" + "github.com/ionos-cloud/sdk-go-bundle/shared" + cert "github.com/ionos-cloud/sdk-go-bundle/products/cert" + "log" + ) + + func TokenAuthExample() error { + //note: to use NewConfigurationFromEnv(), you need to previously set IONOS_USERNAME and IONOS_PASSWORD as env variables + authClient := auth.NewAPIClient(authApi.NewConfigurationFromEnv()) + jwt, _, err := auth.TokensApi.TokensGenerate(context.Background()).Execute() + if err != nil { + return fmt.Errorf("error occurred while generating token (%w)", err) + } + if !jwt.HasToken() { + return fmt.Errorf("could not generate token") + } + cfg := shared.NewConfiguration("", "", *jwt.GetToken(), "hostUrl_here") + cfg.LogLevel = Trace + apiClient := cert.NewAPIClient(cfg) + return nil + } +``` + ### Generate token using ionosctl: + Install ionosctl as explained [here](https://github.com/ionos-cloud/ionosctl) + Run commands to login and generate your token. +```golang + ionosctl login + ionosctl token generate + export IONOS_TOKEN="insert_here_token_saved_from_generate_command" +``` + Save the generated token and use it to authenticate: +```golang + import ( + "context" + "fmt" + "github.com/ionos-cloud/sdk-go-bundle/products/auth" + cert "github.com/ionos-cloud/sdk-go-bundle/products/cert" + "log" + ) + + func TokenAuthExample() error { + //note: to use NewConfigurationFromEnv(), you need to previously set IONOS_TOKEN as env variables + authClient := auth.NewAPIClient(authApi.NewConfigurationFromEnv()) + cfg.LogLevel = Trace + apiClient := cert.NewAPIClient(cfg) + return nil + } +``` + +## Certificate pinning: + +You can enable certificate pinning if you want to bypass the normal certificate checking procedure, +by doing the following: + +Set env variable IONOS_PINNED_CERT= + +You can get the sha256 fingerprint most easily from the browser by inspecting the certificate. + +### Depth + +Many of the _List_ or _Get_ operations will accept an optional _depth_ argument. Setting this to a value between 0 and 5 affects the amount of data that is returned. The details returned vary depending on the resource being queried, but it generally follows this pattern. By default, the SDK sets the _depth_ argument to the maximum value. + +| Depth | Description | +| :--- | :--- | +| 0 | Only direct properties are included. Children are not included. | +| 1 | Direct properties and children's references are returned. | +| 2 | Direct properties and children's properties are returned. | +| 3 | Direct properties, children's properties, and descendants' references are returned. | +| 4 | Direct properties, children's properties, and descendants' properties are returned. | +| 5 | Returns all available properties. | + +### Changing the base URL + +Base URL for the HTTP operation can be changed by using the following function: + +```go +requestProperties.SetURL("https://api.ionos.com/cloudapi/v6") +``` + +## Debugging + +You can inject any logger that implements Printf as a logger +instead of using the default sdk logger. +There are log levels that you can set: `Off`, `Debug` and `Trace`. +`Off` - does not show any logs +`Debug` - regular logs, no sensitive information +`Trace` - we recommend you only set this field for debugging purposes. Disable it in your production environments because it can log sensitive data. + It logs the full request and response without encryption, even for an HTTPS call. Verbose request and response logging can also significantly impact your application's performance. + + +```golang +package main + + import ( + cert "github.com/ionos-cloud/sdk-go-bundle/products/cert" + "github.com/ionos-cloud/sdk-go-bundle/shared" + "github.com/sirupsen/logrus" + ) + +func main() { + // create your configuration. replace username, password, token and url with correct values, or use NewConfigurationFromEnv() + // if you have set your env variables as explained above + cfg := shared.NewConfiguration("username", "password", "token", "hostUrl") + // enable request and response logging. this is the most verbose loglevel + shared.SdkLogLevel = Trace + // inject your own logger that implements Printf + shared.SdkLogger = logrus.New() + // create you api client with the configuration + apiClient := cert.NewAPIClient(cfg) +} +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://certificate-manager.de-fra.ionos.com* +
+API Endpoints table + + +Class | Method | HTTP request | Description +------------- | ------------- | ------------- | ------------- +AutoCertificateApi | [**AutoCertificatesDelete**](docs/api/AutoCertificateApi.md#autocertificatesdelete) | **Delete** /auto-certificates/{autoCertificateId} | Delete AutoCertificate +AutoCertificateApi | [**AutoCertificatesFindById**](docs/api/AutoCertificateApi.md#autocertificatesfindbyid) | **Get** /auto-certificates/{autoCertificateId} | Retrieve AutoCertificate +AutoCertificateApi | [**AutoCertificatesGet**](docs/api/AutoCertificateApi.md#autocertificatesget) | **Get** /auto-certificates | Retrieve all AutoCertificate +AutoCertificateApi | [**AutoCertificatesPatch**](docs/api/AutoCertificateApi.md#autocertificatespatch) | **Patch** /auto-certificates/{autoCertificateId} | Updates AutoCertificate +AutoCertificateApi | [**AutoCertificatesPost**](docs/api/AutoCertificateApi.md#autocertificatespost) | **Post** /auto-certificates | Create AutoCertificate +CertificateApi | [**CertificatesDelete**](docs/api/CertificateApi.md#certificatesdelete) | **Delete** /certificates/{certificateId} | Delete Certificate +CertificateApi | [**CertificatesFindById**](docs/api/CertificateApi.md#certificatesfindbyid) | **Get** /certificates/{certificateId} | Retrieve Certificate +CertificateApi | [**CertificatesGet**](docs/api/CertificateApi.md#certificatesget) | **Get** /certificates | Retrieve all Certificate +CertificateApi | [**CertificatesPatch**](docs/api/CertificateApi.md#certificatespatch) | **Patch** /certificates/{certificateId} | Updates Certificate +CertificateApi | [**CertificatesPost**](docs/api/CertificateApi.md#certificatespost) | **Post** /certificates | Create Certificate +ProviderApi | [**ProvidersDelete**](docs/api/ProviderApi.md#providersdelete) | **Delete** /providers/{providerId} | Delete Provider +ProviderApi | [**ProvidersFindById**](docs/api/ProviderApi.md#providersfindbyid) | **Get** /providers/{providerId} | Retrieve Provider +ProviderApi | [**ProvidersGet**](docs/api/ProviderApi.md#providersget) | **Get** /providers | Retrieve all Provider +ProviderApi | [**ProvidersPatch**](docs/api/ProviderApi.md#providerspatch) | **Patch** /providers/{providerId} | Updates Provider +ProviderApi | [**ProvidersPost**](docs/api/ProviderApi.md#providerspost) | **Post** /providers | Create Provider + +
+ +## Documentation For Models + +All URIs are relative to *https://certificate-manager.de-fra.ionos.com* +
+API models list + + - [AutoCertificate](docs/models/AutoCertificate) + - [AutoCertificateCreate](docs/models/AutoCertificateCreate) + - [AutoCertificatePatch](docs/models/AutoCertificatePatch) + - [AutoCertificateRead](docs/models/AutoCertificateRead) + - [AutoCertificateReadList](docs/models/AutoCertificateReadList) + - [AutoCertificateReadListAllOf](docs/models/AutoCertificateReadListAllOf) + - [Certificate](docs/models/Certificate) + - [CertificateCreate](docs/models/CertificateCreate) + - [CertificatePatch](docs/models/CertificatePatch) + - [CertificateRead](docs/models/CertificateRead) + - [CertificateReadList](docs/models/CertificateReadList) + - [CertificateReadListAllOf](docs/models/CertificateReadListAllOf) + - [Connection](docs/models/Connection) + - [DayOfTheWeek](docs/models/DayOfTheWeek) + - [Error](docs/models/Error) + - [ErrorMessages](docs/models/ErrorMessages) + - [Links](docs/models/Links) + - [MaintenanceWindow](docs/models/MaintenanceWindow) + - [Metadata](docs/models/Metadata) + - [MetadataWithAutoCertificateInformation](docs/models/MetadataWithAutoCertificateInformation) + - [MetadataWithAutoCertificateInformationAllOf](docs/models/MetadataWithAutoCertificateInformationAllOf) + - [MetadataWithCertificateInformation](docs/models/MetadataWithCertificateInformation) + - [MetadataWithCertificateInformationAllOf](docs/models/MetadataWithCertificateInformationAllOf) + - [MetadataWithStatus](docs/models/MetadataWithStatus) + - [MetadataWithStatusAllOf](docs/models/MetadataWithStatusAllOf) + - [Pagination](docs/models/Pagination) + - [PatchName](docs/models/PatchName) + - [Provider](docs/models/Provider) + - [ProviderCreate](docs/models/ProviderCreate) + - [ProviderExternalAccountBinding](docs/models/ProviderExternalAccountBinding) + - [ProviderPatch](docs/models/ProviderPatch) + - [ProviderRead](docs/models/ProviderRead) + - [ProviderReadList](docs/models/ProviderReadList) + - [ProviderReadListAllOf](docs/models/ProviderReadListAllOf) + + +[[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models) + +
diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_auto_certificate.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_auto_certificate.go similarity index 82% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_auto_certificate.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_auto_certificate.go index be6c0aa62..a21af577e 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_auto_certificate.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_auto_certificate.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -33,7 +34,7 @@ type ApiAutoCertificatesDeleteRequest struct { autoCertificateId string } -func (r ApiAutoCertificatesDeleteRequest) Execute() (*APIResponse, error) { +func (r ApiAutoCertificatesDeleteRequest) Execute() (*shared.APIResponse, error) { return r.ApiService.AutoCertificatesDeleteExecute(r) } @@ -55,7 +56,7 @@ func (a *AutoCertificateApiService) AutoCertificatesDelete(ctx _context.Context, /* * Execute executes the request */ -func (a *AutoCertificateApiService) AutoCertificatesDeleteExecute(r ApiAutoCertificatesDeleteRequest) (*APIResponse, error) { +func (a *AutoCertificateApiService) AutoCertificatesDeleteExecute(r ApiAutoCertificatesDeleteRequest) (*shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -66,11 +67,13 @@ func (a *AutoCertificateApiService) AutoCertificatesDeleteExecute(r ApiAutoCerti localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutoCertificateApiService.AutoCertificatesDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return nil, gerr } localVarPath := localBasePath + "/auto-certificates/{autoCertificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterToString(r.autoCertificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterValueToString(r.autoCertificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -100,7 +103,7 @@ func (a *AutoCertificateApiService) AutoCertificatesDeleteExecute(r ApiAutoCerti localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -120,81 +123,80 @@ func (a *AutoCertificateApiService) AutoCertificatesDeleteExecute(r ApiAutoCerti } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarAPIResponse, newErr } @@ -207,7 +209,7 @@ type ApiAutoCertificatesFindByIdRequest struct { autoCertificateId string } -func (r ApiAutoCertificatesFindByIdRequest) Execute() (AutoCertificateRead, *APIResponse, error) { +func (r ApiAutoCertificatesFindByIdRequest) Execute() (AutoCertificateRead, *shared.APIResponse, error) { return r.ApiService.AutoCertificatesFindByIdExecute(r) } @@ -230,7 +232,7 @@ func (a *AutoCertificateApiService) AutoCertificatesFindById(ctx _context.Contex * Execute executes the request * @return AutoCertificateRead */ -func (a *AutoCertificateApiService) AutoCertificatesFindByIdExecute(r ApiAutoCertificatesFindByIdRequest) (AutoCertificateRead, *APIResponse, error) { +func (a *AutoCertificateApiService) AutoCertificatesFindByIdExecute(r ApiAutoCertificatesFindByIdRequest) (AutoCertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -242,11 +244,13 @@ func (a *AutoCertificateApiService) AutoCertificatesFindByIdExecute(r ApiAutoCer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutoCertificateApiService.AutoCertificatesFindById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/auto-certificates/{autoCertificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterToString(r.autoCertificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterValueToString(r.autoCertificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -276,7 +280,7 @@ func (a *AutoCertificateApiService) AutoCertificatesFindByIdExecute(r ApiAutoCer localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -296,91 +300,89 @@ func (a *AutoCertificateApiService) AutoCertificatesFindByIdExecute(r ApiAutoCer } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -408,7 +410,7 @@ func (r ApiAutoCertificatesGetRequest) FilterCommonName(filterCommonName string) return r } -func (r ApiAutoCertificatesGetRequest) Execute() (AutoCertificateReadList, *APIResponse, error) { +func (r ApiAutoCertificatesGetRequest) Execute() (AutoCertificateReadList, *shared.APIResponse, error) { return r.ApiService.AutoCertificatesGetExecute(r) } @@ -432,7 +434,7 @@ func (a *AutoCertificateApiService) AutoCertificatesGet(ctx _context.Context) Ap * Execute executes the request * @return AutoCertificateReadList */ -func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertificatesGetRequest) (AutoCertificateReadList, *APIResponse, error) { +func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertificatesGetRequest) (AutoCertificateReadList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -444,7 +446,9 @@ func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertific localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutoCertificateApiService.AutoCertificatesGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/auto-certificates" @@ -454,13 +458,13 @@ func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertific localVarFormParams := _neturl.Values{} if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.filterCommonName != nil { - localVarQueryParams.Add("filter.commonName", parameterToString(*r.filterCommonName, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "filter.commonName", r.filterCommonName, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -486,7 +490,7 @@ func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertific localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -506,82 +510,80 @@ func (a *AutoCertificateApiService) AutoCertificatesGetExecute(r ApiAutoCertific } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -600,7 +602,7 @@ func (r ApiAutoCertificatesPatchRequest) AutoCertificatePatch(autoCertificatePat return r } -func (r ApiAutoCertificatesPatchRequest) Execute() (AutoCertificateRead, *APIResponse, error) { +func (r ApiAutoCertificatesPatchRequest) Execute() (AutoCertificateRead, *shared.APIResponse, error) { return r.ApiService.AutoCertificatesPatchExecute(r) } @@ -626,7 +628,7 @@ func (a *AutoCertificateApiService) AutoCertificatesPatch(ctx _context.Context, * Execute executes the request * @return AutoCertificateRead */ -func (a *AutoCertificateApiService) AutoCertificatesPatchExecute(r ApiAutoCertificatesPatchRequest) (AutoCertificateRead, *APIResponse, error) { +func (a *AutoCertificateApiService) AutoCertificatesPatchExecute(r ApiAutoCertificatesPatchRequest) (AutoCertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -638,11 +640,13 @@ func (a *AutoCertificateApiService) AutoCertificatesPatchExecute(r ApiAutoCertif localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutoCertificateApiService.AutoCertificatesPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/auto-certificates/{autoCertificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterToString(r.autoCertificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"autoCertificateId"+"}", _neturl.PathEscape(parameterValueToString(r.autoCertificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -677,7 +681,7 @@ func (a *AutoCertificateApiService) AutoCertificatesPatchExecute(r ApiAutoCertif localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -697,118 +701,116 @@ func (a *AutoCertificateApiService) AutoCertificatesPatchExecute(r ApiAutoCertif } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -826,7 +828,7 @@ func (r ApiAutoCertificatesPostRequest) AutoCertificateCreate(autoCertificateCre return r } -func (r ApiAutoCertificatesPostRequest) Execute() (AutoCertificateRead, *APIResponse, error) { +func (r ApiAutoCertificatesPostRequest) Execute() (AutoCertificateRead, *shared.APIResponse, error) { return r.ApiService.AutoCertificatesPostExecute(r) } @@ -851,7 +853,7 @@ func (a *AutoCertificateApiService) AutoCertificatesPost(ctx _context.Context) A * Execute executes the request * @return AutoCertificateRead */ -func (a *AutoCertificateApiService) AutoCertificatesPostExecute(r ApiAutoCertificatesPostRequest) (AutoCertificateRead, *APIResponse, error) { +func (a *AutoCertificateApiService) AutoCertificatesPostExecute(r ApiAutoCertificatesPostRequest) (AutoCertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -863,7 +865,9 @@ func (a *AutoCertificateApiService) AutoCertificatesPostExecute(r ApiAutoCertifi localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutoCertificateApiService.AutoCertificatesPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/auto-certificates" @@ -901,7 +905,7 @@ func (a *AutoCertificateApiService) AutoCertificatesPostExecute(r ApiAutoCertifi localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -921,100 +925,98 @@ func (a *AutoCertificateApiService) AutoCertificatesPostExecute(r ApiAutoCertifi } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_certificate.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_certificate.go similarity index 82% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_certificate.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_certificate.go index a78444e79..6838095a8 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_certificate.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_certificate.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -33,7 +34,7 @@ type ApiCertificatesDeleteRequest struct { certificateId string } -func (r ApiCertificatesDeleteRequest) Execute() (*APIResponse, error) { +func (r ApiCertificatesDeleteRequest) Execute() (*shared.APIResponse, error) { return r.ApiService.CertificatesDeleteExecute(r) } @@ -55,7 +56,7 @@ func (a *CertificateApiService) CertificatesDelete(ctx _context.Context, certifi /* * Execute executes the request */ -func (a *CertificateApiService) CertificatesDeleteExecute(r ApiCertificatesDeleteRequest) (*APIResponse, error) { +func (a *CertificateApiService) CertificatesDeleteExecute(r ApiCertificatesDeleteRequest) (*shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -66,11 +67,13 @@ func (a *CertificateApiService) CertificatesDeleteExecute(r ApiCertificatesDelet localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CertificateApiService.CertificatesDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return nil, gerr } localVarPath := localBasePath + "/certificates/{certificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterToString(r.certificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterValueToString(r.certificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -100,7 +103,7 @@ func (a *CertificateApiService) CertificatesDeleteExecute(r ApiCertificatesDelet localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -120,81 +123,80 @@ func (a *CertificateApiService) CertificatesDeleteExecute(r ApiCertificatesDelet } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarAPIResponse, newErr } @@ -207,7 +209,7 @@ type ApiCertificatesFindByIdRequest struct { certificateId string } -func (r ApiCertificatesFindByIdRequest) Execute() (CertificateRead, *APIResponse, error) { +func (r ApiCertificatesFindByIdRequest) Execute() (CertificateRead, *shared.APIResponse, error) { return r.ApiService.CertificatesFindByIdExecute(r) } @@ -230,7 +232,7 @@ func (a *CertificateApiService) CertificatesFindById(ctx _context.Context, certi * Execute executes the request * @return CertificateRead */ -func (a *CertificateApiService) CertificatesFindByIdExecute(r ApiCertificatesFindByIdRequest) (CertificateRead, *APIResponse, error) { +func (a *CertificateApiService) CertificatesFindByIdExecute(r ApiCertificatesFindByIdRequest) (CertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -242,11 +244,13 @@ func (a *CertificateApiService) CertificatesFindByIdExecute(r ApiCertificatesFin localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CertificateApiService.CertificatesFindById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/certificates/{certificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterToString(r.certificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterValueToString(r.certificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -276,7 +280,7 @@ func (a *CertificateApiService) CertificatesFindByIdExecute(r ApiCertificatesFin localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -296,91 +300,89 @@ func (a *CertificateApiService) CertificatesFindByIdExecute(r ApiCertificatesFin } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -413,7 +415,7 @@ func (r ApiCertificatesGetRequest) FilterAutoCertificate(filterAutoCertificate s return r } -func (r ApiCertificatesGetRequest) Execute() (CertificateReadList, *APIResponse, error) { +func (r ApiCertificatesGetRequest) Execute() (CertificateReadList, *shared.APIResponse, error) { return r.ApiService.CertificatesGetExecute(r) } @@ -437,7 +439,7 @@ func (a *CertificateApiService) CertificatesGet(ctx _context.Context) ApiCertifi * Execute executes the request * @return CertificateReadList */ -func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetRequest) (CertificateReadList, *APIResponse, error) { +func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetRequest) (CertificateReadList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -449,7 +451,9 @@ func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetReque localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CertificateApiService.CertificatesGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/certificates" @@ -459,16 +463,16 @@ func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetReque localVarFormParams := _neturl.Values{} if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.filterCommonName != nil { - localVarQueryParams.Add("filter.commonName", parameterToString(*r.filterCommonName, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "filter.commonName", r.filterCommonName, "") } if r.filterAutoCertificate != nil { - localVarQueryParams.Add("filter.autoCertificate", parameterToString(*r.filterAutoCertificate, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "filter.autoCertificate", r.filterAutoCertificate, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -494,7 +498,7 @@ func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetReque localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -514,82 +518,80 @@ func (a *CertificateApiService) CertificatesGetExecute(r ApiCertificatesGetReque } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -608,7 +610,7 @@ func (r ApiCertificatesPatchRequest) CertificatePatch(certificatePatch Certifica return r } -func (r ApiCertificatesPatchRequest) Execute() (CertificateRead, *APIResponse, error) { +func (r ApiCertificatesPatchRequest) Execute() (CertificateRead, *shared.APIResponse, error) { return r.ApiService.CertificatesPatchExecute(r) } @@ -634,7 +636,7 @@ func (a *CertificateApiService) CertificatesPatch(ctx _context.Context, certific * Execute executes the request * @return CertificateRead */ -func (a *CertificateApiService) CertificatesPatchExecute(r ApiCertificatesPatchRequest) (CertificateRead, *APIResponse, error) { +func (a *CertificateApiService) CertificatesPatchExecute(r ApiCertificatesPatchRequest) (CertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -646,11 +648,13 @@ func (a *CertificateApiService) CertificatesPatchExecute(r ApiCertificatesPatchR localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CertificateApiService.CertificatesPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/certificates/{certificateId}" - localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterToString(r.certificateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"certificateId"+"}", _neturl.PathEscape(parameterValueToString(r.certificateId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -685,7 +689,7 @@ func (a *CertificateApiService) CertificatesPatchExecute(r ApiCertificatesPatchR localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -705,118 +709,116 @@ func (a *CertificateApiService) CertificatesPatchExecute(r ApiCertificatesPatchR } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -834,7 +836,7 @@ func (r ApiCertificatesPostRequest) CertificateCreate(certificateCreate Certific return r } -func (r ApiCertificatesPostRequest) Execute() (CertificateRead, *APIResponse, error) { +func (r ApiCertificatesPostRequest) Execute() (CertificateRead, *shared.APIResponse, error) { return r.ApiService.CertificatesPostExecute(r) } @@ -859,7 +861,7 @@ func (a *CertificateApiService) CertificatesPost(ctx _context.Context) ApiCertif * Execute executes the request * @return CertificateRead */ -func (a *CertificateApiService) CertificatesPostExecute(r ApiCertificatesPostRequest) (CertificateRead, *APIResponse, error) { +func (a *CertificateApiService) CertificatesPostExecute(r ApiCertificatesPostRequest) (CertificateRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -871,7 +873,9 @@ func (a *CertificateApiService) CertificatesPostExecute(r ApiCertificatesPostReq localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CertificateApiService.CertificatesPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/certificates" @@ -909,7 +913,7 @@ func (a *CertificateApiService) CertificatesPostExecute(r ApiCertificatesPostReq localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -929,100 +933,98 @@ func (a *CertificateApiService) CertificatesPostExecute(r ApiCertificatesPostReq } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_provider.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_provider.go similarity index 82% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_provider.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_provider.go index 59cdc0955..558f3261f 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/api_provider.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/api_provider.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -33,7 +34,7 @@ type ApiProvidersDeleteRequest struct { providerId string } -func (r ApiProvidersDeleteRequest) Execute() (*APIResponse, error) { +func (r ApiProvidersDeleteRequest) Execute() (*shared.APIResponse, error) { return r.ApiService.ProvidersDeleteExecute(r) } @@ -55,7 +56,7 @@ func (a *ProviderApiService) ProvidersDelete(ctx _context.Context, providerId st /* * Execute executes the request */ -func (a *ProviderApiService) ProvidersDeleteExecute(r ApiProvidersDeleteRequest) (*APIResponse, error) { +func (a *ProviderApiService) ProvidersDeleteExecute(r ApiProvidersDeleteRequest) (*shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -66,11 +67,13 @@ func (a *ProviderApiService) ProvidersDeleteExecute(r ApiProvidersDeleteRequest) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.ProvidersDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return nil, gerr } localVarPath := localBasePath + "/providers/{providerId}" - localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterToString(r.providerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterValueToString(r.providerId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -100,7 +103,7 @@ func (a *ProviderApiService) ProvidersDeleteExecute(r ApiProvidersDeleteRequest) localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -120,81 +123,80 @@ func (a *ProviderApiService) ProvidersDeleteExecute(r ApiProvidersDeleteRequest) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarAPIResponse, newErr } @@ -207,7 +209,7 @@ type ApiProvidersFindByIdRequest struct { providerId string } -func (r ApiProvidersFindByIdRequest) Execute() (ProviderRead, *APIResponse, error) { +func (r ApiProvidersFindByIdRequest) Execute() (ProviderRead, *shared.APIResponse, error) { return r.ApiService.ProvidersFindByIdExecute(r) } @@ -230,7 +232,7 @@ func (a *ProviderApiService) ProvidersFindById(ctx _context.Context, providerId * Execute executes the request * @return ProviderRead */ -func (a *ProviderApiService) ProvidersFindByIdExecute(r ApiProvidersFindByIdRequest) (ProviderRead, *APIResponse, error) { +func (a *ProviderApiService) ProvidersFindByIdExecute(r ApiProvidersFindByIdRequest) (ProviderRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -242,11 +244,13 @@ func (a *ProviderApiService) ProvidersFindByIdExecute(r ApiProvidersFindByIdRequ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.ProvidersFindById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/providers/{providerId}" - localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterToString(r.providerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterValueToString(r.providerId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -276,7 +280,7 @@ func (a *ProviderApiService) ProvidersFindByIdExecute(r ApiProvidersFindByIdRequ localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -296,91 +300,89 @@ func (a *ProviderApiService) ProvidersFindByIdExecute(r ApiProvidersFindByIdRequ } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -403,7 +405,7 @@ func (r ApiProvidersGetRequest) Limit(limit int32) ApiProvidersGetRequest { return r } -func (r ApiProvidersGetRequest) Execute() (ProviderReadList, *APIResponse, error) { +func (r ApiProvidersGetRequest) Execute() (ProviderReadList, *shared.APIResponse, error) { return r.ApiService.ProvidersGetExecute(r) } @@ -427,7 +429,7 @@ func (a *ProviderApiService) ProvidersGet(ctx _context.Context) ApiProvidersGetR * Execute executes the request * @return ProviderReadList */ -func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (ProviderReadList, *APIResponse, error) { +func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (ProviderReadList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -439,7 +441,9 @@ func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (Prov localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.ProvidersGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/providers" @@ -449,10 +453,10 @@ func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (Prov localVarFormParams := _neturl.Values{} if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -478,7 +482,7 @@ func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (Prov localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -498,82 +502,80 @@ func (a *ProviderApiService) ProvidersGetExecute(r ApiProvidersGetRequest) (Prov } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -592,7 +594,7 @@ func (r ApiProvidersPatchRequest) ProviderPatch(providerPatch ProviderPatch) Api return r } -func (r ApiProvidersPatchRequest) Execute() (ProviderRead, *APIResponse, error) { +func (r ApiProvidersPatchRequest) Execute() (ProviderRead, *shared.APIResponse, error) { return r.ApiService.ProvidersPatchExecute(r) } @@ -618,7 +620,7 @@ func (a *ProviderApiService) ProvidersPatch(ctx _context.Context, providerId str * Execute executes the request * @return ProviderRead */ -func (a *ProviderApiService) ProvidersPatchExecute(r ApiProvidersPatchRequest) (ProviderRead, *APIResponse, error) { +func (a *ProviderApiService) ProvidersPatchExecute(r ApiProvidersPatchRequest) (ProviderRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -630,11 +632,13 @@ func (a *ProviderApiService) ProvidersPatchExecute(r ApiProvidersPatchRequest) ( localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.ProvidersPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/providers/{providerId}" - localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterToString(r.providerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"providerId"+"}", _neturl.PathEscape(parameterValueToString(r.providerId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -669,7 +673,7 @@ func (a *ProviderApiService) ProvidersPatchExecute(r ApiProvidersPatchRequest) ( localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -689,118 +693,116 @@ func (a *ProviderApiService) ProvidersPatchExecute(r ApiProvidersPatchRequest) ( } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } @@ -818,7 +820,7 @@ func (r ApiProvidersPostRequest) ProviderCreate(providerCreate ProviderCreate) A return r } -func (r ApiProvidersPostRequest) Execute() (ProviderRead, *APIResponse, error) { +func (r ApiProvidersPostRequest) Execute() (ProviderRead, *shared.APIResponse, error) { return r.ApiService.ProvidersPostExecute(r) } @@ -843,7 +845,7 @@ func (a *ProviderApiService) ProvidersPost(ctx _context.Context) ApiProvidersPos * Execute executes the request * @return ProviderRead */ -func (a *ProviderApiService) ProvidersPostExecute(r ApiProvidersPostRequest) (ProviderRead, *APIResponse, error) { +func (a *ProviderApiService) ProvidersPostExecute(r ApiProvidersPostRequest) (ProviderRead, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -855,7 +857,9 @@ func (a *ProviderApiService) ProvidersPostExecute(r ApiProvidersPostRequest) (Pr localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.ProvidersPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/providers" @@ -893,7 +897,7 @@ func (a *ProviderApiService) ProvidersPostExecute(r ApiProvidersPostRequest) (Pr localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -913,100 +917,98 @@ func (a *ProviderApiService) ProvidersPostExecute(r ApiProvidersPostRequest) (Pr } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody))) if localVarHTTPResponse.StatusCode == 400 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 415 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 422 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } if localVarHTTPResponse.StatusCode == 503 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) } var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr.error = err.Error() + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } - newErr.model = v + newErr.SetModel(v) return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ - statusCode: localVarHTTPResponse.StatusCode, - body: localVarBody, - error: err.Error(), - } + newErr := shared.GenericOpenAPIError{} + newErr.SetStatusCode(localVarHTTPResponse.StatusCode) + newErr.SetBody(localVarBody) + newErr.SetError(err.Error()) return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/client.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/client.go similarity index 74% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/client.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/client.go index 95e9a5c43..74d855dbd 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/client.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/client.go @@ -8,7 +8,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "bytes" @@ -22,6 +22,7 @@ import ( "errors" "fmt" "io" + "log" "mime/multipart" "net" "net/http" @@ -34,14 +35,16 @@ import ( "strconv" "strings" "time" - "unicode/utf8" + "github.com/ionos-cloud/sdk-go-bundle/shared" "golang.org/x/oauth2" ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)\/(?:vnd\.[^;]+|problem\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)\/(?:vnd\.[^;]+|problem\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) const ( @@ -50,13 +53,13 @@ const ( RequestStatusFailed = "FAILED" RequestStatusDone = "DONE" - Version = "1.3.0" + Version = "products/cert/v2.1.0" ) // APIClient manages communication with the Certificate Manager Service API API v2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { - cfg *Configuration + cfg *shared.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. // API Services @@ -72,22 +75,63 @@ type service struct { client *APIClient } +func DeepCopy(cfg *shared.Configuration) (*shared.Configuration, error) { + if cfg == nil { + return nil, nil + } + + data, err := json.Marshal(cfg) + if err != nil { + return nil, fmt.Errorf("failed to serialize configuration: %w", err) + } + + clone := &shared.Configuration{} + err = json.Unmarshal(data, clone) + if err != nil { + return nil, fmt.Errorf("failed to deserialize configuration: %w", err) + } + + return clone, nil +} + // 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(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient +func NewAPIClient(cfg *shared.Configuration) *APIClient { + // Attempt to deep copy the input configuration + cfgCopy, err := DeepCopy(cfg) + if err != nil { + log.Printf("Error creating deep copy of configuration: %v", err) + + // shallow copy instead as a fallback + cfgCopy := &shared.Configuration{} + *cfgCopy = *cfg + } + + // Initialize default values in the copied configuration + if cfgCopy.HTTPClient == nil { + cfgCopy.HTTPClient = http.DefaultClient + } + + if len(cfgCopy.Servers) == 0 { + cfgCopy.Servers = shared.ServerConfigurations{ + { + URL: "https://certificate-manager.de-fra.ionos.com", + Description: "Frankfurt", + }, + } } - //enable certificate pinning if the env variable is set - pkFingerprint := os.Getenv(IonosPinnedCertEnvVar) + + // Enable certificate pinning if the environment variable is set + pkFingerprint := os.Getenv(shared.IonosPinnedCertEnvVar) if pkFingerprint != "" { httpTransport := &http.Transport{} AddPinnedCert(httpTransport, pkFingerprint) - cfg.HTTPClient.Transport = httpTransport + cfgCopy.HTTPClient.Transport = httpTransport } + // Create and initialize the API client c := &APIClient{} - c.cfg = cfg + c.cfg = cfgCopy c.common.client = c // API Services @@ -240,6 +284,103 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + 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{}, 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, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), 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) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), 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(), collectionType) + } + return + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), 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 + } +} + // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, time.Duration, error) { retryCount := 0 @@ -261,14 +402,14 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, time.Duratio } } - if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Trace) { + if shared.SdkLogLevel.Satisfies(shared.Trace) { dump, err := httputil.DumpRequestOut(clonedRequest, true) if err == nil { - c.cfg.Logger.Printf(" DumpRequestOut : %s\n", string(dump)) + shared.SdkLogger.Printf(" DumpRequestOut : %s\n", string(dump)) } else { - c.cfg.Logger.Printf(" DumpRequestOut err: %+v", err) + shared.SdkLogger.Printf(" DumpRequestOut err: %+v", err) } - c.cfg.Logger.Printf("\n try no: %d\n", retryCount) + shared.SdkLogger.Printf("\n try no: %d\n", retryCount) } httpRequestStartTime := time.Now() @@ -279,12 +420,12 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, time.Duratio return resp, httpRequestTime, err } - if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Trace) { + if shared.SdkLogLevel.Satisfies(shared.Trace) { dump, err := httputil.DumpResponse(resp, true) if err == nil { - c.cfg.Logger.Printf("\n DumpResponse : %s\n", string(dump)) + shared.SdkLogger.Printf("\n DumpResponse : %s\n", string(dump)) } else { - c.cfg.Logger.Printf(" DumpResponse err %+v", err) + shared.SdkLogger.Printf(" DumpResponse err %+v", err) } } @@ -315,8 +456,8 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, time.Duratio } if retryCount >= c.GetConfig().MaxRetries { - if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Debug) { - c.cfg.Logger.Printf(" Number of maximum retries exceeded (%d retries)\n", c.cfg.MaxRetries) + if shared.SdkLogLevel.Satisfies(shared.Debug) { + shared.SdkLogger.Printf(" Number of maximum retries exceeded (%d retries)\n", c.cfg.MaxRetries) } break } else { @@ -331,13 +472,12 @@ func (c *APIClient) backOff(ctx context.Context, t time.Duration) { if t > c.GetConfig().MaxWaitTime { t = c.GetConfig().MaxWaitTime } - if c.cfg.Debug || c.cfg.LogLevel.Satisfies(Debug) { - c.cfg.Logger.Printf(" Sleeping %s before retrying request\n", t.String()) + if shared.SdkLogLevel.Satisfies(shared.Debug) { + shared.SdkLogger.Printf(" Sleeping %s before retrying request\n", t.String()) } if t <= 0 { return } - timer := time.NewTimer(t) defer timer.Stop() @@ -349,7 +489,7 @@ func (c *APIClient) backOff(ctx context.Context, t time.Duration) { // 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() *Configuration { +func (c *APIClient) GetConfig() *shared.Configuration { return c.cfg } @@ -463,7 +603,11 @@ func (c *APIClient) prepareRequest( } // Encode the parameters. - url.RawQuery = query.Encode() + 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 { @@ -502,7 +646,7 @@ func (c *APIClient) prepareRequest( // Walk through any authentication. // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + if tok, ok := ctx.Value(shared.ContextOAuth2).(oauth2.TokenSource); ok { // We were able to grab an oauth2 token from the context var latestToken *oauth2.Token if latestToken, err = tok.Token(); err != nil { @@ -513,12 +657,12 @@ func (c *APIClient) prepareRequest( } // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + if auth, ok := ctx.Value(shared.ContextBasicAuth).(shared.BasicAuth); ok { localVarRequest.SetBasicAuth(auth.UserName, auth.Password) } // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + if auth, ok := ctx.Value(shared.ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } @@ -684,65 +828,3 @@ func CacheExpires(r *http.Response) time.Time { } return expires } - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - statusCode int - body []byte - error string - model interface{} -} - -// NewGenericOpenAPIError - constructor for GenericOpenAPIError -func NewGenericOpenAPIError(message string, body []byte, model interface{}, statusCode int) *GenericOpenAPIError { - return &GenericOpenAPIError{ - statusCode: statusCode, - body: body, - error: message, - model: model, - } -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// SetError sets the error string -func (e *GenericOpenAPIError) SetError(error string) { - e.error = error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// SetBody sets the raw body of the error -func (e *GenericOpenAPIError) SetBody(body []byte) { - e.body = body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} - -// SetModel sets the model of the error -func (e *GenericOpenAPIError) SetModel(model interface{}) { - e.model = model -} - -// StatusCode returns the status code of the error -func (e GenericOpenAPIError) StatusCode() int { - return e.statusCode -} - -// SetStatusCode sets the status code of the error -func (e *GenericOpenAPIError) SetStatusCode(statusCode int) { - e.statusCode = statusCode -} diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate.go similarity index 62% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate.go index a750b403f..98c61f883 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate.go @@ -8,24 +8,27 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificate{} + // AutoCertificate Auto certificates create new certificates based on a certificate provider. type AutoCertificate struct { // The certificate provider used to issue the certificates. - Provider *string `json:"provider"` + Provider string `json:"provider"` // The common name (DNS) of the certificate to issue. The common name needs to be part of a zone in IONOS Cloud DNS. - CommonName *string `json:"commonName"` + CommonName string `json:"commonName"` // The key algorithm used to generate the certificate. - KeyAlgorithm *string `json:"keyAlgorithm"` + KeyAlgorithm string `json:"keyAlgorithm"` // A certificate name used for management purposes. - Name *string `json:"name"` + Name string `json:"name"` // Optional additional names to be added to the issued certificate. The additional names needs to be part of a zone in IONOS Cloud DNS. - SubjectAlternativeNames *[]string `json:"subjectAlternativeNames,omitempty"` + SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"` } // NewAutoCertificate instantiates a new AutoCertificate object @@ -35,10 +38,10 @@ type AutoCertificate struct { func NewAutoCertificate(provider string, commonName string, keyAlgorithm string, name string) *AutoCertificate { this := AutoCertificate{} - this.Provider = &provider - this.CommonName = &commonName - this.KeyAlgorithm = &keyAlgorithm - this.Name = &name + this.Provider = provider + this.CommonName = commonName + this.KeyAlgorithm = keyAlgorithm + this.Name = name return &this } @@ -52,218 +55,143 @@ func NewAutoCertificateWithDefaults() *AutoCertificate { } // GetProvider returns the Provider field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificate) GetProvider() *string { +func (o *AutoCertificate) GetProvider() string { if o == nil { - return nil + var ret string + return ret } return o.Provider - } // GetProviderOk returns a tuple with the Provider 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 *AutoCertificate) GetProviderOk() (*string, bool) { if o == nil { return nil, false } - - return o.Provider, true + return &o.Provider, true } // SetProvider sets field value func (o *AutoCertificate) SetProvider(v string) { - - o.Provider = &v - -} - -// HasProvider returns a boolean if a field has been set. -func (o *AutoCertificate) HasProvider() bool { - if o != nil && o.Provider != nil { - return true - } - - return false + o.Provider = v } // GetCommonName returns the CommonName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificate) GetCommonName() *string { +func (o *AutoCertificate) GetCommonName() string { if o == nil { - return nil + var ret string + return ret } return o.CommonName - } // GetCommonNameOk returns a tuple with the CommonName 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 *AutoCertificate) GetCommonNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.CommonName, true + return &o.CommonName, true } // SetCommonName sets field value func (o *AutoCertificate) SetCommonName(v string) { - - o.CommonName = &v - -} - -// HasCommonName returns a boolean if a field has been set. -func (o *AutoCertificate) HasCommonName() bool { - if o != nil && o.CommonName != nil { - return true - } - - return false + o.CommonName = v } // GetKeyAlgorithm returns the KeyAlgorithm field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificate) GetKeyAlgorithm() *string { +func (o *AutoCertificate) GetKeyAlgorithm() string { if o == nil { - return nil + var ret string + return ret } return o.KeyAlgorithm - } // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm 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 *AutoCertificate) GetKeyAlgorithmOk() (*string, bool) { if o == nil { return nil, false } - - return o.KeyAlgorithm, true + return &o.KeyAlgorithm, true } // SetKeyAlgorithm sets field value func (o *AutoCertificate) SetKeyAlgorithm(v string) { - - o.KeyAlgorithm = &v - -} - -// HasKeyAlgorithm returns a boolean if a field has been set. -func (o *AutoCertificate) HasKeyAlgorithm() bool { - if o != nil && o.KeyAlgorithm != nil { - return true - } - - return false + o.KeyAlgorithm = v } // GetName returns the Name field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificate) GetName() *string { +func (o *AutoCertificate) GetName() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificate) GetNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.Name, true + return &o.Name, true } // SetName sets field value func (o *AutoCertificate) SetName(v string) { - - o.Name = &v - -} - -// HasName returns a boolean if a field has been set. -func (o *AutoCertificate) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false + o.Name = v } -// GetSubjectAlternativeNames returns the SubjectAlternativeNames field value -// If the value is explicit nil, the zero value for []string will be returned -func (o *AutoCertificate) GetSubjectAlternativeNames() *[]string { - if o == nil { - return nil +// GetSubjectAlternativeNames returns the SubjectAlternativeNames field value if set, zero value otherwise. +func (o *AutoCertificate) GetSubjectAlternativeNames() []string { + if o == nil || IsNil(o.SubjectAlternativeNames) { + var ret []string + return ret } - return o.SubjectAlternativeNames - } -// GetSubjectAlternativeNamesOk returns a tuple with the SubjectAlternativeNames field value +// GetSubjectAlternativeNamesOk returns a tuple with the SubjectAlternativeNames field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *AutoCertificate) GetSubjectAlternativeNamesOk() (*[]string, bool) { - if o == nil { +func (o *AutoCertificate) GetSubjectAlternativeNamesOk() ([]string, bool) { + if o == nil || IsNil(o.SubjectAlternativeNames) { return nil, false } - return o.SubjectAlternativeNames, true } -// SetSubjectAlternativeNames sets field value -func (o *AutoCertificate) SetSubjectAlternativeNames(v []string) { - - o.SubjectAlternativeNames = &v - -} - // HasSubjectAlternativeNames returns a boolean if a field has been set. func (o *AutoCertificate) HasSubjectAlternativeNames() bool { - if o != nil && o.SubjectAlternativeNames != nil { + if o != nil && !IsNil(o.SubjectAlternativeNames) { return true } return false } -func (o AutoCertificate) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Provider != nil { - toSerialize["provider"] = o.Provider - } - - if o.CommonName != nil { - toSerialize["commonName"] = o.CommonName - } - - if o.KeyAlgorithm != nil { - toSerialize["keyAlgorithm"] = o.KeyAlgorithm - } - - if o.Name != nil { - toSerialize["name"] = o.Name - } +// SetSubjectAlternativeNames gets a reference to the given []string and assigns it to the SubjectAlternativeNames field. +func (o *AutoCertificate) SetSubjectAlternativeNames(v []string) { + o.SubjectAlternativeNames = v +} - if o.SubjectAlternativeNames != nil { +func (o AutoCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["provider"] = o.Provider + toSerialize["commonName"] = o.CommonName + toSerialize["keyAlgorithm"] = o.KeyAlgorithm + toSerialize["name"] = o.Name + if !IsNil(o.SubjectAlternativeNames) { toSerialize["subjectAlternativeNames"] = o.SubjectAlternativeNames } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAutoCertificate struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_create.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_create.go similarity index 69% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_create.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_create.go index 3e41308fa..cd7bc008b 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_create.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_create.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificateCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificateCreate{} + // AutoCertificateCreate struct for AutoCertificateCreate type AutoCertificateCreate struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *AutoCertificate `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties AutoCertificate `json:"properties"` } // NewAutoCertificateCreate instantiates a new AutoCertificateCreate object @@ -28,7 +31,7 @@ type AutoCertificateCreate struct { func NewAutoCertificateCreate(properties AutoCertificate) *AutoCertificateCreate { this := AutoCertificateCreate{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewAutoCertificateCreateWithDefaults() *AutoCertificateCreate { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *AutoCertificateCreate) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *AutoCertificateCreate) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *AutoCertificateCreate) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *AutoCertificateCreate) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *AutoCertificateCreate) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *AutoCertificateCreate) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *AutoCertificateCreate) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for AutoCertificate will be returned -func (o *AutoCertificateCreate) GetProperties() *AutoCertificate { +func (o *AutoCertificateCreate) GetProperties() AutoCertificate { if o == nil { - return nil + var ret AutoCertificate + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *AutoCertificateCreate) GetPropertiesOk() (*AutoCertificate, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *AutoCertificateCreate) SetProperties(v AutoCertificate) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *AutoCertificateCreate) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o AutoCertificateCreate) MarshalJSON() ([]byte, error) { +func (o AutoCertificateCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableAutoCertificateCreate struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_patch.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_patch.go similarity index 69% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_patch.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_patch.go index 27240b33a..a240162ae 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_patch.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_patch.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificatePatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificatePatch{} + // AutoCertificatePatch struct for AutoCertificatePatch type AutoCertificatePatch struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *PatchName `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties PatchName `json:"properties"` } // NewAutoCertificatePatch instantiates a new AutoCertificatePatch object @@ -28,7 +31,7 @@ type AutoCertificatePatch struct { func NewAutoCertificatePatch(properties PatchName) *AutoCertificatePatch { this := AutoCertificatePatch{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewAutoCertificatePatchWithDefaults() *AutoCertificatePatch { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *AutoCertificatePatch) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *AutoCertificatePatch) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *AutoCertificatePatch) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *AutoCertificatePatch) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *AutoCertificatePatch) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *AutoCertificatePatch) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *AutoCertificatePatch) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for PatchName will be returned -func (o *AutoCertificatePatch) GetProperties() *PatchName { +func (o *AutoCertificatePatch) GetProperties() PatchName { if o == nil { - return nil + var ret PatchName + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *AutoCertificatePatch) GetPropertiesOk() (*PatchName, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *AutoCertificatePatch) SetProperties(v PatchName) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *AutoCertificatePatch) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o AutoCertificatePatch) MarshalJSON() ([]byte, error) { +func (o AutoCertificatePatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableAutoCertificatePatch struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read.go similarity index 60% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read.go index 165689bdc..2bb2f443b 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificateRead type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificateRead{} + // AutoCertificateRead struct for AutoCertificateRead type AutoCertificateRead struct { // The ID (UUID) of the AutoCertificate. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the AutoCertificate. - Href *string `json:"href"` - Metadata *MetadataWithAutoCertificateInformation `json:"metadata"` - Properties *AutoCertificate `json:"properties"` + Href string `json:"href"` + Metadata MetadataWithAutoCertificateInformation `json:"metadata"` + Properties AutoCertificate `json:"properties"` } // NewAutoCertificateRead instantiates a new AutoCertificateRead object @@ -33,11 +36,11 @@ type AutoCertificateRead struct { func NewAutoCertificateRead(id string, type_ string, href string, metadata MetadataWithAutoCertificateInformation, properties AutoCertificate) *AutoCertificateRead { this := AutoCertificateRead{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Metadata = &metadata - this.Properties = &properties + this.Id = id + this.Type = type_ + this.Href = href + this.Metadata = metadata + this.Properties = properties return &this } @@ -51,218 +54,133 @@ func NewAutoCertificateReadWithDefaults() *AutoCertificateRead { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateRead) GetId() *string { +func (o *AutoCertificateRead) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateRead) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *AutoCertificateRead) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *AutoCertificateRead) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateRead) GetType() *string { +func (o *AutoCertificateRead) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateRead) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *AutoCertificateRead) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *AutoCertificateRead) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateRead) GetHref() *string { +func (o *AutoCertificateRead) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *AutoCertificateRead) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *AutoCertificateRead) SetHref(v string) { - - o.Href = &v - -} - -// HasHref returns a boolean if a field has been set. -func (o *AutoCertificateRead) HasHref() bool { - if o != nil && o.Href != nil { - return true - } - - return false + o.Href = v } // GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for MetadataWithAutoCertificateInformation will be returned -func (o *AutoCertificateRead) GetMetadata() *MetadataWithAutoCertificateInformation { +func (o *AutoCertificateRead) GetMetadata() MetadataWithAutoCertificateInformation { if o == nil { - return nil + var ret MetadataWithAutoCertificateInformation + return ret } return o.Metadata - } // GetMetadataOk returns a tuple with the Metadata 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 *AutoCertificateRead) GetMetadataOk() (*MetadataWithAutoCertificateInformation, bool) { if o == nil { return nil, false } - - return o.Metadata, true + return &o.Metadata, true } // SetMetadata sets field value func (o *AutoCertificateRead) SetMetadata(v MetadataWithAutoCertificateInformation) { - - o.Metadata = &v - -} - -// HasMetadata returns a boolean if a field has been set. -func (o *AutoCertificateRead) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false + o.Metadata = v } // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for AutoCertificate will be returned -func (o *AutoCertificateRead) GetProperties() *AutoCertificate { +func (o *AutoCertificateRead) GetProperties() AutoCertificate { if o == nil { - return nil + var ret AutoCertificate + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *AutoCertificateRead) GetPropertiesOk() (*AutoCertificate, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *AutoCertificateRead) SetProperties(v AutoCertificate) { - - o.Properties = &v - + o.Properties = v } -// HasProperties returns a boolean if a field has been set. -func (o *AutoCertificateRead) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false -} - -func (o AutoCertificateRead) MarshalJSON() ([]byte, error) { +func (o AutoCertificateRead) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + toSerialize["metadata"] = o.Metadata + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableAutoCertificateRead struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list.go similarity index 58% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list.go index ae04f3508..14c5ab6e7 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list.go @@ -8,27 +8,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificateReadList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificateReadList{} + // AutoCertificateReadList struct for AutoCertificateReadList type AutoCertificateReadList struct { // ID of the list of AutoCertificate resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of AutoCertificate resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of AutoCertificate resources. - Items *[]AutoCertificateRead `json:"items,omitempty"` + Items []AutoCertificateRead `json:"items,omitempty"` // The offset specified in the request (if none was specified, the default offset is 0). - Offset *int32 `json:"offset"` + Offset int32 `json:"offset"` // The limit specified in the request (if none was specified, use the endpoint's default pagination limit). - Limit *int32 `json:"limit"` - Links *Links `json:"_links"` + Limit int32 `json:"limit"` + Links Links `json:"_links"` } // NewAutoCertificateReadList instantiates a new AutoCertificateReadList object @@ -38,12 +41,12 @@ type AutoCertificateReadList struct { func NewAutoCertificateReadList(id string, type_ string, href string, offset int32, limit int32, links Links) *AutoCertificateReadList { this := AutoCertificateReadList{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Offset = &offset - this.Limit = &limit - this.Links = &links + this.Id = id + this.Type = type_ + this.Href = href + this.Offset = offset + this.Limit = limit + this.Links = links return &this } @@ -57,302 +60,193 @@ func NewAutoCertificateReadListWithDefaults() *AutoCertificateReadList { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadList) GetId() *string { +func (o *AutoCertificateReadList) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateReadList) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *AutoCertificateReadList) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadList) GetType() *string { +func (o *AutoCertificateReadList) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateReadList) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *AutoCertificateReadList) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadList) GetHref() *string { +func (o *AutoCertificateReadList) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *AutoCertificateReadList) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *AutoCertificateReadList) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *AutoCertificateReadList) GetItems() []AutoCertificateRead { + if o == nil || IsNil(o.Items) { + var ret []AutoCertificateRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []AutoCertificateRead will be returned -func (o *AutoCertificateReadList) GetItems() *[]AutoCertificateRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *AutoCertificateReadList) GetItemsOk() (*[]AutoCertificateRead, bool) { - if o == nil { +func (o *AutoCertificateReadList) GetItemsOk() ([]AutoCertificateRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *AutoCertificateReadList) SetItems(v []AutoCertificateRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *AutoCertificateReadList) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } +// SetItems gets a reference to the given []AutoCertificateRead and assigns it to the Items field. +func (o *AutoCertificateReadList) SetItems(v []AutoCertificateRead) { + o.Items = v +} + // GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *AutoCertificateReadList) GetOffset() *int32 { +func (o *AutoCertificateReadList) GetOffset() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Offset - } // GetOffsetOk returns a tuple with the Offset 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 *AutoCertificateReadList) GetOffsetOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Offset, true + return &o.Offset, true } // SetOffset sets field value func (o *AutoCertificateReadList) SetOffset(v int32) { - - o.Offset = &v - -} - -// HasOffset returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasOffset() bool { - if o != nil && o.Offset != nil { - return true - } - - return false + o.Offset = v } // GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *AutoCertificateReadList) GetLimit() *int32 { +func (o *AutoCertificateReadList) GetLimit() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Limit - } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateReadList) GetLimitOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Limit, true + return &o.Limit, true } // SetLimit sets field value func (o *AutoCertificateReadList) SetLimit(v int32) { - - o.Limit = &v - -} - -// HasLimit returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasLimit() bool { - if o != nil && o.Limit != nil { - return true - } - - return false + o.Limit = v } // GetLinks returns the Links field value -// If the value is explicit nil, the zero value for Links will be returned -func (o *AutoCertificateReadList) GetLinks() *Links { +func (o *AutoCertificateReadList) GetLinks() Links { if o == nil { - return nil + var ret Links + return ret } return o.Links - } // GetLinksOk returns a tuple with the Links 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 *AutoCertificateReadList) GetLinksOk() (*Links, bool) { if o == nil { return nil, false } - - return o.Links, true + return &o.Links, true } // SetLinks sets field value func (o *AutoCertificateReadList) SetLinks(v Links) { - - o.Links = &v - + o.Links = v } -// HasLinks returns a boolean if a field has been set. -func (o *AutoCertificateReadList) HasLinks() bool { - if o != nil && o.Links != nil { - return true - } - - return false -} - -func (o AutoCertificateReadList) MarshalJSON() ([]byte, error) { +func (o AutoCertificateReadList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Items != nil { + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - if o.Offset != nil { - toSerialize["offset"] = o.Offset - } - - if o.Limit != nil { - toSerialize["limit"] = o.Limit - } - - if o.Links != nil { - toSerialize["_links"] = o.Links - } - - return json.Marshal(toSerialize) + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["_links"] = o.Links + return toSerialize, nil } type NullableAutoCertificateReadList struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list_all_of.go similarity index 65% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list_all_of.go index 8f7c413f7..1d0344ce4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_auto_certificate_read_list_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_auto_certificate_read_list_all_of.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the AutoCertificateReadListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoCertificateReadListAllOf{} + // AutoCertificateReadListAllOf struct for AutoCertificateReadListAllOf type AutoCertificateReadListAllOf struct { // ID of the list of AutoCertificate resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of AutoCertificate resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of AutoCertificate resources. - Items *[]AutoCertificateRead `json:"items,omitempty"` + Items []AutoCertificateRead `json:"items,omitempty"` } // NewAutoCertificateReadListAllOf instantiates a new AutoCertificateReadListAllOf object @@ -33,9 +36,9 @@ type AutoCertificateReadListAllOf struct { func NewAutoCertificateReadListAllOf(id string, type_ string, href string) *AutoCertificateReadListAllOf { this := AutoCertificateReadListAllOf{} - this.Id = &id - this.Type = &type_ - this.Href = &href + this.Id = id + this.Type = type_ + this.Href = href return &this } @@ -49,176 +52,118 @@ func NewAutoCertificateReadListAllOfWithDefaults() *AutoCertificateReadListAllOf } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadListAllOf) GetId() *string { +func (o *AutoCertificateReadListAllOf) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateReadListAllOf) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *AutoCertificateReadListAllOf) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *AutoCertificateReadListAllOf) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadListAllOf) GetType() *string { +func (o *AutoCertificateReadListAllOf) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AutoCertificateReadListAllOf) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *AutoCertificateReadListAllOf) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *AutoCertificateReadListAllOf) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AutoCertificateReadListAllOf) GetHref() *string { +func (o *AutoCertificateReadListAllOf) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *AutoCertificateReadListAllOf) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *AutoCertificateReadListAllOf) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *AutoCertificateReadListAllOf) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *AutoCertificateReadListAllOf) GetItems() []AutoCertificateRead { + if o == nil || IsNil(o.Items) { + var ret []AutoCertificateRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []AutoCertificateRead will be returned -func (o *AutoCertificateReadListAllOf) GetItems() *[]AutoCertificateRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *AutoCertificateReadListAllOf) GetItemsOk() (*[]AutoCertificateRead, bool) { - if o == nil { +func (o *AutoCertificateReadListAllOf) GetItemsOk() ([]AutoCertificateRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *AutoCertificateReadListAllOf) SetItems(v []AutoCertificateRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *AutoCertificateReadListAllOf) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -func (o AutoCertificateReadListAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } +// SetItems gets a reference to the given []AutoCertificateRead and assigns it to the Items field. +func (o *AutoCertificateReadListAllOf) SetItems(v []AutoCertificateRead) { + o.Items = v +} - if o.Items != nil { +func (o AutoCertificateReadListAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAutoCertificateReadListAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate.go similarity index 64% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate.go index b7fc0b589..0f2cee086 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Certificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Certificate{} + // Certificate TLS/SSL certificates are used to secure network communications and prove the identity of websites on the Internet and resources on private networks. The certificates and their associated private keys are provided in PEM (Privacy Enhanced Mail) format. type Certificate struct { // The certificate name. - Name *string `json:"name"` + Name string `json:"name"` // The certificate body. - Certificate *string `json:"certificate"` + Certificate string `json:"certificate"` // The certificate chain. - CertificateChain *string `json:"certificateChain"` + CertificateChain string `json:"certificateChain"` // The RSA private key is used for authentication and symmetric key exchange when establishing an SSL session. It is a part of the public key infrastructure generally used with SSL certificates. - PrivateKey *string `json:"privateKey"` + PrivateKey string `json:"privateKey"` } // NewCertificate instantiates a new Certificate object @@ -33,10 +36,10 @@ type Certificate struct { func NewCertificate(name string, certificate string, certificateChain string, privateKey string) *Certificate { this := Certificate{} - this.Name = &name - this.Certificate = &certificate - this.CertificateChain = &certificateChain - this.PrivateKey = &privateKey + this.Name = name + this.Certificate = certificate + this.CertificateChain = certificateChain + this.PrivateKey = privateKey return &this } @@ -50,176 +53,108 @@ func NewCertificateWithDefaults() *Certificate { } // GetName returns the Name field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Certificate) GetName() *string { +func (o *Certificate) GetName() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Certificate) GetNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.Name, true + return &o.Name, true } // SetName sets field value func (o *Certificate) SetName(v string) { - - o.Name = &v - -} - -// HasName returns a boolean if a field has been set. -func (o *Certificate) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false + o.Name = v } // GetCertificate returns the Certificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Certificate) GetCertificate() *string { +func (o *Certificate) GetCertificate() string { if o == nil { - return nil + var ret string + return ret } return o.Certificate - } // GetCertificateOk returns a tuple with the Certificate 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 *Certificate) GetCertificateOk() (*string, bool) { if o == nil { return nil, false } - - return o.Certificate, true + return &o.Certificate, true } // SetCertificate sets field value func (o *Certificate) SetCertificate(v string) { - - o.Certificate = &v - -} - -// HasCertificate returns a boolean if a field has been set. -func (o *Certificate) HasCertificate() bool { - if o != nil && o.Certificate != nil { - return true - } - - return false + o.Certificate = v } // GetCertificateChain returns the CertificateChain field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Certificate) GetCertificateChain() *string { +func (o *Certificate) GetCertificateChain() string { if o == nil { - return nil + var ret string + return ret } return o.CertificateChain - } // GetCertificateChainOk returns a tuple with the CertificateChain 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 *Certificate) GetCertificateChainOk() (*string, bool) { if o == nil { return nil, false } - - return o.CertificateChain, true + return &o.CertificateChain, true } // SetCertificateChain sets field value func (o *Certificate) SetCertificateChain(v string) { - - o.CertificateChain = &v - -} - -// HasCertificateChain returns a boolean if a field has been set. -func (o *Certificate) HasCertificateChain() bool { - if o != nil && o.CertificateChain != nil { - return true - } - - return false + o.CertificateChain = v } // GetPrivateKey returns the PrivateKey field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Certificate) GetPrivateKey() *string { +func (o *Certificate) GetPrivateKey() string { if o == nil { - return nil + var ret string + return ret } return o.PrivateKey - } // GetPrivateKeyOk returns a tuple with the PrivateKey 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 *Certificate) GetPrivateKeyOk() (*string, bool) { if o == nil { return nil, false } - - return o.PrivateKey, true + return &o.PrivateKey, true } // SetPrivateKey sets field value func (o *Certificate) SetPrivateKey(v string) { - - o.PrivateKey = &v - -} - -// HasPrivateKey returns a boolean if a field has been set. -func (o *Certificate) HasPrivateKey() bool { - if o != nil && o.PrivateKey != nil { - return true - } - - return false + o.PrivateKey = v } -func (o Certificate) MarshalJSON() ([]byte, error) { +func (o Certificate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - - if o.Certificate != nil { - toSerialize["certificate"] = o.Certificate - } - - if o.CertificateChain != nil { - toSerialize["certificateChain"] = o.CertificateChain - } - - if o.PrivateKey != nil { - toSerialize["privateKey"] = o.PrivateKey - } - - return json.Marshal(toSerialize) + toSerialize["name"] = o.Name + toSerialize["certificate"] = o.Certificate + toSerialize["certificateChain"] = o.CertificateChain + toSerialize["privateKey"] = o.PrivateKey + return toSerialize, nil } type NullableCertificate struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_create.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_create.go similarity index 69% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_create.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_create.go index 828f299a2..c98873bc5 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_create.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_create.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the CertificateCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateCreate{} + // CertificateCreate struct for CertificateCreate type CertificateCreate struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *Certificate `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties Certificate `json:"properties"` } // NewCertificateCreate instantiates a new CertificateCreate object @@ -28,7 +31,7 @@ type CertificateCreate struct { func NewCertificateCreate(properties Certificate) *CertificateCreate { this := CertificateCreate{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewCertificateCreateWithDefaults() *CertificateCreate { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *CertificateCreate) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CertificateCreate) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CertificateCreate) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *CertificateCreate) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *CertificateCreate) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *CertificateCreate) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CertificateCreate) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for Certificate will be returned -func (o *CertificateCreate) GetProperties() *Certificate { +func (o *CertificateCreate) GetProperties() Certificate { if o == nil { - return nil + var ret Certificate + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *CertificateCreate) GetPropertiesOk() (*Certificate, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *CertificateCreate) SetProperties(v Certificate) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *CertificateCreate) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o CertificateCreate) MarshalJSON() ([]byte, error) { +func (o CertificateCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableCertificateCreate struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_patch.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_patch.go similarity index 69% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_patch.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_patch.go index e89239aa4..5ecacc494 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_patch.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_patch.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the CertificatePatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificatePatch{} + // CertificatePatch struct for CertificatePatch type CertificatePatch struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *PatchName `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties PatchName `json:"properties"` } // NewCertificatePatch instantiates a new CertificatePatch object @@ -28,7 +31,7 @@ type CertificatePatch struct { func NewCertificatePatch(properties PatchName) *CertificatePatch { this := CertificatePatch{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewCertificatePatchWithDefaults() *CertificatePatch { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *CertificatePatch) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CertificatePatch) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CertificatePatch) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *CertificatePatch) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *CertificatePatch) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *CertificatePatch) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CertificatePatch) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for PatchName will be returned -func (o *CertificatePatch) GetProperties() *PatchName { +func (o *CertificatePatch) GetProperties() PatchName { if o == nil { - return nil + var ret PatchName + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *CertificatePatch) GetPropertiesOk() (*PatchName, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *CertificatePatch) SetProperties(v PatchName) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *CertificatePatch) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o CertificatePatch) MarshalJSON() ([]byte, error) { +func (o CertificatePatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableCertificatePatch struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read.go similarity index 60% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read.go index 2e0288d64..370b1188d 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the CertificateRead type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateRead{} + // CertificateRead struct for CertificateRead type CertificateRead struct { // The ID (UUID) of the Certificate. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the Certificate. - Href *string `json:"href"` - Metadata *MetadataWithCertificateInformation `json:"metadata"` - Properties *Certificate `json:"properties"` + Href string `json:"href"` + Metadata MetadataWithCertificateInformation `json:"metadata"` + Properties Certificate `json:"properties"` } // NewCertificateRead instantiates a new CertificateRead object @@ -33,11 +36,11 @@ type CertificateRead struct { func NewCertificateRead(id string, type_ string, href string, metadata MetadataWithCertificateInformation, properties Certificate) *CertificateRead { this := CertificateRead{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Metadata = &metadata - this.Properties = &properties + this.Id = id + this.Type = type_ + this.Href = href + this.Metadata = metadata + this.Properties = properties return &this } @@ -51,218 +54,133 @@ func NewCertificateReadWithDefaults() *CertificateRead { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateRead) GetId() *string { +func (o *CertificateRead) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateRead) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *CertificateRead) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *CertificateRead) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateRead) GetType() *string { +func (o *CertificateRead) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateRead) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *CertificateRead) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *CertificateRead) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateRead) GetHref() *string { +func (o *CertificateRead) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *CertificateRead) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *CertificateRead) SetHref(v string) { - - o.Href = &v - -} - -// HasHref returns a boolean if a field has been set. -func (o *CertificateRead) HasHref() bool { - if o != nil && o.Href != nil { - return true - } - - return false + o.Href = v } // GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for MetadataWithCertificateInformation will be returned -func (o *CertificateRead) GetMetadata() *MetadataWithCertificateInformation { +func (o *CertificateRead) GetMetadata() MetadataWithCertificateInformation { if o == nil { - return nil + var ret MetadataWithCertificateInformation + return ret } return o.Metadata - } // GetMetadataOk returns a tuple with the Metadata 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 *CertificateRead) GetMetadataOk() (*MetadataWithCertificateInformation, bool) { if o == nil { return nil, false } - - return o.Metadata, true + return &o.Metadata, true } // SetMetadata sets field value func (o *CertificateRead) SetMetadata(v MetadataWithCertificateInformation) { - - o.Metadata = &v - -} - -// HasMetadata returns a boolean if a field has been set. -func (o *CertificateRead) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false + o.Metadata = v } // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for Certificate will be returned -func (o *CertificateRead) GetProperties() *Certificate { +func (o *CertificateRead) GetProperties() Certificate { if o == nil { - return nil + var ret Certificate + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *CertificateRead) GetPropertiesOk() (*Certificate, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *CertificateRead) SetProperties(v Certificate) { - - o.Properties = &v - + o.Properties = v } -// HasProperties returns a boolean if a field has been set. -func (o *CertificateRead) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false -} - -func (o CertificateRead) MarshalJSON() ([]byte, error) { +func (o CertificateRead) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + toSerialize["metadata"] = o.Metadata + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableCertificateRead struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list.go similarity index 58% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list.go index 5e0c70c3a..c2a79e725 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list.go @@ -8,27 +8,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the CertificateReadList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateReadList{} + // CertificateReadList struct for CertificateReadList type CertificateReadList struct { // ID of the list of Certificate resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of Certificate resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of Certificate resources. - Items *[]CertificateRead `json:"items,omitempty"` + Items []CertificateRead `json:"items,omitempty"` // The offset specified in the request (if none was specified, the default offset is 0). - Offset *int32 `json:"offset"` + Offset int32 `json:"offset"` // The limit specified in the request (if none was specified, use the endpoint's default pagination limit). - Limit *int32 `json:"limit"` - Links *Links `json:"_links"` + Limit int32 `json:"limit"` + Links Links `json:"_links"` } // NewCertificateReadList instantiates a new CertificateReadList object @@ -38,12 +41,12 @@ type CertificateReadList struct { func NewCertificateReadList(id string, type_ string, href string, offset int32, limit int32, links Links) *CertificateReadList { this := CertificateReadList{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Offset = &offset - this.Limit = &limit - this.Links = &links + this.Id = id + this.Type = type_ + this.Href = href + this.Offset = offset + this.Limit = limit + this.Links = links return &this } @@ -57,302 +60,193 @@ func NewCertificateReadListWithDefaults() *CertificateReadList { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadList) GetId() *string { +func (o *CertificateReadList) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateReadList) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *CertificateReadList) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *CertificateReadList) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadList) GetType() *string { +func (o *CertificateReadList) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateReadList) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *CertificateReadList) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *CertificateReadList) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadList) GetHref() *string { +func (o *CertificateReadList) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *CertificateReadList) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *CertificateReadList) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *CertificateReadList) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *CertificateReadList) GetItems() []CertificateRead { + if o == nil || IsNil(o.Items) { + var ret []CertificateRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []CertificateRead will be returned -func (o *CertificateReadList) GetItems() *[]CertificateRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CertificateReadList) GetItemsOk() (*[]CertificateRead, bool) { - if o == nil { +func (o *CertificateReadList) GetItemsOk() ([]CertificateRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *CertificateReadList) SetItems(v []CertificateRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *CertificateReadList) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } +// SetItems gets a reference to the given []CertificateRead and assigns it to the Items field. +func (o *CertificateReadList) SetItems(v []CertificateRead) { + o.Items = v +} + // GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CertificateReadList) GetOffset() *int32 { +func (o *CertificateReadList) GetOffset() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Offset - } // GetOffsetOk returns a tuple with the Offset 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 *CertificateReadList) GetOffsetOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Offset, true + return &o.Offset, true } // SetOffset sets field value func (o *CertificateReadList) SetOffset(v int32) { - - o.Offset = &v - -} - -// HasOffset returns a boolean if a field has been set. -func (o *CertificateReadList) HasOffset() bool { - if o != nil && o.Offset != nil { - return true - } - - return false + o.Offset = v } // GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CertificateReadList) GetLimit() *int32 { +func (o *CertificateReadList) GetLimit() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Limit - } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateReadList) GetLimitOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Limit, true + return &o.Limit, true } // SetLimit sets field value func (o *CertificateReadList) SetLimit(v int32) { - - o.Limit = &v - -} - -// HasLimit returns a boolean if a field has been set. -func (o *CertificateReadList) HasLimit() bool { - if o != nil && o.Limit != nil { - return true - } - - return false + o.Limit = v } // GetLinks returns the Links field value -// If the value is explicit nil, the zero value for Links will be returned -func (o *CertificateReadList) GetLinks() *Links { +func (o *CertificateReadList) GetLinks() Links { if o == nil { - return nil + var ret Links + return ret } return o.Links - } // GetLinksOk returns a tuple with the Links 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 *CertificateReadList) GetLinksOk() (*Links, bool) { if o == nil { return nil, false } - - return o.Links, true + return &o.Links, true } // SetLinks sets field value func (o *CertificateReadList) SetLinks(v Links) { - - o.Links = &v - + o.Links = v } -// HasLinks returns a boolean if a field has been set. -func (o *CertificateReadList) HasLinks() bool { - if o != nil && o.Links != nil { - return true - } - - return false -} - -func (o CertificateReadList) MarshalJSON() ([]byte, error) { +func (o CertificateReadList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Items != nil { + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - if o.Offset != nil { - toSerialize["offset"] = o.Offset - } - - if o.Limit != nil { - toSerialize["limit"] = o.Limit - } - - if o.Links != nil { - toSerialize["_links"] = o.Links - } - - return json.Marshal(toSerialize) + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["_links"] = o.Links + return toSerialize, nil } type NullableCertificateReadList struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list_all_of.go similarity index 64% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list_all_of.go index 05e874ae3..673d3deb9 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_certificate_read_list_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_certificate_read_list_all_of.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the CertificateReadListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateReadListAllOf{} + // CertificateReadListAllOf struct for CertificateReadListAllOf type CertificateReadListAllOf struct { // ID of the list of Certificate resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of Certificate resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of Certificate resources. - Items *[]CertificateRead `json:"items,omitempty"` + Items []CertificateRead `json:"items,omitempty"` } // NewCertificateReadListAllOf instantiates a new CertificateReadListAllOf object @@ -33,9 +36,9 @@ type CertificateReadListAllOf struct { func NewCertificateReadListAllOf(id string, type_ string, href string) *CertificateReadListAllOf { this := CertificateReadListAllOf{} - this.Id = &id - this.Type = &type_ - this.Href = &href + this.Id = id + this.Type = type_ + this.Href = href return &this } @@ -49,176 +52,118 @@ func NewCertificateReadListAllOfWithDefaults() *CertificateReadListAllOf { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadListAllOf) GetId() *string { +func (o *CertificateReadListAllOf) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateReadListAllOf) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *CertificateReadListAllOf) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *CertificateReadListAllOf) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadListAllOf) GetType() *string { +func (o *CertificateReadListAllOf) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CertificateReadListAllOf) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *CertificateReadListAllOf) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *CertificateReadListAllOf) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CertificateReadListAllOf) GetHref() *string { +func (o *CertificateReadListAllOf) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *CertificateReadListAllOf) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *CertificateReadListAllOf) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *CertificateReadListAllOf) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *CertificateReadListAllOf) GetItems() []CertificateRead { + if o == nil || IsNil(o.Items) { + var ret []CertificateRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []CertificateRead will be returned -func (o *CertificateReadListAllOf) GetItems() *[]CertificateRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CertificateReadListAllOf) GetItemsOk() (*[]CertificateRead, bool) { - if o == nil { +func (o *CertificateReadListAllOf) GetItemsOk() ([]CertificateRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *CertificateReadListAllOf) SetItems(v []CertificateRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *CertificateReadListAllOf) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -func (o CertificateReadListAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } +// SetItems gets a reference to the given []CertificateRead and assigns it to the Items field. +func (o *CertificateReadListAllOf) SetItems(v []CertificateRead) { + o.Items = v +} - if o.Items != nil { +func (o CertificateReadListAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCertificateReadListAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_connection.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_connection.go similarity index 67% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_connection.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_connection.go index 04e41c541..dda926f98 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_connection.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_connection.go @@ -8,20 +8,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Connection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Connection{} + // Connection Details about the network connection for your instance. type Connection struct { // The datacenter to connect your instance to. - DatacenterId *string `json:"datacenterId"` + DatacenterId string `json:"datacenterId"` // The numeric LAN ID to connect your instance to. - LanId *string `json:"lanId"` + LanId string `json:"lanId"` // The IP and subnet for your instance. Note the following unavailable IP range: 10.244.0.0/11 - Cidr *string `json:"cidr"` + Cidr string `json:"cidr"` } // NewConnection instantiates a new Connection object @@ -31,9 +34,9 @@ type Connection struct { func NewConnection(datacenterId string, lanId string, cidr string) *Connection { this := Connection{} - this.DatacenterId = &datacenterId - this.LanId = &lanId - this.Cidr = &cidr + this.DatacenterId = datacenterId + this.LanId = lanId + this.Cidr = cidr return &this } @@ -47,134 +50,83 @@ func NewConnectionWithDefaults() *Connection { } // GetDatacenterId returns the DatacenterId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Connection) GetDatacenterId() *string { +func (o *Connection) GetDatacenterId() string { if o == nil { - return nil + var ret string + return ret } return o.DatacenterId - } // GetDatacenterIdOk returns a tuple with the DatacenterId 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 *Connection) GetDatacenterIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.DatacenterId, true + return &o.DatacenterId, true } // SetDatacenterId sets field value func (o *Connection) SetDatacenterId(v string) { - - o.DatacenterId = &v - -} - -// HasDatacenterId returns a boolean if a field has been set. -func (o *Connection) HasDatacenterId() bool { - if o != nil && o.DatacenterId != nil { - return true - } - - return false + o.DatacenterId = v } // GetLanId returns the LanId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Connection) GetLanId() *string { +func (o *Connection) GetLanId() string { if o == nil { - return nil + var ret string + return ret } return o.LanId - } // GetLanIdOk returns a tuple with the LanId 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 *Connection) GetLanIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.LanId, true + return &o.LanId, true } // SetLanId sets field value func (o *Connection) SetLanId(v string) { - - o.LanId = &v - -} - -// HasLanId returns a boolean if a field has been set. -func (o *Connection) HasLanId() bool { - if o != nil && o.LanId != nil { - return true - } - - return false + o.LanId = v } // GetCidr returns the Cidr field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Connection) GetCidr() *string { +func (o *Connection) GetCidr() string { if o == nil { - return nil + var ret string + return ret } return o.Cidr - } // GetCidrOk returns a tuple with the Cidr 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 *Connection) GetCidrOk() (*string, bool) { if o == nil { return nil, false } - - return o.Cidr, true + return &o.Cidr, true } // SetCidr sets field value func (o *Connection) SetCidr(v string) { - - o.Cidr = &v - + o.Cidr = v } -// HasCidr returns a boolean if a field has been set. -func (o *Connection) HasCidr() bool { - if o != nil && o.Cidr != nil { - return true - } - - return false -} - -func (o Connection) MarshalJSON() ([]byte, error) { +func (o Connection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DatacenterId != nil { - toSerialize["datacenterId"] = o.DatacenterId - } - - if o.LanId != nil { - toSerialize["lanId"] = o.LanId - } - - if o.Cidr != nil { - toSerialize["cidr"] = o.Cidr - } - - return json.Marshal(toSerialize) + toSerialize["datacenterId"] = o.DatacenterId + toSerialize["lanId"] = o.LanId + toSerialize["cidr"] = o.Cidr + return toSerialize, nil } type NullableConnection struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_day_of_the_week.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_day_of_the_week.go similarity index 99% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_day_of_the_week.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_day_of_the_week.go index b3ef65bb1..8e809ba35 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_day_of_the_week.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_day_of_the_week.go @@ -8,10 +8,11 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "fmt" ) diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error.go index 588408fcb..61a50cf76 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error.go @@ -8,18 +8,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + // Error The Error object is used to represent an error response from the API. type Error struct { // The HTTP status code of the operation. HttpStatus *int32 `json:"httpStatus,omitempty"` // A list of error messages. - Messages *[]ErrorMessages `json:"messages,omitempty"` + Messages []ErrorMessages `json:"messages,omitempty"` } // NewError instantiates a new Error object @@ -40,93 +43,79 @@ func NewErrorWithDefaults() *Error { return &this } -// GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *Error) GetHttpStatus() *int32 { - if o == nil { - return nil +// GetHttpStatus returns the HttpStatus field value if set, zero value otherwise. +func (o *Error) GetHttpStatus() int32 { + if o == nil || IsNil(o.HttpStatus) { + var ret int32 + return ret } - - return o.HttpStatus - + return *o.HttpStatus } -// GetHttpStatusOk returns a tuple with the HttpStatus field value +// GetHttpStatusOk returns a tuple with the HttpStatus field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Error) GetHttpStatusOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.HttpStatus) { return nil, false } - return o.HttpStatus, true } -// SetHttpStatus sets field value -func (o *Error) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - // HasHttpStatus returns a boolean if a field has been set. func (o *Error) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { + if o != nil && !IsNil(o.HttpStatus) { return true } return false } -// GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessages will be returned -func (o *Error) GetMessages() *[]ErrorMessages { - if o == nil { - return nil - } +// SetHttpStatus gets a reference to the given int32 and assigns it to the HttpStatus field. +func (o *Error) SetHttpStatus(v int32) { + o.HttpStatus = &v +} +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *Error) GetMessages() []ErrorMessages { + if o == nil || IsNil(o.Messages) { + var ret []ErrorMessages + return ret + } return o.Messages - } -// GetMessagesOk returns a tuple with the Messages field value +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Error) GetMessagesOk() (*[]ErrorMessages, bool) { - if o == nil { +func (o *Error) GetMessagesOk() ([]ErrorMessages, bool) { + if o == nil || IsNil(o.Messages) { return nil, false } - return o.Messages, true } -// SetMessages sets field value -func (o *Error) SetMessages(v []ErrorMessages) { - - o.Messages = &v - -} - // HasMessages returns a boolean if a field has been set. func (o *Error) HasMessages() bool { - if o != nil && o.Messages != nil { + if o != nil && !IsNil(o.Messages) { return true } return false } -func (o Error) MarshalJSON() ([]byte, error) { +// SetMessages gets a reference to the given []ErrorMessages and assigns it to the Messages field. +func (o *Error) SetMessages(v []ErrorMessages) { + o.Messages = v +} + +func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { + if !IsNil(o.HttpStatus) { toSerialize["httpStatus"] = o.HttpStatus } - - if o.Messages != nil { + if !IsNil(o.Messages) { toSerialize["messages"] = o.Messages } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableError struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error_messages.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error_messages.go similarity index 74% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error_messages.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error_messages.go index 276978e8b..ef449bcef 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_error_messages.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_error_messages.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ErrorMessages type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorMessages{} + // ErrorMessages struct for ErrorMessages type ErrorMessages struct { // Application internal error code @@ -40,93 +43,79 @@ func NewErrorMessagesWithDefaults() *ErrorMessages { return &this } -// GetErrorCode returns the ErrorCode field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ErrorMessages) GetErrorCode() *string { - if o == nil { - return nil +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *ErrorMessages) GetErrorCode() string { + if o == nil || IsNil(o.ErrorCode) { + var ret string + return ret } - - return o.ErrorCode - + return *o.ErrorCode } -// GetErrorCodeOk returns a tuple with the ErrorCode field value +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ErrorMessages) GetErrorCodeOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ErrorCode) { return nil, false } - return o.ErrorCode, true } -// SetErrorCode sets field value -func (o *ErrorMessages) SetErrorCode(v string) { - - o.ErrorCode = &v - -} - // HasErrorCode returns a boolean if a field has been set. func (o *ErrorMessages) HasErrorCode() bool { - if o != nil && o.ErrorCode != nil { + if o != nil && !IsNil(o.ErrorCode) { return true } return false } -// GetMessage returns the Message field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ErrorMessages) GetMessage() *string { - if o == nil { - return nil - } - - return o.Message +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *ErrorMessages) SetErrorCode(v string) { + o.ErrorCode = &v +} +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ErrorMessages) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message } -// GetMessageOk returns a tuple with the Message field value +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ErrorMessages) GetMessageOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Message) { return nil, false } - return o.Message, true } -// SetMessage sets field value -func (o *ErrorMessages) SetMessage(v string) { - - o.Message = &v - -} - // HasMessage returns a boolean if a field has been set. func (o *ErrorMessages) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !IsNil(o.Message) { return true } return false } -func (o ErrorMessages) MarshalJSON() ([]byte, error) { +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ErrorMessages) SetMessage(v string) { + o.Message = &v +} + +func (o ErrorMessages) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ErrorCode != nil { + if !IsNil(o.ErrorCode) { toSerialize["errorCode"] = o.ErrorCode } - - if o.Message != nil { + if !IsNil(o.Message) { toSerialize["message"] = o.Message } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableErrorMessages struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_links.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_links.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_links.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_links.go index 3d9b0c81e..01e416780 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_links.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_links.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Links type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Links{} + // Links URLs to navigate the different pages. As of now we always only return a single page. type Links struct { // URL (with offset and limit parameters) of the previous page; only present if offset is greater than 0. @@ -42,135 +45,114 @@ func NewLinksWithDefaults() *Links { return &this } -// GetPrev returns the Prev field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Links) GetPrev() *string { - if o == nil { - return nil +// GetPrev returns the Prev field value if set, zero value otherwise. +func (o *Links) GetPrev() string { + if o == nil || IsNil(o.Prev) { + var ret string + return ret } - - return o.Prev - + return *o.Prev } -// GetPrevOk returns a tuple with the Prev field value +// GetPrevOk returns a tuple with the Prev field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Links) GetPrevOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Prev) { return nil, false } - return o.Prev, true } -// SetPrev sets field value -func (o *Links) SetPrev(v string) { - - o.Prev = &v - -} - // HasPrev returns a boolean if a field has been set. func (o *Links) HasPrev() bool { - if o != nil && o.Prev != nil { + if o != nil && !IsNil(o.Prev) { return true } return false } -// GetSelf returns the Self field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Links) GetSelf() *string { - if o == nil { - return nil - } - - return o.Self +// SetPrev gets a reference to the given string and assigns it to the Prev field. +func (o *Links) SetPrev(v string) { + o.Prev = &v +} +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *Links) GetSelf() string { + if o == nil || IsNil(o.Self) { + var ret string + return ret + } + return *o.Self } -// GetSelfOk returns a tuple with the Self field value +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Links) GetSelfOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Self) { return nil, false } - return o.Self, true } -// SetSelf sets field value -func (o *Links) SetSelf(v string) { - - o.Self = &v - -} - // HasSelf returns a boolean if a field has been set. func (o *Links) HasSelf() bool { - if o != nil && o.Self != nil { + if o != nil && !IsNil(o.Self) { return true } return false } -// GetNext returns the Next field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Links) GetNext() *string { - if o == nil { - return nil - } - - return o.Next +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *Links) SetSelf(v string) { + o.Self = &v +} +// GetNext returns the Next field value if set, zero value otherwise. +func (o *Links) GetNext() string { + if o == nil || IsNil(o.Next) { + var ret string + return ret + } + return *o.Next } -// GetNextOk returns a tuple with the Next field value +// GetNextOk returns a tuple with the Next field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Links) GetNextOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Next) { return nil, false } - return o.Next, true } -// SetNext sets field value -func (o *Links) SetNext(v string) { - - o.Next = &v - -} - // HasNext returns a boolean if a field has been set. func (o *Links) HasNext() bool { - if o != nil && o.Next != nil { + if o != nil && !IsNil(o.Next) { return true } return false } -func (o Links) MarshalJSON() ([]byte, error) { +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *Links) SetNext(v string) { + o.Next = &v +} + +func (o Links) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Prev != nil { + if !IsNil(o.Prev) { toSerialize["prev"] = o.Prev } - - if o.Self != nil { + if !IsNil(o.Self) { toSerialize["self"] = o.Self } - - if o.Next != nil { + if !IsNil(o.Next) { toSerialize["next"] = o.Next } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableLinks struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_maintenance_window.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_maintenance_window.go similarity index 71% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_maintenance_window.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_maintenance_window.go index f45aebb08..91e1186c4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_maintenance_window.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_maintenance_window.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the MaintenanceWindow type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MaintenanceWindow{} + // MaintenanceWindow A weekly 4 hour-long window, during which maintenance might occur. type MaintenanceWindow struct { // Start of the maintenance window in UTC time. - Time *string `json:"time"` - DayOfTheWeek *DayOfTheWeek `json:"dayOfTheWeek"` + Time string `json:"time"` + DayOfTheWeek DayOfTheWeek `json:"dayOfTheWeek"` } // NewMaintenanceWindow instantiates a new MaintenanceWindow object @@ -28,8 +31,8 @@ type MaintenanceWindow struct { func NewMaintenanceWindow(time string, dayOfTheWeek DayOfTheWeek) *MaintenanceWindow { this := MaintenanceWindow{} - this.Time = &time - this.DayOfTheWeek = &dayOfTheWeek + this.Time = time + this.DayOfTheWeek = dayOfTheWeek return &this } @@ -43,92 +46,58 @@ func NewMaintenanceWindowWithDefaults() *MaintenanceWindow { } // GetTime returns the Time field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MaintenanceWindow) GetTime() *string { +func (o *MaintenanceWindow) GetTime() string { if o == nil { - return nil + var ret string + return ret } return o.Time - } // GetTimeOk returns a tuple with the Time 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 *MaintenanceWindow) GetTimeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Time, true + return &o.Time, true } // SetTime sets field value func (o *MaintenanceWindow) SetTime(v string) { - - o.Time = &v - -} - -// HasTime returns a boolean if a field has been set. -func (o *MaintenanceWindow) HasTime() bool { - if o != nil && o.Time != nil { - return true - } - - return false + o.Time = v } // GetDayOfTheWeek returns the DayOfTheWeek field value -// If the value is explicit nil, the zero value for DayOfTheWeek will be returned -func (o *MaintenanceWindow) GetDayOfTheWeek() *DayOfTheWeek { +func (o *MaintenanceWindow) GetDayOfTheWeek() DayOfTheWeek { if o == nil { - return nil + var ret DayOfTheWeek + return ret } return o.DayOfTheWeek - } // GetDayOfTheWeekOk returns a tuple with the DayOfTheWeek 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 *MaintenanceWindow) GetDayOfTheWeekOk() (*DayOfTheWeek, bool) { if o == nil { return nil, false } - - return o.DayOfTheWeek, true + return &o.DayOfTheWeek, true } // SetDayOfTheWeek sets field value func (o *MaintenanceWindow) SetDayOfTheWeek(v DayOfTheWeek) { - - o.DayOfTheWeek = &v - -} - -// HasDayOfTheWeek returns a boolean if a field has been set. -func (o *MaintenanceWindow) HasDayOfTheWeek() bool { - if o != nil && o.DayOfTheWeek != nil { - return true - } - - return false + o.DayOfTheWeek = v } -func (o MaintenanceWindow) MarshalJSON() ([]byte, error) { +func (o MaintenanceWindow) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Time != nil { - toSerialize["time"] = o.Time - } - - if o.DayOfTheWeek != nil { - toSerialize["dayOfTheWeek"] = o.DayOfTheWeek - } - - return json.Marshal(toSerialize) + toSerialize["time"] = o.Time + toSerialize["dayOfTheWeek"] = o.DayOfTheWeek + return toSerialize, nil } type NullableMaintenanceWindow struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata.go similarity index 64% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata.go index 8773b5371..bb7fe21c9 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "time" ) +// checks if the Metadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metadata{} + // Metadata Metadata of the resource. type Metadata struct { // The ISO 8601 creation timestamp. @@ -51,317 +55,254 @@ func NewMetadataWithDefaults() *Metadata { return &this } -// GetCreatedDate returns the CreatedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *Metadata) GetCreatedDate() *time.Time { - if o == nil { - return nil - } - - if o.CreatedDate == nil { - return nil +// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. +func (o *Metadata) GetCreatedDate() time.Time { + if o == nil || IsNil(o.CreatedDate) { + var ret time.Time + return ret } - return &o.CreatedDate.Time - + return o.CreatedDate.Time } -// GetCreatedDateOk returns a tuple with the CreatedDate field value +// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetCreatedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.CreatedDate == nil { + if o == nil || IsNil(o.CreatedDate) { return nil, false } return &o.CreatedDate.Time, true - -} - -// SetCreatedDate sets field value -func (o *Metadata) SetCreatedDate(v time.Time) { - - o.CreatedDate = &IonosTime{v} - } // HasCreatedDate returns a boolean if a field has been set. func (o *Metadata) HasCreatedDate() bool { - if o != nil && o.CreatedDate != nil { + if o != nil && !IsNil(o.CreatedDate) { return true } return false } -// GetCreatedBy returns the CreatedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Metadata) GetCreatedBy() *string { - if o == nil { - return nil - } - - return o.CreatedBy +// SetCreatedDate gets a reference to the given time.Time and assigns it to the CreatedDate field. +func (o *Metadata) SetCreatedDate(v time.Time) { + o.CreatedDate = &IonosTime{v} +} +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *Metadata) GetCreatedBy() string { + if o == nil || IsNil(o.CreatedBy) { + var ret string + return ret + } + return *o.CreatedBy } -// GetCreatedByOk returns a tuple with the CreatedBy field value +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetCreatedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedBy) { return nil, false } - return o.CreatedBy, true } -// SetCreatedBy sets field value -func (o *Metadata) SetCreatedBy(v string) { - - o.CreatedBy = &v - -} - // HasCreatedBy returns a boolean if a field has been set. func (o *Metadata) HasCreatedBy() bool { - if o != nil && o.CreatedBy != nil { + if o != nil && !IsNil(o.CreatedBy) { return true } return false } -// GetCreatedByUserId returns the CreatedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Metadata) GetCreatedByUserId() *string { - if o == nil { - return nil - } - - return o.CreatedByUserId +// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field. +func (o *Metadata) SetCreatedBy(v string) { + o.CreatedBy = &v +} +// GetCreatedByUserId returns the CreatedByUserId field value if set, zero value otherwise. +func (o *Metadata) GetCreatedByUserId() string { + if o == nil || IsNil(o.CreatedByUserId) { + var ret string + return ret + } + return *o.CreatedByUserId } -// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetCreatedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedByUserId) { return nil, false } - return o.CreatedByUserId, true } -// SetCreatedByUserId sets field value -func (o *Metadata) SetCreatedByUserId(v string) { - - o.CreatedByUserId = &v - -} - // HasCreatedByUserId returns a boolean if a field has been set. func (o *Metadata) HasCreatedByUserId() bool { - if o != nil && o.CreatedByUserId != nil { + if o != nil && !IsNil(o.CreatedByUserId) { return true } return false } -// GetLastModifiedDate returns the LastModifiedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *Metadata) GetLastModifiedDate() *time.Time { - if o == nil { - return nil - } +// SetCreatedByUserId gets a reference to the given string and assigns it to the CreatedByUserId field. +func (o *Metadata) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v +} - if o.LastModifiedDate == nil { - return nil +// GetLastModifiedDate returns the LastModifiedDate field value if set, zero value otherwise. +func (o *Metadata) GetLastModifiedDate() time.Time { + if o == nil || IsNil(o.LastModifiedDate) { + var ret time.Time + return ret } - return &o.LastModifiedDate.Time - + return o.LastModifiedDate.Time } -// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value +// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetLastModifiedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.LastModifiedDate == nil { + if o == nil || IsNil(o.LastModifiedDate) { return nil, false } return &o.LastModifiedDate.Time, true - -} - -// SetLastModifiedDate sets field value -func (o *Metadata) SetLastModifiedDate(v time.Time) { - - o.LastModifiedDate = &IonosTime{v} - } // HasLastModifiedDate returns a boolean if a field has been set. func (o *Metadata) HasLastModifiedDate() bool { - if o != nil && o.LastModifiedDate != nil { + if o != nil && !IsNil(o.LastModifiedDate) { return true } return false } -// GetLastModifiedBy returns the LastModifiedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Metadata) GetLastModifiedBy() *string { - if o == nil { - return nil - } - - return o.LastModifiedBy +// SetLastModifiedDate gets a reference to the given time.Time and assigns it to the LastModifiedDate field. +func (o *Metadata) SetLastModifiedDate(v time.Time) { + o.LastModifiedDate = &IonosTime{v} +} +// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. +func (o *Metadata) GetLastModifiedBy() string { + if o == nil || IsNil(o.LastModifiedBy) { + var ret string + return ret + } + return *o.LastModifiedBy } -// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value +// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetLastModifiedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedBy) { return nil, false } - return o.LastModifiedBy, true } -// SetLastModifiedBy sets field value -func (o *Metadata) SetLastModifiedBy(v string) { - - o.LastModifiedBy = &v - -} - // HasLastModifiedBy returns a boolean if a field has been set. func (o *Metadata) HasLastModifiedBy() bool { - if o != nil && o.LastModifiedBy != nil { + if o != nil && !IsNil(o.LastModifiedBy) { return true } return false } -// GetLastModifiedByUserId returns the LastModifiedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Metadata) GetLastModifiedByUserId() *string { - if o == nil { - return nil - } - - return o.LastModifiedByUserId +// SetLastModifiedBy gets a reference to the given string and assigns it to the LastModifiedBy field. +func (o *Metadata) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v +} +// GetLastModifiedByUserId returns the LastModifiedByUserId field value if set, zero value otherwise. +func (o *Metadata) GetLastModifiedByUserId() string { + if o == nil || IsNil(o.LastModifiedByUserId) { + var ret string + return ret + } + return *o.LastModifiedByUserId } -// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value +// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetLastModifiedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedByUserId) { return nil, false } - return o.LastModifiedByUserId, true } -// SetLastModifiedByUserId sets field value -func (o *Metadata) SetLastModifiedByUserId(v string) { - - o.LastModifiedByUserId = &v - -} - // HasLastModifiedByUserId returns a boolean if a field has been set. func (o *Metadata) HasLastModifiedByUserId() bool { - if o != nil && o.LastModifiedByUserId != nil { + if o != nil && !IsNil(o.LastModifiedByUserId) { return true } return false } -// GetResourceURN returns the ResourceURN field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Metadata) GetResourceURN() *string { - if o == nil { - return nil - } - - return o.ResourceURN +// SetLastModifiedByUserId gets a reference to the given string and assigns it to the LastModifiedByUserId field. +func (o *Metadata) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v +} +// GetResourceURN returns the ResourceURN field value if set, zero value otherwise. +func (o *Metadata) GetResourceURN() string { + if o == nil || IsNil(o.ResourceURN) { + var ret string + return ret + } + return *o.ResourceURN } -// GetResourceURNOk returns a tuple with the ResourceURN field value +// GetResourceURNOk returns a tuple with the ResourceURN field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Metadata) GetResourceURNOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ResourceURN) { return nil, false } - return o.ResourceURN, true } -// SetResourceURN sets field value -func (o *Metadata) SetResourceURN(v string) { - - o.ResourceURN = &v - -} - // HasResourceURN returns a boolean if a field has been set. func (o *Metadata) HasResourceURN() bool { - if o != nil && o.ResourceURN != nil { + if o != nil && !IsNil(o.ResourceURN) { return true } return false } -func (o Metadata) MarshalJSON() ([]byte, error) { +// SetResourceURN gets a reference to the given string and assigns it to the ResourceURN field. +func (o *Metadata) SetResourceURN(v string) { + o.ResourceURN = &v +} + +func (o Metadata) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CreatedDate != nil { + if !IsNil(o.CreatedDate) { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { + if !IsNil(o.CreatedBy) { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { + if !IsNil(o.CreatedByUserId) { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { + if !IsNil(o.LastModifiedDate) { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { + if !IsNil(o.LastModifiedBy) { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { + if !IsNil(o.LastModifiedByUserId) { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - - if o.ResourceURN != nil { + if !IsNil(o.ResourceURN) { toSerialize["resourceURN"] = o.ResourceURN } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableMetadata struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information.go similarity index 68% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information.go index cfb245282..776ce7dab 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "time" ) +// checks if the MetadataWithAutoCertificateInformation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithAutoCertificateInformation{} + // MetadataWithAutoCertificateInformation struct for MetadataWithAutoCertificateInformation type MetadataWithAutoCertificateInformation struct { // The ISO 8601 creation timestamp. @@ -32,9 +36,9 @@ type MetadataWithAutoCertificateInformation struct { // Unique name of the resource. ResourceURN *string `json:"resourceURN,omitempty"` // The resource state. - State *string `json:"state"` + State string `json:"state"` // A human readable message describing the current state. In case of an error, the message will contain a detailed error message. - Message *string `json:"message"` + Message string `json:"message"` // The ID of the last certificate that was issued. LastIssuedCertificate *string `json:"lastIssuedCertificate,omitempty"` } @@ -46,8 +50,8 @@ type MetadataWithAutoCertificateInformation struct { func NewMetadataWithAutoCertificateInformation(state string, message string) *MetadataWithAutoCertificateInformation { this := MetadataWithAutoCertificateInformation{} - this.State = &state - this.Message = &message + this.State = state + this.Message = message return &this } @@ -60,443 +64,339 @@ func NewMetadataWithAutoCertificateInformationWithDefaults() *MetadataWithAutoCe return &this } -// GetCreatedDate returns the CreatedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithAutoCertificateInformation) GetCreatedDate() *time.Time { - if o == nil { - return nil - } - - if o.CreatedDate == nil { - return nil +// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetCreatedDate() time.Time { + if o == nil || IsNil(o.CreatedDate) { + var ret time.Time + return ret } - return &o.CreatedDate.Time - + return o.CreatedDate.Time } -// GetCreatedDateOk returns a tuple with the CreatedDate field value +// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetCreatedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.CreatedDate == nil { + if o == nil || IsNil(o.CreatedDate) { return nil, false } return &o.CreatedDate.Time, true - -} - -// SetCreatedDate sets field value -func (o *MetadataWithAutoCertificateInformation) SetCreatedDate(v time.Time) { - - o.CreatedDate = &IonosTime{v} - } // HasCreatedDate returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasCreatedDate() bool { - if o != nil && o.CreatedDate != nil { + if o != nil && !IsNil(o.CreatedDate) { return true } return false } -// GetCreatedBy returns the CreatedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetCreatedBy() *string { - if o == nil { - return nil - } - - return o.CreatedBy +// SetCreatedDate gets a reference to the given time.Time and assigns it to the CreatedDate field. +func (o *MetadataWithAutoCertificateInformation) SetCreatedDate(v time.Time) { + o.CreatedDate = &IonosTime{v} +} +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetCreatedBy() string { + if o == nil || IsNil(o.CreatedBy) { + var ret string + return ret + } + return *o.CreatedBy } -// GetCreatedByOk returns a tuple with the CreatedBy field value +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetCreatedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedBy) { return nil, false } - return o.CreatedBy, true } -// SetCreatedBy sets field value -func (o *MetadataWithAutoCertificateInformation) SetCreatedBy(v string) { - - o.CreatedBy = &v - -} - // HasCreatedBy returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasCreatedBy() bool { - if o != nil && o.CreatedBy != nil { + if o != nil && !IsNil(o.CreatedBy) { return true } return false } -// GetCreatedByUserId returns the CreatedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetCreatedByUserId() *string { - if o == nil { - return nil - } - - return o.CreatedByUserId +// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field. +func (o *MetadataWithAutoCertificateInformation) SetCreatedBy(v string) { + o.CreatedBy = &v +} +// GetCreatedByUserId returns the CreatedByUserId field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetCreatedByUserId() string { + if o == nil || IsNil(o.CreatedByUserId) { + var ret string + return ret + } + return *o.CreatedByUserId } -// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetCreatedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedByUserId) { return nil, false } - return o.CreatedByUserId, true } -// SetCreatedByUserId sets field value -func (o *MetadataWithAutoCertificateInformation) SetCreatedByUserId(v string) { - - o.CreatedByUserId = &v - -} - // HasCreatedByUserId returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasCreatedByUserId() bool { - if o != nil && o.CreatedByUserId != nil { + if o != nil && !IsNil(o.CreatedByUserId) { return true } return false } -// GetLastModifiedDate returns the LastModifiedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithAutoCertificateInformation) GetLastModifiedDate() *time.Time { - if o == nil { - return nil - } +// SetCreatedByUserId gets a reference to the given string and assigns it to the CreatedByUserId field. +func (o *MetadataWithAutoCertificateInformation) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v +} - if o.LastModifiedDate == nil { - return nil +// GetLastModifiedDate returns the LastModifiedDate field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetLastModifiedDate() time.Time { + if o == nil || IsNil(o.LastModifiedDate) { + var ret time.Time + return ret } - return &o.LastModifiedDate.Time - + return o.LastModifiedDate.Time } -// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value +// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetLastModifiedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.LastModifiedDate == nil { + if o == nil || IsNil(o.LastModifiedDate) { return nil, false } return &o.LastModifiedDate.Time, true - -} - -// SetLastModifiedDate sets field value -func (o *MetadataWithAutoCertificateInformation) SetLastModifiedDate(v time.Time) { - - o.LastModifiedDate = &IonosTime{v} - } // HasLastModifiedDate returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasLastModifiedDate() bool { - if o != nil && o.LastModifiedDate != nil { + if o != nil && !IsNil(o.LastModifiedDate) { return true } return false } -// GetLastModifiedBy returns the LastModifiedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetLastModifiedBy() *string { - if o == nil { - return nil - } - - return o.LastModifiedBy +// SetLastModifiedDate gets a reference to the given time.Time and assigns it to the LastModifiedDate field. +func (o *MetadataWithAutoCertificateInformation) SetLastModifiedDate(v time.Time) { + o.LastModifiedDate = &IonosTime{v} +} +// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetLastModifiedBy() string { + if o == nil || IsNil(o.LastModifiedBy) { + var ret string + return ret + } + return *o.LastModifiedBy } -// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value +// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetLastModifiedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedBy) { return nil, false } - return o.LastModifiedBy, true } -// SetLastModifiedBy sets field value -func (o *MetadataWithAutoCertificateInformation) SetLastModifiedBy(v string) { - - o.LastModifiedBy = &v - -} - // HasLastModifiedBy returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasLastModifiedBy() bool { - if o != nil && o.LastModifiedBy != nil { + if o != nil && !IsNil(o.LastModifiedBy) { return true } return false } -// GetLastModifiedByUserId returns the LastModifiedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetLastModifiedByUserId() *string { - if o == nil { - return nil - } - - return o.LastModifiedByUserId +// SetLastModifiedBy gets a reference to the given string and assigns it to the LastModifiedBy field. +func (o *MetadataWithAutoCertificateInformation) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v +} +// GetLastModifiedByUserId returns the LastModifiedByUserId field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetLastModifiedByUserId() string { + if o == nil || IsNil(o.LastModifiedByUserId) { + var ret string + return ret + } + return *o.LastModifiedByUserId } -// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value +// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetLastModifiedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedByUserId) { return nil, false } - return o.LastModifiedByUserId, true } -// SetLastModifiedByUserId sets field value -func (o *MetadataWithAutoCertificateInformation) SetLastModifiedByUserId(v string) { - - o.LastModifiedByUserId = &v - -} - // HasLastModifiedByUserId returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasLastModifiedByUserId() bool { - if o != nil && o.LastModifiedByUserId != nil { + if o != nil && !IsNil(o.LastModifiedByUserId) { return true } return false } -// GetResourceURN returns the ResourceURN field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetResourceURN() *string { - if o == nil { - return nil - } - - return o.ResourceURN +// SetLastModifiedByUserId gets a reference to the given string and assigns it to the LastModifiedByUserId field. +func (o *MetadataWithAutoCertificateInformation) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v +} +// GetResourceURN returns the ResourceURN field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetResourceURN() string { + if o == nil || IsNil(o.ResourceURN) { + var ret string + return ret + } + return *o.ResourceURN } -// GetResourceURNOk returns a tuple with the ResourceURN field value +// GetResourceURNOk returns a tuple with the ResourceURN field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetResourceURNOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ResourceURN) { return nil, false } - return o.ResourceURN, true } -// SetResourceURN sets field value -func (o *MetadataWithAutoCertificateInformation) SetResourceURN(v string) { - - o.ResourceURN = &v - -} - // HasResourceURN returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasResourceURN() bool { - if o != nil && o.ResourceURN != nil { + if o != nil && !IsNil(o.ResourceURN) { return true } return false } +// SetResourceURN gets a reference to the given string and assigns it to the ResourceURN field. +func (o *MetadataWithAutoCertificateInformation) SetResourceURN(v string) { + o.ResourceURN = &v +} + // GetState returns the State field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetState() *string { +func (o *MetadataWithAutoCertificateInformation) GetState() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetStateOk() (*string, bool) { if o == nil { return nil, false } - - return o.State, true + return &o.State, true } // SetState sets field value func (o *MetadataWithAutoCertificateInformation) SetState(v string) { - - o.State = &v - -} - -// HasState returns a boolean if a field has been set. -func (o *MetadataWithAutoCertificateInformation) HasState() bool { - if o != nil && o.State != nil { - return true - } - - return false + o.State = v } // GetMessage returns the Message field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetMessage() *string { +func (o *MetadataWithAutoCertificateInformation) GetMessage() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetMessageOk() (*string, bool) { if o == nil { return nil, false } - - return o.Message, true + return &o.Message, true } // SetMessage sets field value func (o *MetadataWithAutoCertificateInformation) SetMessage(v string) { - - o.Message = &v - -} - -// HasMessage returns a boolean if a field has been set. -func (o *MetadataWithAutoCertificateInformation) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false + o.Message = v } -// GetLastIssuedCertificate returns the LastIssuedCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformation) GetLastIssuedCertificate() *string { - if o == nil { - return nil +// GetLastIssuedCertificate returns the LastIssuedCertificate field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformation) GetLastIssuedCertificate() string { + if o == nil || IsNil(o.LastIssuedCertificate) { + var ret string + return ret } - - return o.LastIssuedCertificate - + return *o.LastIssuedCertificate } -// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value +// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformation) GetLastIssuedCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastIssuedCertificate) { return nil, false } - return o.LastIssuedCertificate, true } -// SetLastIssuedCertificate sets field value -func (o *MetadataWithAutoCertificateInformation) SetLastIssuedCertificate(v string) { - - o.LastIssuedCertificate = &v - -} - // HasLastIssuedCertificate returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformation) HasLastIssuedCertificate() bool { - if o != nil && o.LastIssuedCertificate != nil { + if o != nil && !IsNil(o.LastIssuedCertificate) { return true } return false } -func (o MetadataWithAutoCertificateInformation) MarshalJSON() ([]byte, error) { +// SetLastIssuedCertificate gets a reference to the given string and assigns it to the LastIssuedCertificate field. +func (o *MetadataWithAutoCertificateInformation) SetLastIssuedCertificate(v string) { + o.LastIssuedCertificate = &v +} + +func (o MetadataWithAutoCertificateInformation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CreatedDate != nil { + if !IsNil(o.CreatedDate) { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { + if !IsNil(o.CreatedBy) { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { + if !IsNil(o.CreatedByUserId) { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { + if !IsNil(o.LastModifiedDate) { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { + if !IsNil(o.LastModifiedBy) { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { + if !IsNil(o.LastModifiedByUserId) { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - - if o.ResourceURN != nil { + if !IsNil(o.ResourceURN) { toSerialize["resourceURN"] = o.ResourceURN } - - if o.State != nil { - toSerialize["state"] = o.State - } - - if o.Message != nil { - toSerialize["message"] = o.Message - } - - if o.LastIssuedCertificate != nil { + toSerialize["state"] = o.State + toSerialize["message"] = o.Message + if !IsNil(o.LastIssuedCertificate) { toSerialize["lastIssuedCertificate"] = o.LastIssuedCertificate } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableMetadataWithAutoCertificateInformation struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information_all_of.go similarity index 83% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information_all_of.go index a3adece1a..8ce4d410b 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_auto_certificate_information_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_auto_certificate_information_all_of.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the MetadataWithAutoCertificateInformationAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithAutoCertificateInformationAllOf{} + // MetadataWithAutoCertificateInformationAllOf struct for MetadataWithAutoCertificateInformationAllOf type MetadataWithAutoCertificateInformationAllOf struct { // The ID of the last certificate that was issued. @@ -38,51 +41,44 @@ func NewMetadataWithAutoCertificateInformationAllOfWithDefaults() *MetadataWithA return &this } -// GetLastIssuedCertificate returns the LastIssuedCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithAutoCertificateInformationAllOf) GetLastIssuedCertificate() *string { - if o == nil { - return nil +// GetLastIssuedCertificate returns the LastIssuedCertificate field value if set, zero value otherwise. +func (o *MetadataWithAutoCertificateInformationAllOf) GetLastIssuedCertificate() string { + if o == nil || IsNil(o.LastIssuedCertificate) { + var ret string + return ret } - - return o.LastIssuedCertificate - + return *o.LastIssuedCertificate } -// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value +// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithAutoCertificateInformationAllOf) GetLastIssuedCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastIssuedCertificate) { return nil, false } - return o.LastIssuedCertificate, true } -// SetLastIssuedCertificate sets field value -func (o *MetadataWithAutoCertificateInformationAllOf) SetLastIssuedCertificate(v string) { - - o.LastIssuedCertificate = &v - -} - // HasLastIssuedCertificate returns a boolean if a field has been set. func (o *MetadataWithAutoCertificateInformationAllOf) HasLastIssuedCertificate() bool { - if o != nil && o.LastIssuedCertificate != nil { + if o != nil && !IsNil(o.LastIssuedCertificate) { return true } return false } -func (o MetadataWithAutoCertificateInformationAllOf) MarshalJSON() ([]byte, error) { +// SetLastIssuedCertificate gets a reference to the given string and assigns it to the LastIssuedCertificate field. +func (o *MetadataWithAutoCertificateInformationAllOf) SetLastIssuedCertificate(v string) { + o.LastIssuedCertificate = &v +} + +func (o MetadataWithAutoCertificateInformationAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.LastIssuedCertificate != nil { + if !IsNil(o.LastIssuedCertificate) { toSerialize["lastIssuedCertificate"] = o.LastIssuedCertificate } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableMetadataWithAutoCertificateInformationAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information.go similarity index 61% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information.go index 02b37449e..3a52f2b9e 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "time" ) +// checks if the MetadataWithCertificateInformation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithCertificateInformation{} + // MetadataWithCertificateInformation struct for MetadataWithCertificateInformation type MetadataWithCertificateInformation struct { // The ISO 8601 creation timestamp. @@ -32,25 +36,25 @@ type MetadataWithCertificateInformation struct { // Unique name of the resource. ResourceURN *string `json:"resourceURN,omitempty"` // The resource state. - State *string `json:"state"` + State string `json:"state"` // A human readable message describing the current state. In case of an error, the message will contain a detailed error message. - Message *string `json:"message"` + Message string `json:"message"` // The ID of the auto-certificate that caused issuing of the certificate. AutoCertificate *string `json:"autoCertificate,omitempty"` // The ID of the last issued certificate that belongs to the same auto-certificate. LastIssuedCertificate *string `json:"lastIssuedCertificate,omitempty"` // Indicates if the certificate is expired. - Expired *bool `json:"expired"` + Expired bool `json:"expired"` // The start date of the certificate. NotBefore *IonosTime `json:"notBefore"` // The end date of the certificate. NotAfter *IonosTime `json:"notAfter"` // The serial number of the certificate in hex. - SerialNumber *string `json:"serialNumber"` + SerialNumber string `json:"serialNumber"` // The common name (DNS) of the certificate. - CommonName *string `json:"commonName"` + CommonName string `json:"commonName"` // Optional additional names added to the issued certificate. The additional names needs to be part of a zone in IONOS Cloud DNS. - SubjectAlternativeNames *[]string `json:"subjectAlternativeNames"` + SubjectAlternativeNames []string `json:"subjectAlternativeNames"` } // NewMetadataWithCertificateInformation instantiates a new MetadataWithCertificateInformation object @@ -60,14 +64,14 @@ type MetadataWithCertificateInformation struct { func NewMetadataWithCertificateInformation(state string, message string, expired bool, notBefore time.Time, notAfter time.Time, serialNumber string, commonName string, subjectAlternativeNames []string) *MetadataWithCertificateInformation { this := MetadataWithCertificateInformation{} - this.State = &state - this.Message = &message - this.Expired = &expired + this.State = state + this.Message = message + this.Expired = expired this.NotBefore = &IonosTime{notBefore} this.NotAfter = &IonosTime{notAfter} - this.SerialNumber = &serialNumber - this.CommonName = &commonName - this.SubjectAlternativeNames = &subjectAlternativeNames + this.SerialNumber = serialNumber + this.CommonName = commonName + this.SubjectAlternativeNames = subjectAlternativeNames return &this } @@ -80,751 +84,538 @@ func NewMetadataWithCertificateInformationWithDefaults() *MetadataWithCertificat return &this } -// GetCreatedDate returns the CreatedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformation) GetCreatedDate() *time.Time { - if o == nil { - return nil - } - - if o.CreatedDate == nil { - return nil +// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetCreatedDate() time.Time { + if o == nil || IsNil(o.CreatedDate) { + var ret time.Time + return ret } - return &o.CreatedDate.Time - + return o.CreatedDate.Time } -// GetCreatedDateOk returns a tuple with the CreatedDate field value +// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetCreatedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.CreatedDate == nil { + if o == nil || IsNil(o.CreatedDate) { return nil, false } return &o.CreatedDate.Time, true - -} - -// SetCreatedDate sets field value -func (o *MetadataWithCertificateInformation) SetCreatedDate(v time.Time) { - - o.CreatedDate = &IonosTime{v} - } // HasCreatedDate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasCreatedDate() bool { - if o != nil && o.CreatedDate != nil { + if o != nil && !IsNil(o.CreatedDate) { return true } return false } -// GetCreatedBy returns the CreatedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetCreatedBy() *string { - if o == nil { - return nil - } - - return o.CreatedBy +// SetCreatedDate gets a reference to the given time.Time and assigns it to the CreatedDate field. +func (o *MetadataWithCertificateInformation) SetCreatedDate(v time.Time) { + o.CreatedDate = &IonosTime{v} +} +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetCreatedBy() string { + if o == nil || IsNil(o.CreatedBy) { + var ret string + return ret + } + return *o.CreatedBy } -// GetCreatedByOk returns a tuple with the CreatedBy field value +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetCreatedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedBy) { return nil, false } - return o.CreatedBy, true } -// SetCreatedBy sets field value -func (o *MetadataWithCertificateInformation) SetCreatedBy(v string) { - - o.CreatedBy = &v - -} - // HasCreatedBy returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasCreatedBy() bool { - if o != nil && o.CreatedBy != nil { + if o != nil && !IsNil(o.CreatedBy) { return true } return false } -// GetCreatedByUserId returns the CreatedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetCreatedByUserId() *string { - if o == nil { - return nil - } - - return o.CreatedByUserId +// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field. +func (o *MetadataWithCertificateInformation) SetCreatedBy(v string) { + o.CreatedBy = &v +} +// GetCreatedByUserId returns the CreatedByUserId field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetCreatedByUserId() string { + if o == nil || IsNil(o.CreatedByUserId) { + var ret string + return ret + } + return *o.CreatedByUserId } -// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetCreatedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedByUserId) { return nil, false } - return o.CreatedByUserId, true } -// SetCreatedByUserId sets field value -func (o *MetadataWithCertificateInformation) SetCreatedByUserId(v string) { - - o.CreatedByUserId = &v - -} - // HasCreatedByUserId returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasCreatedByUserId() bool { - if o != nil && o.CreatedByUserId != nil { + if o != nil && !IsNil(o.CreatedByUserId) { return true } return false } -// GetLastModifiedDate returns the LastModifiedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformation) GetLastModifiedDate() *time.Time { - if o == nil { - return nil - } +// SetCreatedByUserId gets a reference to the given string and assigns it to the CreatedByUserId field. +func (o *MetadataWithCertificateInformation) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v +} - if o.LastModifiedDate == nil { - return nil +// GetLastModifiedDate returns the LastModifiedDate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetLastModifiedDate() time.Time { + if o == nil || IsNil(o.LastModifiedDate) { + var ret time.Time + return ret } - return &o.LastModifiedDate.Time - + return o.LastModifiedDate.Time } -// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value +// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetLastModifiedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.LastModifiedDate == nil { + if o == nil || IsNil(o.LastModifiedDate) { return nil, false } return &o.LastModifiedDate.Time, true - -} - -// SetLastModifiedDate sets field value -func (o *MetadataWithCertificateInformation) SetLastModifiedDate(v time.Time) { - - o.LastModifiedDate = &IonosTime{v} - } // HasLastModifiedDate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasLastModifiedDate() bool { - if o != nil && o.LastModifiedDate != nil { + if o != nil && !IsNil(o.LastModifiedDate) { return true } return false } -// GetLastModifiedBy returns the LastModifiedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetLastModifiedBy() *string { - if o == nil { - return nil - } - - return o.LastModifiedBy +// SetLastModifiedDate gets a reference to the given time.Time and assigns it to the LastModifiedDate field. +func (o *MetadataWithCertificateInformation) SetLastModifiedDate(v time.Time) { + o.LastModifiedDate = &IonosTime{v} +} +// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetLastModifiedBy() string { + if o == nil || IsNil(o.LastModifiedBy) { + var ret string + return ret + } + return *o.LastModifiedBy } -// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value +// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetLastModifiedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedBy) { return nil, false } - return o.LastModifiedBy, true } -// SetLastModifiedBy sets field value -func (o *MetadataWithCertificateInformation) SetLastModifiedBy(v string) { - - o.LastModifiedBy = &v - -} - // HasLastModifiedBy returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasLastModifiedBy() bool { - if o != nil && o.LastModifiedBy != nil { + if o != nil && !IsNil(o.LastModifiedBy) { return true } return false } -// GetLastModifiedByUserId returns the LastModifiedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetLastModifiedByUserId() *string { - if o == nil { - return nil - } - - return o.LastModifiedByUserId +// SetLastModifiedBy gets a reference to the given string and assigns it to the LastModifiedBy field. +func (o *MetadataWithCertificateInformation) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v +} +// GetLastModifiedByUserId returns the LastModifiedByUserId field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetLastModifiedByUserId() string { + if o == nil || IsNil(o.LastModifiedByUserId) { + var ret string + return ret + } + return *o.LastModifiedByUserId } -// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value +// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetLastModifiedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedByUserId) { return nil, false } - return o.LastModifiedByUserId, true } -// SetLastModifiedByUserId sets field value -func (o *MetadataWithCertificateInformation) SetLastModifiedByUserId(v string) { - - o.LastModifiedByUserId = &v - -} - // HasLastModifiedByUserId returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasLastModifiedByUserId() bool { - if o != nil && o.LastModifiedByUserId != nil { + if o != nil && !IsNil(o.LastModifiedByUserId) { return true } return false } -// GetResourceURN returns the ResourceURN field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetResourceURN() *string { - if o == nil { - return nil - } - - return o.ResourceURN +// SetLastModifiedByUserId gets a reference to the given string and assigns it to the LastModifiedByUserId field. +func (o *MetadataWithCertificateInformation) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v +} +// GetResourceURN returns the ResourceURN field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetResourceURN() string { + if o == nil || IsNil(o.ResourceURN) { + var ret string + return ret + } + return *o.ResourceURN } -// GetResourceURNOk returns a tuple with the ResourceURN field value +// GetResourceURNOk returns a tuple with the ResourceURN field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetResourceURNOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ResourceURN) { return nil, false } - return o.ResourceURN, true } -// SetResourceURN sets field value -func (o *MetadataWithCertificateInformation) SetResourceURN(v string) { - - o.ResourceURN = &v - -} - // HasResourceURN returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasResourceURN() bool { - if o != nil && o.ResourceURN != nil { + if o != nil && !IsNil(o.ResourceURN) { return true } return false } +// SetResourceURN gets a reference to the given string and assigns it to the ResourceURN field. +func (o *MetadataWithCertificateInformation) SetResourceURN(v string) { + o.ResourceURN = &v +} + // GetState returns the State field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetState() *string { +func (o *MetadataWithCertificateInformation) GetState() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetStateOk() (*string, bool) { if o == nil { return nil, false } - - return o.State, true + return &o.State, true } // SetState sets field value func (o *MetadataWithCertificateInformation) SetState(v string) { - - o.State = &v - -} - -// HasState returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasState() bool { - if o != nil && o.State != nil { - return true - } - - return false + o.State = v } // GetMessage returns the Message field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetMessage() *string { +func (o *MetadataWithCertificateInformation) GetMessage() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetMessageOk() (*string, bool) { if o == nil { return nil, false } - - return o.Message, true + return &o.Message, true } // SetMessage sets field value func (o *MetadataWithCertificateInformation) SetMessage(v string) { - - o.Message = &v - -} - -// HasMessage returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false + o.Message = v } -// GetAutoCertificate returns the AutoCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetAutoCertificate() *string { - if o == nil { - return nil +// GetAutoCertificate returns the AutoCertificate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetAutoCertificate() string { + if o == nil || IsNil(o.AutoCertificate) { + var ret string + return ret } - - return o.AutoCertificate - + return *o.AutoCertificate } -// GetAutoCertificateOk returns a tuple with the AutoCertificate field value +// GetAutoCertificateOk returns a tuple with the AutoCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetAutoCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.AutoCertificate) { return nil, false } - return o.AutoCertificate, true } -// SetAutoCertificate sets field value -func (o *MetadataWithCertificateInformation) SetAutoCertificate(v string) { - - o.AutoCertificate = &v - -} - // HasAutoCertificate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasAutoCertificate() bool { - if o != nil && o.AutoCertificate != nil { + if o != nil && !IsNil(o.AutoCertificate) { return true } return false } -// GetLastIssuedCertificate returns the LastIssuedCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetLastIssuedCertificate() *string { - if o == nil { - return nil - } - - return o.LastIssuedCertificate +// SetAutoCertificate gets a reference to the given string and assigns it to the AutoCertificate field. +func (o *MetadataWithCertificateInformation) SetAutoCertificate(v string) { + o.AutoCertificate = &v +} +// GetLastIssuedCertificate returns the LastIssuedCertificate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformation) GetLastIssuedCertificate() string { + if o == nil || IsNil(o.LastIssuedCertificate) { + var ret string + return ret + } + return *o.LastIssuedCertificate } -// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value +// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformation) GetLastIssuedCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastIssuedCertificate) { return nil, false } - return o.LastIssuedCertificate, true } -// SetLastIssuedCertificate sets field value -func (o *MetadataWithCertificateInformation) SetLastIssuedCertificate(v string) { - - o.LastIssuedCertificate = &v - -} - // HasLastIssuedCertificate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformation) HasLastIssuedCertificate() bool { - if o != nil && o.LastIssuedCertificate != nil { + if o != nil && !IsNil(o.LastIssuedCertificate) { return true } return false } +// SetLastIssuedCertificate gets a reference to the given string and assigns it to the LastIssuedCertificate field. +func (o *MetadataWithCertificateInformation) SetLastIssuedCertificate(v string) { + o.LastIssuedCertificate = &v +} + // GetExpired returns the Expired field value -// If the value is explicit nil, the zero value for bool will be returned -func (o *MetadataWithCertificateInformation) GetExpired() *bool { +func (o *MetadataWithCertificateInformation) GetExpired() bool { if o == nil { - return nil + var ret bool + return ret } return o.Expired - } // GetExpiredOk returns a tuple with the Expired 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 *MetadataWithCertificateInformation) GetExpiredOk() (*bool, bool) { if o == nil { return nil, false } - - return o.Expired, true + return &o.Expired, true } // SetExpired sets field value func (o *MetadataWithCertificateInformation) SetExpired(v bool) { - - o.Expired = &v - -} - -// HasExpired returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasExpired() bool { - if o != nil && o.Expired != nil { - return true - } - - return false + o.Expired = v } // GetNotBefore returns the NotBefore field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformation) GetNotBefore() *time.Time { +func (o *MetadataWithCertificateInformation) GetNotBefore() time.Time { if o == nil { - return nil + var ret time.Time + return ret } if o.NotBefore == nil { - return nil + var ret time.Time + return ret } - return &o.NotBefore.Time - + return o.NotBefore.Time } // GetNotBeforeOk returns a tuple with the NotBefore 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 *MetadataWithCertificateInformation) GetNotBeforeOk() (*time.Time, bool) { if o == nil { return nil, false } - if o.NotBefore == nil { - return nil, false + return nil, true } return &o.NotBefore.Time, true - } // SetNotBefore sets field value func (o *MetadataWithCertificateInformation) SetNotBefore(v time.Time) { - o.NotBefore = &IonosTime{v} - -} - -// HasNotBefore returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasNotBefore() bool { - if o != nil && o.NotBefore != nil { - return true - } - - return false } // GetNotAfter returns the NotAfter field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformation) GetNotAfter() *time.Time { +func (o *MetadataWithCertificateInformation) GetNotAfter() time.Time { if o == nil { - return nil + var ret time.Time + return ret } if o.NotAfter == nil { - return nil + var ret time.Time + return ret } - return &o.NotAfter.Time - + return o.NotAfter.Time } // GetNotAfterOk returns a tuple with the NotAfter 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 *MetadataWithCertificateInformation) GetNotAfterOk() (*time.Time, bool) { if o == nil { return nil, false } - if o.NotAfter == nil { - return nil, false + return nil, true } return &o.NotAfter.Time, true - } // SetNotAfter sets field value func (o *MetadataWithCertificateInformation) SetNotAfter(v time.Time) { - o.NotAfter = &IonosTime{v} - -} - -// HasNotAfter returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasNotAfter() bool { - if o != nil && o.NotAfter != nil { - return true - } - - return false } // GetSerialNumber returns the SerialNumber field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetSerialNumber() *string { +func (o *MetadataWithCertificateInformation) GetSerialNumber() string { if o == nil { - return nil + var ret string + return ret } return o.SerialNumber - } // GetSerialNumberOk returns a tuple with the SerialNumber 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 *MetadataWithCertificateInformation) GetSerialNumberOk() (*string, bool) { if o == nil { return nil, false } - - return o.SerialNumber, true + return &o.SerialNumber, true } // SetSerialNumber sets field value func (o *MetadataWithCertificateInformation) SetSerialNumber(v string) { - - o.SerialNumber = &v - -} - -// HasSerialNumber returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasSerialNumber() bool { - if o != nil && o.SerialNumber != nil { - return true - } - - return false + o.SerialNumber = v } // GetCommonName returns the CommonName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformation) GetCommonName() *string { +func (o *MetadataWithCertificateInformation) GetCommonName() string { if o == nil { - return nil + var ret string + return ret } return o.CommonName - } // GetCommonNameOk returns a tuple with the CommonName 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 *MetadataWithCertificateInformation) GetCommonNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.CommonName, true + return &o.CommonName, true } // SetCommonName sets field value func (o *MetadataWithCertificateInformation) SetCommonName(v string) { - - o.CommonName = &v - -} - -// HasCommonName returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasCommonName() bool { - if o != nil && o.CommonName != nil { - return true - } - - return false + o.CommonName = v } // GetSubjectAlternativeNames returns the SubjectAlternativeNames field value -// If the value is explicit nil, the zero value for []string will be returned -func (o *MetadataWithCertificateInformation) GetSubjectAlternativeNames() *[]string { +func (o *MetadataWithCertificateInformation) GetSubjectAlternativeNames() []string { if o == nil { - return nil + var ret []string + return ret } return o.SubjectAlternativeNames - } // GetSubjectAlternativeNamesOk returns a tuple with the SubjectAlternativeNames 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 *MetadataWithCertificateInformation) GetSubjectAlternativeNamesOk() (*[]string, bool) { +func (o *MetadataWithCertificateInformation) GetSubjectAlternativeNamesOk() ([]string, bool) { if o == nil { return nil, false } - return o.SubjectAlternativeNames, true } // SetSubjectAlternativeNames sets field value func (o *MetadataWithCertificateInformation) SetSubjectAlternativeNames(v []string) { - - o.SubjectAlternativeNames = &v - + o.SubjectAlternativeNames = v } -// HasSubjectAlternativeNames returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformation) HasSubjectAlternativeNames() bool { - if o != nil && o.SubjectAlternativeNames != nil { - return true - } - - return false -} - -func (o MetadataWithCertificateInformation) MarshalJSON() ([]byte, error) { +func (o MetadataWithCertificateInformation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CreatedDate != nil { + if !IsNil(o.CreatedDate) { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { + if !IsNil(o.CreatedBy) { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { + if !IsNil(o.CreatedByUserId) { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { + if !IsNil(o.LastModifiedDate) { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { + if !IsNil(o.LastModifiedBy) { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { + if !IsNil(o.LastModifiedByUserId) { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - - if o.ResourceURN != nil { + if !IsNil(o.ResourceURN) { toSerialize["resourceURN"] = o.ResourceURN } - - if o.State != nil { - toSerialize["state"] = o.State - } - - if o.Message != nil { - toSerialize["message"] = o.Message - } - - if o.AutoCertificate != nil { + toSerialize["state"] = o.State + toSerialize["message"] = o.Message + if !IsNil(o.AutoCertificate) { toSerialize["autoCertificate"] = o.AutoCertificate } - - if o.LastIssuedCertificate != nil { + if !IsNil(o.LastIssuedCertificate) { toSerialize["lastIssuedCertificate"] = o.LastIssuedCertificate } - - if o.Expired != nil { - toSerialize["expired"] = o.Expired - } - - if o.NotBefore != nil { - toSerialize["notBefore"] = o.NotBefore - } - - if o.NotAfter != nil { - toSerialize["notAfter"] = o.NotAfter - } - - if o.SerialNumber != nil { - toSerialize["serialNumber"] = o.SerialNumber - } - - if o.CommonName != nil { - toSerialize["commonName"] = o.CommonName - } - - if o.SubjectAlternativeNames != nil { - toSerialize["subjectAlternativeNames"] = o.SubjectAlternativeNames - } - - return json.Marshal(toSerialize) + toSerialize["expired"] = o.Expired + toSerialize["notBefore"] = o.NotBefore + toSerialize["notAfter"] = o.NotAfter + toSerialize["serialNumber"] = o.SerialNumber + toSerialize["commonName"] = o.CommonName + toSerialize["subjectAlternativeNames"] = o.SubjectAlternativeNames + return toSerialize, nil } type NullableMetadataWithCertificateInformation struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information_all_of.go similarity index 65% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information_all_of.go index 1fc715bad..a170a8732 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_certificate_information_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_certificate_information_all_of.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "time" ) +// checks if the MetadataWithCertificateInformationAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithCertificateInformationAllOf{} + // MetadataWithCertificateInformationAllOf struct for MetadataWithCertificateInformationAllOf type MetadataWithCertificateInformationAllOf struct { // The ID of the auto-certificate that caused issuing of the certificate. @@ -22,17 +26,17 @@ type MetadataWithCertificateInformationAllOf struct { // The ID of the last issued certificate that belongs to the same auto-certificate. LastIssuedCertificate *string `json:"lastIssuedCertificate,omitempty"` // Indicates if the certificate is expired. - Expired *bool `json:"expired"` + Expired bool `json:"expired"` // The start date of the certificate. NotBefore *IonosTime `json:"notBefore"` // The end date of the certificate. NotAfter *IonosTime `json:"notAfter"` // The serial number of the certificate in hex. - SerialNumber *string `json:"serialNumber"` + SerialNumber string `json:"serialNumber"` // The common name (DNS) of the certificate. - CommonName *string `json:"commonName"` + CommonName string `json:"commonName"` // Optional additional names added to the issued certificate. The additional names needs to be part of a zone in IONOS Cloud DNS. - SubjectAlternativeNames *[]string `json:"subjectAlternativeNames"` + SubjectAlternativeNames []string `json:"subjectAlternativeNames"` } // NewMetadataWithCertificateInformationAllOf instantiates a new MetadataWithCertificateInformationAllOf object @@ -42,12 +46,12 @@ type MetadataWithCertificateInformationAllOf struct { func NewMetadataWithCertificateInformationAllOf(expired bool, notBefore time.Time, notAfter time.Time, serialNumber string, commonName string, subjectAlternativeNames []string) *MetadataWithCertificateInformationAllOf { this := MetadataWithCertificateInformationAllOf{} - this.Expired = &expired + this.Expired = expired this.NotBefore = &IonosTime{notBefore} this.NotAfter = &IonosTime{notAfter} - this.SerialNumber = &serialNumber - this.CommonName = &commonName - this.SubjectAlternativeNames = &subjectAlternativeNames + this.SerialNumber = serialNumber + this.CommonName = commonName + this.SubjectAlternativeNames = subjectAlternativeNames return &this } @@ -60,359 +64,243 @@ func NewMetadataWithCertificateInformationAllOfWithDefaults() *MetadataWithCerti return &this } -// GetAutoCertificate returns the AutoCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformationAllOf) GetAutoCertificate() *string { - if o == nil { - return nil +// GetAutoCertificate returns the AutoCertificate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformationAllOf) GetAutoCertificate() string { + if o == nil || IsNil(o.AutoCertificate) { + var ret string + return ret } - - return o.AutoCertificate - + return *o.AutoCertificate } -// GetAutoCertificateOk returns a tuple with the AutoCertificate field value +// GetAutoCertificateOk returns a tuple with the AutoCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformationAllOf) GetAutoCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.AutoCertificate) { return nil, false } - return o.AutoCertificate, true } -// SetAutoCertificate sets field value -func (o *MetadataWithCertificateInformationAllOf) SetAutoCertificate(v string) { - - o.AutoCertificate = &v - -} - // HasAutoCertificate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformationAllOf) HasAutoCertificate() bool { - if o != nil && o.AutoCertificate != nil { + if o != nil && !IsNil(o.AutoCertificate) { return true } return false } -// GetLastIssuedCertificate returns the LastIssuedCertificate field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformationAllOf) GetLastIssuedCertificate() *string { - if o == nil { - return nil - } - - return o.LastIssuedCertificate +// SetAutoCertificate gets a reference to the given string and assigns it to the AutoCertificate field. +func (o *MetadataWithCertificateInformationAllOf) SetAutoCertificate(v string) { + o.AutoCertificate = &v +} +// GetLastIssuedCertificate returns the LastIssuedCertificate field value if set, zero value otherwise. +func (o *MetadataWithCertificateInformationAllOf) GetLastIssuedCertificate() string { + if o == nil || IsNil(o.LastIssuedCertificate) { + var ret string + return ret + } + return *o.LastIssuedCertificate } -// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value +// GetLastIssuedCertificateOk returns a tuple with the LastIssuedCertificate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithCertificateInformationAllOf) GetLastIssuedCertificateOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastIssuedCertificate) { return nil, false } - return o.LastIssuedCertificate, true } -// SetLastIssuedCertificate sets field value -func (o *MetadataWithCertificateInformationAllOf) SetLastIssuedCertificate(v string) { - - o.LastIssuedCertificate = &v - -} - // HasLastIssuedCertificate returns a boolean if a field has been set. func (o *MetadataWithCertificateInformationAllOf) HasLastIssuedCertificate() bool { - if o != nil && o.LastIssuedCertificate != nil { + if o != nil && !IsNil(o.LastIssuedCertificate) { return true } return false } +// SetLastIssuedCertificate gets a reference to the given string and assigns it to the LastIssuedCertificate field. +func (o *MetadataWithCertificateInformationAllOf) SetLastIssuedCertificate(v string) { + o.LastIssuedCertificate = &v +} + // GetExpired returns the Expired field value -// If the value is explicit nil, the zero value for bool will be returned -func (o *MetadataWithCertificateInformationAllOf) GetExpired() *bool { +func (o *MetadataWithCertificateInformationAllOf) GetExpired() bool { if o == nil { - return nil + var ret bool + return ret } return o.Expired - } // GetExpiredOk returns a tuple with the Expired 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 *MetadataWithCertificateInformationAllOf) GetExpiredOk() (*bool, bool) { if o == nil { return nil, false } - - return o.Expired, true + return &o.Expired, true } // SetExpired sets field value func (o *MetadataWithCertificateInformationAllOf) SetExpired(v bool) { - - o.Expired = &v - -} - -// HasExpired returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasExpired() bool { - if o != nil && o.Expired != nil { - return true - } - - return false + o.Expired = v } // GetNotBefore returns the NotBefore field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformationAllOf) GetNotBefore() *time.Time { +func (o *MetadataWithCertificateInformationAllOf) GetNotBefore() time.Time { if o == nil { - return nil + var ret time.Time + return ret } if o.NotBefore == nil { - return nil + var ret time.Time + return ret } - return &o.NotBefore.Time - + return o.NotBefore.Time } // GetNotBeforeOk returns a tuple with the NotBefore 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 *MetadataWithCertificateInformationAllOf) GetNotBeforeOk() (*time.Time, bool) { if o == nil { return nil, false } - if o.NotBefore == nil { - return nil, false + return nil, true } return &o.NotBefore.Time, true - } // SetNotBefore sets field value func (o *MetadataWithCertificateInformationAllOf) SetNotBefore(v time.Time) { - o.NotBefore = &IonosTime{v} - -} - -// HasNotBefore returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasNotBefore() bool { - if o != nil && o.NotBefore != nil { - return true - } - - return false } // GetNotAfter returns the NotAfter field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithCertificateInformationAllOf) GetNotAfter() *time.Time { +func (o *MetadataWithCertificateInformationAllOf) GetNotAfter() time.Time { if o == nil { - return nil + var ret time.Time + return ret } if o.NotAfter == nil { - return nil + var ret time.Time + return ret } - return &o.NotAfter.Time - + return o.NotAfter.Time } // GetNotAfterOk returns a tuple with the NotAfter 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 *MetadataWithCertificateInformationAllOf) GetNotAfterOk() (*time.Time, bool) { if o == nil { return nil, false } - if o.NotAfter == nil { - return nil, false + return nil, true } return &o.NotAfter.Time, true - } // SetNotAfter sets field value func (o *MetadataWithCertificateInformationAllOf) SetNotAfter(v time.Time) { - o.NotAfter = &IonosTime{v} - -} - -// HasNotAfter returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasNotAfter() bool { - if o != nil && o.NotAfter != nil { - return true - } - - return false } // GetSerialNumber returns the SerialNumber field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformationAllOf) GetSerialNumber() *string { +func (o *MetadataWithCertificateInformationAllOf) GetSerialNumber() string { if o == nil { - return nil + var ret string + return ret } return o.SerialNumber - } // GetSerialNumberOk returns a tuple with the SerialNumber 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 *MetadataWithCertificateInformationAllOf) GetSerialNumberOk() (*string, bool) { if o == nil { return nil, false } - - return o.SerialNumber, true + return &o.SerialNumber, true } // SetSerialNumber sets field value func (o *MetadataWithCertificateInformationAllOf) SetSerialNumber(v string) { - - o.SerialNumber = &v - -} - -// HasSerialNumber returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasSerialNumber() bool { - if o != nil && o.SerialNumber != nil { - return true - } - - return false + o.SerialNumber = v } // GetCommonName returns the CommonName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithCertificateInformationAllOf) GetCommonName() *string { +func (o *MetadataWithCertificateInformationAllOf) GetCommonName() string { if o == nil { - return nil + var ret string + return ret } return o.CommonName - } // GetCommonNameOk returns a tuple with the CommonName 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 *MetadataWithCertificateInformationAllOf) GetCommonNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.CommonName, true + return &o.CommonName, true } // SetCommonName sets field value func (o *MetadataWithCertificateInformationAllOf) SetCommonName(v string) { - - o.CommonName = &v - -} - -// HasCommonName returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasCommonName() bool { - if o != nil && o.CommonName != nil { - return true - } - - return false + o.CommonName = v } // GetSubjectAlternativeNames returns the SubjectAlternativeNames field value -// If the value is explicit nil, the zero value for []string will be returned -func (o *MetadataWithCertificateInformationAllOf) GetSubjectAlternativeNames() *[]string { +func (o *MetadataWithCertificateInformationAllOf) GetSubjectAlternativeNames() []string { if o == nil { - return nil + var ret []string + return ret } return o.SubjectAlternativeNames - } // GetSubjectAlternativeNamesOk returns a tuple with the SubjectAlternativeNames 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 *MetadataWithCertificateInformationAllOf) GetSubjectAlternativeNamesOk() (*[]string, bool) { +func (o *MetadataWithCertificateInformationAllOf) GetSubjectAlternativeNamesOk() ([]string, bool) { if o == nil { return nil, false } - return o.SubjectAlternativeNames, true } // SetSubjectAlternativeNames sets field value func (o *MetadataWithCertificateInformationAllOf) SetSubjectAlternativeNames(v []string) { - - o.SubjectAlternativeNames = &v - + o.SubjectAlternativeNames = v } -// HasSubjectAlternativeNames returns a boolean if a field has been set. -func (o *MetadataWithCertificateInformationAllOf) HasSubjectAlternativeNames() bool { - if o != nil && o.SubjectAlternativeNames != nil { - return true - } - - return false -} - -func (o MetadataWithCertificateInformationAllOf) MarshalJSON() ([]byte, error) { +func (o MetadataWithCertificateInformationAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.AutoCertificate != nil { + if !IsNil(o.AutoCertificate) { toSerialize["autoCertificate"] = o.AutoCertificate } - - if o.LastIssuedCertificate != nil { + if !IsNil(o.LastIssuedCertificate) { toSerialize["lastIssuedCertificate"] = o.LastIssuedCertificate } - - if o.Expired != nil { - toSerialize["expired"] = o.Expired - } - - if o.NotBefore != nil { - toSerialize["notBefore"] = o.NotBefore - } - - if o.NotAfter != nil { - toSerialize["notAfter"] = o.NotAfter - } - - if o.SerialNumber != nil { - toSerialize["serialNumber"] = o.SerialNumber - } - - if o.CommonName != nil { - toSerialize["commonName"] = o.CommonName - } - - if o.SubjectAlternativeNames != nil { - toSerialize["subjectAlternativeNames"] = o.SubjectAlternativeNames - } - - return json.Marshal(toSerialize) + toSerialize["expired"] = o.Expired + toSerialize["notBefore"] = o.NotBefore + toSerialize["notAfter"] = o.NotAfter + toSerialize["serialNumber"] = o.SerialNumber + toSerialize["commonName"] = o.CommonName + toSerialize["subjectAlternativeNames"] = o.SubjectAlternativeNames + return toSerialize, nil } type NullableMetadataWithCertificateInformationAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status.go similarity index 63% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status.go index 5ba84ae1d..d4578899a 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" + "time" ) +// checks if the MetadataWithStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithStatus{} + // MetadataWithStatus struct for MetadataWithStatus type MetadataWithStatus struct { // The ISO 8601 creation timestamp. @@ -32,9 +36,9 @@ type MetadataWithStatus struct { // Unique name of the resource. ResourceURN *string `json:"resourceURN,omitempty"` // The resource state. - State *string `json:"state"` + State string `json:"state"` // A human readable message describing the current state. In case of an error, the message will contain a detailed error message. - Message *string `json:"message"` + Message string `json:"message"` } // NewMetadataWithStatus instantiates a new MetadataWithStatus object @@ -44,8 +48,8 @@ type MetadataWithStatus struct { func NewMetadataWithStatus(state string, message string) *MetadataWithStatus { this := MetadataWithStatus{} - this.State = &state - this.Message = &message + this.State = state + this.Message = message return &this } @@ -58,401 +62,304 @@ func NewMetadataWithStatusWithDefaults() *MetadataWithStatus { return &this } -// GetCreatedDate returns the CreatedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithStatus) GetCreatedDate() *time.Time { - if o == nil { - return nil - } - - if o.CreatedDate == nil { - return nil +// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetCreatedDate() time.Time { + if o == nil || IsNil(o.CreatedDate) { + var ret time.Time + return ret } - return &o.CreatedDate.Time - + return o.CreatedDate.Time } -// GetCreatedDateOk returns a tuple with the CreatedDate field value +// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetCreatedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.CreatedDate == nil { + if o == nil || IsNil(o.CreatedDate) { return nil, false } return &o.CreatedDate.Time, true - -} - -// SetCreatedDate sets field value -func (o *MetadataWithStatus) SetCreatedDate(v time.Time) { - - o.CreatedDate = &IonosTime{v} - } // HasCreatedDate returns a boolean if a field has been set. func (o *MetadataWithStatus) HasCreatedDate() bool { - if o != nil && o.CreatedDate != nil { + if o != nil && !IsNil(o.CreatedDate) { return true } return false } -// GetCreatedBy returns the CreatedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetCreatedBy() *string { - if o == nil { - return nil - } - - return o.CreatedBy +// SetCreatedDate gets a reference to the given time.Time and assigns it to the CreatedDate field. +func (o *MetadataWithStatus) SetCreatedDate(v time.Time) { + o.CreatedDate = &IonosTime{v} +} +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetCreatedBy() string { + if o == nil || IsNil(o.CreatedBy) { + var ret string + return ret + } + return *o.CreatedBy } -// GetCreatedByOk returns a tuple with the CreatedBy field value +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetCreatedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedBy) { return nil, false } - return o.CreatedBy, true } -// SetCreatedBy sets field value -func (o *MetadataWithStatus) SetCreatedBy(v string) { - - o.CreatedBy = &v - -} - // HasCreatedBy returns a boolean if a field has been set. func (o *MetadataWithStatus) HasCreatedBy() bool { - if o != nil && o.CreatedBy != nil { + if o != nil && !IsNil(o.CreatedBy) { return true } return false } -// GetCreatedByUserId returns the CreatedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetCreatedByUserId() *string { - if o == nil { - return nil - } - - return o.CreatedByUserId +// SetCreatedBy gets a reference to the given string and assigns it to the CreatedBy field. +func (o *MetadataWithStatus) SetCreatedBy(v string) { + o.CreatedBy = &v +} +// GetCreatedByUserId returns the CreatedByUserId field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetCreatedByUserId() string { + if o == nil || IsNil(o.CreatedByUserId) { + var ret string + return ret + } + return *o.CreatedByUserId } -// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value +// GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetCreatedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CreatedByUserId) { return nil, false } - return o.CreatedByUserId, true } -// SetCreatedByUserId sets field value -func (o *MetadataWithStatus) SetCreatedByUserId(v string) { - - o.CreatedByUserId = &v - -} - // HasCreatedByUserId returns a boolean if a field has been set. func (o *MetadataWithStatus) HasCreatedByUserId() bool { - if o != nil && o.CreatedByUserId != nil { + if o != nil && !IsNil(o.CreatedByUserId) { return true } return false } -// GetLastModifiedDate returns the LastModifiedDate field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *MetadataWithStatus) GetLastModifiedDate() *time.Time { - if o == nil { - return nil - } +// SetCreatedByUserId gets a reference to the given string and assigns it to the CreatedByUserId field. +func (o *MetadataWithStatus) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v +} - if o.LastModifiedDate == nil { - return nil +// GetLastModifiedDate returns the LastModifiedDate field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetLastModifiedDate() time.Time { + if o == nil || IsNil(o.LastModifiedDate) { + var ret time.Time + return ret } - return &o.LastModifiedDate.Time - + return o.LastModifiedDate.Time } -// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value +// GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetLastModifiedDateOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.LastModifiedDate == nil { + if o == nil || IsNil(o.LastModifiedDate) { return nil, false } return &o.LastModifiedDate.Time, true - -} - -// SetLastModifiedDate sets field value -func (o *MetadataWithStatus) SetLastModifiedDate(v time.Time) { - - o.LastModifiedDate = &IonosTime{v} - } // HasLastModifiedDate returns a boolean if a field has been set. func (o *MetadataWithStatus) HasLastModifiedDate() bool { - if o != nil && o.LastModifiedDate != nil { + if o != nil && !IsNil(o.LastModifiedDate) { return true } return false } -// GetLastModifiedBy returns the LastModifiedBy field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetLastModifiedBy() *string { - if o == nil { - return nil - } - - return o.LastModifiedBy +// SetLastModifiedDate gets a reference to the given time.Time and assigns it to the LastModifiedDate field. +func (o *MetadataWithStatus) SetLastModifiedDate(v time.Time) { + o.LastModifiedDate = &IonosTime{v} +} +// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetLastModifiedBy() string { + if o == nil || IsNil(o.LastModifiedBy) { + var ret string + return ret + } + return *o.LastModifiedBy } -// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value +// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetLastModifiedByOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedBy) { return nil, false } - return o.LastModifiedBy, true } -// SetLastModifiedBy sets field value -func (o *MetadataWithStatus) SetLastModifiedBy(v string) { - - o.LastModifiedBy = &v - -} - // HasLastModifiedBy returns a boolean if a field has been set. func (o *MetadataWithStatus) HasLastModifiedBy() bool { - if o != nil && o.LastModifiedBy != nil { + if o != nil && !IsNil(o.LastModifiedBy) { return true } return false } -// GetLastModifiedByUserId returns the LastModifiedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetLastModifiedByUserId() *string { - if o == nil { - return nil - } - - return o.LastModifiedByUserId +// SetLastModifiedBy gets a reference to the given string and assigns it to the LastModifiedBy field. +func (o *MetadataWithStatus) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v +} +// GetLastModifiedByUserId returns the LastModifiedByUserId field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetLastModifiedByUserId() string { + if o == nil || IsNil(o.LastModifiedByUserId) { + var ret string + return ret + } + return *o.LastModifiedByUserId } -// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value +// GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetLastModifiedByUserIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.LastModifiedByUserId) { return nil, false } - return o.LastModifiedByUserId, true } -// SetLastModifiedByUserId sets field value -func (o *MetadataWithStatus) SetLastModifiedByUserId(v string) { - - o.LastModifiedByUserId = &v - -} - // HasLastModifiedByUserId returns a boolean if a field has been set. func (o *MetadataWithStatus) HasLastModifiedByUserId() bool { - if o != nil && o.LastModifiedByUserId != nil { + if o != nil && !IsNil(o.LastModifiedByUserId) { return true } return false } -// GetResourceURN returns the ResourceURN field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetResourceURN() *string { - if o == nil { - return nil - } - - return o.ResourceURN +// SetLastModifiedByUserId gets a reference to the given string and assigns it to the LastModifiedByUserId field. +func (o *MetadataWithStatus) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v +} +// GetResourceURN returns the ResourceURN field value if set, zero value otherwise. +func (o *MetadataWithStatus) GetResourceURN() string { + if o == nil || IsNil(o.ResourceURN) { + var ret string + return ret + } + return *o.ResourceURN } -// GetResourceURNOk returns a tuple with the ResourceURN field value +// GetResourceURNOk returns a tuple with the ResourceURN field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetResourceURNOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ResourceURN) { return nil, false } - return o.ResourceURN, true } -// SetResourceURN sets field value -func (o *MetadataWithStatus) SetResourceURN(v string) { - - o.ResourceURN = &v - -} - // HasResourceURN returns a boolean if a field has been set. func (o *MetadataWithStatus) HasResourceURN() bool { - if o != nil && o.ResourceURN != nil { + if o != nil && !IsNil(o.ResourceURN) { return true } return false } +// SetResourceURN gets a reference to the given string and assigns it to the ResourceURN field. +func (o *MetadataWithStatus) SetResourceURN(v string) { + o.ResourceURN = &v +} + // GetState returns the State field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetState() *string { +func (o *MetadataWithStatus) GetState() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetStateOk() (*string, bool) { if o == nil { return nil, false } - - return o.State, true + return &o.State, true } // SetState sets field value func (o *MetadataWithStatus) SetState(v string) { - - o.State = &v - -} - -// HasState returns a boolean if a field has been set. -func (o *MetadataWithStatus) HasState() bool { - if o != nil && o.State != nil { - return true - } - - return false + o.State = v } // GetMessage returns the Message field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatus) GetMessage() *string { +func (o *MetadataWithStatus) GetMessage() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatus) GetMessageOk() (*string, bool) { if o == nil { return nil, false } - - return o.Message, true + return &o.Message, true } // SetMessage sets field value func (o *MetadataWithStatus) SetMessage(v string) { - - o.Message = &v - + o.Message = v } -// HasMessage returns a boolean if a field has been set. -func (o *MetadataWithStatus) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -func (o MetadataWithStatus) MarshalJSON() ([]byte, error) { +func (o MetadataWithStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.CreatedDate != nil { + if !IsNil(o.CreatedDate) { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { + if !IsNil(o.CreatedBy) { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { + if !IsNil(o.CreatedByUserId) { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { + if !IsNil(o.LastModifiedDate) { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { + if !IsNil(o.LastModifiedBy) { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { + if !IsNil(o.LastModifiedByUserId) { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - - if o.ResourceURN != nil { + if !IsNil(o.ResourceURN) { toSerialize["resourceURN"] = o.ResourceURN } - - if o.State != nil { - toSerialize["state"] = o.State - } - - if o.Message != nil { - toSerialize["message"] = o.Message - } - - return json.Marshal(toSerialize) + toSerialize["state"] = o.State + toSerialize["message"] = o.Message + return toSerialize, nil } type NullableMetadataWithStatus struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status_all_of.go similarity index 73% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status_all_of.go index 6898f06c6..1e88d3d16 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_metadata_with_status_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_metadata_with_status_all_of.go @@ -8,18 +8,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the MetadataWithStatusAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataWithStatusAllOf{} + // MetadataWithStatusAllOf struct for MetadataWithStatusAllOf type MetadataWithStatusAllOf struct { // The resource state. - State *string `json:"state"` + State string `json:"state"` // A human readable message describing the current state. In case of an error, the message will contain a detailed error message. - Message *string `json:"message"` + Message string `json:"message"` } // NewMetadataWithStatusAllOf instantiates a new MetadataWithStatusAllOf object @@ -29,8 +32,8 @@ type MetadataWithStatusAllOf struct { func NewMetadataWithStatusAllOf(state string, message string) *MetadataWithStatusAllOf { this := MetadataWithStatusAllOf{} - this.State = &state - this.Message = &message + this.State = state + this.Message = message return &this } @@ -44,92 +47,58 @@ func NewMetadataWithStatusAllOfWithDefaults() *MetadataWithStatusAllOf { } // GetState returns the State field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatusAllOf) GetState() *string { +func (o *MetadataWithStatusAllOf) GetState() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatusAllOf) GetStateOk() (*string, bool) { if o == nil { return nil, false } - - return o.State, true + return &o.State, true } // SetState sets field value func (o *MetadataWithStatusAllOf) SetState(v string) { - - o.State = &v - -} - -// HasState returns a boolean if a field has been set. -func (o *MetadataWithStatusAllOf) HasState() bool { - if o != nil && o.State != nil { - return true - } - - return false + o.State = v } // GetMessage returns the Message field value -// If the value is explicit nil, the zero value for string will be returned -func (o *MetadataWithStatusAllOf) GetMessage() *string { +func (o *MetadataWithStatusAllOf) GetMessage() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadataWithStatusAllOf) GetMessageOk() (*string, bool) { if o == nil { return nil, false } - - return o.Message, true + return &o.Message, true } // SetMessage sets field value func (o *MetadataWithStatusAllOf) SetMessage(v string) { - - o.Message = &v - -} - -// HasMessage returns a boolean if a field has been set. -func (o *MetadataWithStatusAllOf) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false + o.Message = v } -func (o MetadataWithStatusAllOf) MarshalJSON() ([]byte, error) { +func (o MetadataWithStatusAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.State != nil { - toSerialize["state"] = o.State - } - - if o.Message != nil { - toSerialize["message"] = o.Message - } - - return json.Marshal(toSerialize) + toSerialize["state"] = o.State + toSerialize["message"] = o.Message + return toSerialize, nil } type NullableMetadataWithStatusAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_pagination.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_pagination.go similarity index 68% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_pagination.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_pagination.go index 6710724c1..8180cf098 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_pagination.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_pagination.go @@ -8,19 +8,22 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + // Pagination Pagination information. The offset and limit parameters are used to navigate the list of elements. The _links object contains URLs to navigate the different pages. type Pagination struct { // The offset specified in the request (if none was specified, the default offset is 0). - Offset *int32 `json:"offset"` + Offset int32 `json:"offset"` // The limit specified in the request (if none was specified, use the endpoint's default pagination limit). - Limit *int32 `json:"limit"` - Links *Links `json:"_links"` + Limit int32 `json:"limit"` + Links Links `json:"_links"` } // NewPagination instantiates a new Pagination object @@ -30,9 +33,9 @@ type Pagination struct { func NewPagination(offset int32, limit int32, links Links) *Pagination { this := Pagination{} - this.Offset = &offset - this.Limit = &limit - this.Links = &links + this.Offset = offset + this.Limit = limit + this.Links = links return &this } @@ -46,134 +49,83 @@ func NewPaginationWithDefaults() *Pagination { } // GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *Pagination) GetOffset() *int32 { +func (o *Pagination) GetOffset() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Offset - } // GetOffsetOk returns a tuple with the Offset 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 *Pagination) GetOffsetOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Offset, true + return &o.Offset, true } // SetOffset sets field value func (o *Pagination) SetOffset(v int32) { - - o.Offset = &v - -} - -// HasOffset returns a boolean if a field has been set. -func (o *Pagination) HasOffset() bool { - if o != nil && o.Offset != nil { - return true - } - - return false + o.Offset = v } // GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *Pagination) GetLimit() *int32 { +func (o *Pagination) GetLimit() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Limit - } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Pagination) GetLimitOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Limit, true + return &o.Limit, true } // SetLimit sets field value func (o *Pagination) SetLimit(v int32) { - - o.Limit = &v - -} - -// HasLimit returns a boolean if a field has been set. -func (o *Pagination) HasLimit() bool { - if o != nil && o.Limit != nil { - return true - } - - return false + o.Limit = v } // GetLinks returns the Links field value -// If the value is explicit nil, the zero value for Links will be returned -func (o *Pagination) GetLinks() *Links { +func (o *Pagination) GetLinks() Links { if o == nil { - return nil + var ret Links + return ret } return o.Links - } // GetLinksOk returns a tuple with the Links 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 *Pagination) GetLinksOk() (*Links, bool) { if o == nil { return nil, false } - - return o.Links, true + return &o.Links, true } // SetLinks sets field value func (o *Pagination) SetLinks(v Links) { - - o.Links = &v - + o.Links = v } -// HasLinks returns a boolean if a field has been set. -func (o *Pagination) HasLinks() bool { - if o != nil && o.Links != nil { - return true - } - - return false -} - -func (o Pagination) MarshalJSON() ([]byte, error) { +func (o Pagination) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Offset != nil { - toSerialize["offset"] = o.Offset - } - - if o.Limit != nil { - toSerialize["limit"] = o.Limit - } - - if o.Links != nil { - toSerialize["_links"] = o.Links - } - - return json.Marshal(toSerialize) + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["_links"] = o.Links + return toSerialize, nil } type NullablePagination struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_patch_name.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_patch_name.go similarity index 80% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_patch_name.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_patch_name.go index 46d9429ab..c0989d18f 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_patch_name.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_patch_name.go @@ -8,16 +8,19 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the PatchName type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchName{} + // PatchName struct for PatchName type PatchName struct { // The new name. - Name *string `json:"name"` + Name string `json:"name"` } // NewPatchName instantiates a new PatchName object @@ -27,7 +30,7 @@ type PatchName struct { func NewPatchName(name string) *PatchName { this := PatchName{} - this.Name = &name + this.Name = name return &this } @@ -41,50 +44,33 @@ func NewPatchNameWithDefaults() *PatchName { } // GetName returns the Name field value -// If the value is explicit nil, the zero value for string will be returned -func (o *PatchName) GetName() *string { +func (o *PatchName) GetName() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PatchName) GetNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.Name, true + return &o.Name, true } // SetName sets field value func (o *PatchName) SetName(v string) { - - o.Name = &v - + o.Name = v } -// HasName returns a boolean if a field has been set. -func (o *PatchName) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -func (o PatchName) MarshalJSON() ([]byte, error) { +func (o PatchName) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - - return json.Marshal(toSerialize) + toSerialize["name"] = o.Name + return toSerialize, nil } type NullablePatchName struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider.go similarity index 65% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider.go index 99027ca91..4c2b31ce7 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider.go @@ -8,20 +8,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the Provider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Provider{} + // Provider Certificate provider used to renew certificates before their expiry. type Provider struct { // The name of the certificate provider. - Name *string `json:"name"` + Name string `json:"name"` // The email address of the certificate requester. - Email *string `json:"email"` + Email string `json:"email"` // The URL of the certificate provider. - Server *string `json:"server"` + Server string `json:"server"` ExternalAccountBinding *ProviderExternalAccountBinding `json:"externalAccountBinding,omitempty"` } @@ -32,9 +35,9 @@ type Provider struct { func NewProvider(name string, email string, server string) *Provider { this := Provider{} - this.Name = &name - this.Email = &email - this.Server = &server + this.Name = name + this.Email = email + this.Server = server return &this } @@ -48,176 +51,118 @@ func NewProviderWithDefaults() *Provider { } // GetName returns the Name field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Provider) GetName() *string { +func (o *Provider) GetName() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Provider) GetNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.Name, true + return &o.Name, true } // SetName sets field value func (o *Provider) SetName(v string) { - - o.Name = &v - -} - -// HasName returns a boolean if a field has been set. -func (o *Provider) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false + o.Name = v } // GetEmail returns the Email field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Provider) GetEmail() *string { +func (o *Provider) GetEmail() string { if o == nil { - return nil + var ret string + return ret } return o.Email - } // GetEmailOk returns a tuple with the Email 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 *Provider) GetEmailOk() (*string, bool) { if o == nil { return nil, false } - - return o.Email, true + return &o.Email, true } // SetEmail sets field value func (o *Provider) SetEmail(v string) { - - o.Email = &v - -} - -// HasEmail returns a boolean if a field has been set. -func (o *Provider) HasEmail() bool { - if o != nil && o.Email != nil { - return true - } - - return false + o.Email = v } // GetServer returns the Server field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Provider) GetServer() *string { +func (o *Provider) GetServer() string { if o == nil { - return nil + var ret string + return ret } return o.Server - } // GetServerOk returns a tuple with the Server field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Provider) GetServerOk() (*string, bool) { if o == nil { return nil, false } - - return o.Server, true + return &o.Server, true } // SetServer sets field value func (o *Provider) SetServer(v string) { - - o.Server = &v - + o.Server = v } -// HasServer returns a boolean if a field has been set. -func (o *Provider) HasServer() bool { - if o != nil && o.Server != nil { - return true +// GetExternalAccountBinding returns the ExternalAccountBinding field value if set, zero value otherwise. +func (o *Provider) GetExternalAccountBinding() ProviderExternalAccountBinding { + if o == nil || IsNil(o.ExternalAccountBinding) { + var ret ProviderExternalAccountBinding + return ret } - - return false -} - -// GetExternalAccountBinding returns the ExternalAccountBinding field value -// If the value is explicit nil, the zero value for ProviderExternalAccountBinding will be returned -func (o *Provider) GetExternalAccountBinding() *ProviderExternalAccountBinding { - if o == nil { - return nil - } - - return o.ExternalAccountBinding - + return *o.ExternalAccountBinding } -// GetExternalAccountBindingOk returns a tuple with the ExternalAccountBinding field value +// GetExternalAccountBindingOk returns a tuple with the ExternalAccountBinding field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Provider) GetExternalAccountBindingOk() (*ProviderExternalAccountBinding, bool) { - if o == nil { + if o == nil || IsNil(o.ExternalAccountBinding) { return nil, false } - return o.ExternalAccountBinding, true } -// SetExternalAccountBinding sets field value -func (o *Provider) SetExternalAccountBinding(v ProviderExternalAccountBinding) { - - o.ExternalAccountBinding = &v - -} - // HasExternalAccountBinding returns a boolean if a field has been set. func (o *Provider) HasExternalAccountBinding() bool { - if o != nil && o.ExternalAccountBinding != nil { + if o != nil && !IsNil(o.ExternalAccountBinding) { return true } return false } -func (o Provider) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - - if o.Email != nil { - toSerialize["email"] = o.Email - } - - if o.Server != nil { - toSerialize["server"] = o.Server - } +// SetExternalAccountBinding gets a reference to the given ProviderExternalAccountBinding and assigns it to the ExternalAccountBinding field. +func (o *Provider) SetExternalAccountBinding(v ProviderExternalAccountBinding) { + o.ExternalAccountBinding = &v +} - if o.ExternalAccountBinding != nil { +func (o Provider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["email"] = o.Email + toSerialize["server"] = o.Server + if !IsNil(o.ExternalAccountBinding) { toSerialize["externalAccountBinding"] = o.ExternalAccountBinding } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableProvider struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_create.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_create.go similarity index 68% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_create.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_create.go index 69c7ba0e8..cfa54db15 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_create.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_create.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderCreate{} + // ProviderCreate struct for ProviderCreate type ProviderCreate struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *Provider `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties Provider `json:"properties"` } // NewProviderCreate instantiates a new ProviderCreate object @@ -28,7 +31,7 @@ type ProviderCreate struct { func NewProviderCreate(properties Provider) *ProviderCreate { this := ProviderCreate{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewProviderCreateWithDefaults() *ProviderCreate { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *ProviderCreate) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ProviderCreate) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ProviderCreate) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *ProviderCreate) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *ProviderCreate) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *ProviderCreate) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ProviderCreate) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for Provider will be returned -func (o *ProviderCreate) GetProperties() *Provider { +func (o *ProviderCreate) GetProperties() Provider { if o == nil { - return nil + var ret Provider + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *ProviderCreate) GetPropertiesOk() (*Provider, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *ProviderCreate) SetProperties(v Provider) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *ProviderCreate) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o ProviderCreate) MarshalJSON() ([]byte, error) { +func (o ProviderCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableProviderCreate struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_external_account_binding.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_external_account_binding.go similarity index 76% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_external_account_binding.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_external_account_binding.go index 85940ce63..bdf8da8cd 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_external_account_binding.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_external_account_binding.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderExternalAccountBinding type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderExternalAccountBinding{} + // ProviderExternalAccountBinding struct for ProviderExternalAccountBinding type ProviderExternalAccountBinding struct { // The key ID of the external account binding. @@ -40,93 +43,79 @@ func NewProviderExternalAccountBindingWithDefaults() *ProviderExternalAccountBin return &this } -// GetKeyId returns the KeyId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderExternalAccountBinding) GetKeyId() *string { - if o == nil { - return nil +// GetKeyId returns the KeyId field value if set, zero value otherwise. +func (o *ProviderExternalAccountBinding) GetKeyId() string { + if o == nil || IsNil(o.KeyId) { + var ret string + return ret } - - return o.KeyId - + return *o.KeyId } -// GetKeyIdOk returns a tuple with the KeyId field value +// GetKeyIdOk returns a tuple with the KeyId field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderExternalAccountBinding) GetKeyIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.KeyId) { return nil, false } - return o.KeyId, true } -// SetKeyId sets field value -func (o *ProviderExternalAccountBinding) SetKeyId(v string) { - - o.KeyId = &v - -} - // HasKeyId returns a boolean if a field has been set. func (o *ProviderExternalAccountBinding) HasKeyId() bool { - if o != nil && o.KeyId != nil { + if o != nil && !IsNil(o.KeyId) { return true } return false } -// GetKeySecret returns the KeySecret field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderExternalAccountBinding) GetKeySecret() *string { - if o == nil { - return nil - } - - return o.KeySecret +// SetKeyId gets a reference to the given string and assigns it to the KeyId field. +func (o *ProviderExternalAccountBinding) SetKeyId(v string) { + o.KeyId = &v +} +// GetKeySecret returns the KeySecret field value if set, zero value otherwise. +func (o *ProviderExternalAccountBinding) GetKeySecret() string { + if o == nil || IsNil(o.KeySecret) { + var ret string + return ret + } + return *o.KeySecret } -// GetKeySecretOk returns a tuple with the KeySecret field value +// GetKeySecretOk returns a tuple with the KeySecret field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderExternalAccountBinding) GetKeySecretOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.KeySecret) { return nil, false } - return o.KeySecret, true } -// SetKeySecret sets field value -func (o *ProviderExternalAccountBinding) SetKeySecret(v string) { - - o.KeySecret = &v - -} - // HasKeySecret returns a boolean if a field has been set. func (o *ProviderExternalAccountBinding) HasKeySecret() bool { - if o != nil && o.KeySecret != nil { + if o != nil && !IsNil(o.KeySecret) { return true } return false } -func (o ProviderExternalAccountBinding) MarshalJSON() ([]byte, error) { +// SetKeySecret gets a reference to the given string and assigns it to the KeySecret field. +func (o *ProviderExternalAccountBinding) SetKeySecret(v string) { + o.KeySecret = &v +} + +func (o ProviderExternalAccountBinding) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.KeyId != nil { + if !IsNil(o.KeyId) { toSerialize["keyId"] = o.KeyId } - - if o.KeySecret != nil { + if !IsNil(o.KeySecret) { toSerialize["keySecret"] = o.KeySecret } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableProviderExternalAccountBinding struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_patch.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_patch.go similarity index 68% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_patch.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_patch.go index f878c9d10..3b1c12b05 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_patch.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_patch.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderPatch{} + // ProviderPatch struct for ProviderPatch type ProviderPatch struct { // Metadata - Metadata *map[string]interface{} `json:"metadata,omitempty"` - Properties *PatchName `json:"properties"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Properties PatchName `json:"properties"` } // NewProviderPatch instantiates a new ProviderPatch object @@ -28,7 +31,7 @@ type ProviderPatch struct { func NewProviderPatch(properties PatchName) *ProviderPatch { this := ProviderPatch{} - this.Properties = &properties + this.Properties = properties return &this } @@ -41,93 +44,69 @@ func NewProviderPatchWithDefaults() *ProviderPatch { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned -func (o *ProviderPatch) GetMetadata() *map[string]interface{} { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ProviderPatch) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret } - return o.Metadata - } -// GetMetadataOk returns a tuple with the Metadata field value +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ProviderPatch) GetMetadataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *ProviderPatch) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *ProviderPatch) SetMetadata(v map[string]interface{}) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *ProviderPatch) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ProviderPatch) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for PatchName will be returned -func (o *ProviderPatch) GetProperties() *PatchName { +func (o *ProviderPatch) GetProperties() PatchName { if o == nil { - return nil + var ret PatchName + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *ProviderPatch) GetPropertiesOk() (*PatchName, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *ProviderPatch) SetProperties(v PatchName) { - - o.Properties = &v - -} - -// HasProperties returns a boolean if a field has been set. -func (o *ProviderPatch) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false + o.Properties = v } -func (o ProviderPatch) MarshalJSON() ([]byte, error) { +func (o ProviderPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableProviderPatch struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read.go similarity index 60% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read.go index dc09a3c65..3a96ce907 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderRead type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderRead{} + // ProviderRead struct for ProviderRead type ProviderRead struct { // The ID (UUID) of the Provider. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the Provider. - Href *string `json:"href"` - Metadata *MetadataWithStatus `json:"metadata"` - Properties *Provider `json:"properties"` + Href string `json:"href"` + Metadata MetadataWithStatus `json:"metadata"` + Properties Provider `json:"properties"` } // NewProviderRead instantiates a new ProviderRead object @@ -33,11 +36,11 @@ type ProviderRead struct { func NewProviderRead(id string, type_ string, href string, metadata MetadataWithStatus, properties Provider) *ProviderRead { this := ProviderRead{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Metadata = &metadata - this.Properties = &properties + this.Id = id + this.Type = type_ + this.Href = href + this.Metadata = metadata + this.Properties = properties return &this } @@ -51,218 +54,133 @@ func NewProviderReadWithDefaults() *ProviderRead { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderRead) GetId() *string { +func (o *ProviderRead) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderRead) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *ProviderRead) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *ProviderRead) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderRead) GetType() *string { +func (o *ProviderRead) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderRead) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *ProviderRead) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *ProviderRead) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderRead) GetHref() *string { +func (o *ProviderRead) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *ProviderRead) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *ProviderRead) SetHref(v string) { - - o.Href = &v - -} - -// HasHref returns a boolean if a field has been set. -func (o *ProviderRead) HasHref() bool { - if o != nil && o.Href != nil { - return true - } - - return false + o.Href = v } // GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for MetadataWithStatus will be returned -func (o *ProviderRead) GetMetadata() *MetadataWithStatus { +func (o *ProviderRead) GetMetadata() MetadataWithStatus { if o == nil { - return nil + var ret MetadataWithStatus + return ret } return o.Metadata - } // GetMetadataOk returns a tuple with the Metadata 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 *ProviderRead) GetMetadataOk() (*MetadataWithStatus, bool) { if o == nil { return nil, false } - - return o.Metadata, true + return &o.Metadata, true } // SetMetadata sets field value func (o *ProviderRead) SetMetadata(v MetadataWithStatus) { - - o.Metadata = &v - -} - -// HasMetadata returns a boolean if a field has been set. -func (o *ProviderRead) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false + o.Metadata = v } // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for Provider will be returned -func (o *ProviderRead) GetProperties() *Provider { +func (o *ProviderRead) GetProperties() Provider { if o == nil { - return nil + var ret Provider + return ret } return o.Properties - } // GetPropertiesOk returns a tuple with the Properties 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 *ProviderRead) GetPropertiesOk() (*Provider, bool) { if o == nil { return nil, false } - - return o.Properties, true + return &o.Properties, true } // SetProperties sets field value func (o *ProviderRead) SetProperties(v Provider) { - - o.Properties = &v - + o.Properties = v } -// HasProperties returns a boolean if a field has been set. -func (o *ProviderRead) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false -} - -func (o ProviderRead) MarshalJSON() ([]byte, error) { +func (o ProviderRead) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - - return json.Marshal(toSerialize) + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + toSerialize["metadata"] = o.Metadata + toSerialize["properties"] = o.Properties + return toSerialize, nil } type NullableProviderRead struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list.go similarity index 58% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list.go index 427cf6206..b65452d5b 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list.go @@ -8,27 +8,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderReadList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderReadList{} + // ProviderReadList struct for ProviderReadList type ProviderReadList struct { // ID of the list of Provider resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of Provider resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of Provider resources. - Items *[]ProviderRead `json:"items,omitempty"` + Items []ProviderRead `json:"items,omitempty"` // The offset specified in the request (if none was specified, the default offset is 0). - Offset *int32 `json:"offset"` + Offset int32 `json:"offset"` // The limit specified in the request (if none was specified, use the endpoint's default pagination limit). - Limit *int32 `json:"limit"` - Links *Links `json:"_links"` + Limit int32 `json:"limit"` + Links Links `json:"_links"` } // NewProviderReadList instantiates a new ProviderReadList object @@ -38,12 +41,12 @@ type ProviderReadList struct { func NewProviderReadList(id string, type_ string, href string, offset int32, limit int32, links Links) *ProviderReadList { this := ProviderReadList{} - this.Id = &id - this.Type = &type_ - this.Href = &href - this.Offset = &offset - this.Limit = &limit - this.Links = &links + this.Id = id + this.Type = type_ + this.Href = href + this.Offset = offset + this.Limit = limit + this.Links = links return &this } @@ -57,302 +60,193 @@ func NewProviderReadListWithDefaults() *ProviderReadList { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadList) GetId() *string { +func (o *ProviderReadList) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderReadList) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *ProviderReadList) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *ProviderReadList) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadList) GetType() *string { +func (o *ProviderReadList) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderReadList) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *ProviderReadList) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *ProviderReadList) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadList) GetHref() *string { +func (o *ProviderReadList) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *ProviderReadList) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *ProviderReadList) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *ProviderReadList) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ProviderReadList) GetItems() []ProviderRead { + if o == nil || IsNil(o.Items) { + var ret []ProviderRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []ProviderRead will be returned -func (o *ProviderReadList) GetItems() *[]ProviderRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ProviderReadList) GetItemsOk() (*[]ProviderRead, bool) { - if o == nil { +func (o *ProviderReadList) GetItemsOk() ([]ProviderRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *ProviderReadList) SetItems(v []ProviderRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *ProviderReadList) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } +// SetItems gets a reference to the given []ProviderRead and assigns it to the Items field. +func (o *ProviderReadList) SetItems(v []ProviderRead) { + o.Items = v +} + // GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ProviderReadList) GetOffset() *int32 { +func (o *ProviderReadList) GetOffset() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Offset - } // GetOffsetOk returns a tuple with the Offset 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 *ProviderReadList) GetOffsetOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Offset, true + return &o.Offset, true } // SetOffset sets field value func (o *ProviderReadList) SetOffset(v int32) { - - o.Offset = &v - -} - -// HasOffset returns a boolean if a field has been set. -func (o *ProviderReadList) HasOffset() bool { - if o != nil && o.Offset != nil { - return true - } - - return false + o.Offset = v } // GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ProviderReadList) GetLimit() *int32 { +func (o *ProviderReadList) GetLimit() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Limit - } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderReadList) GetLimitOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Limit, true + return &o.Limit, true } // SetLimit sets field value func (o *ProviderReadList) SetLimit(v int32) { - - o.Limit = &v - -} - -// HasLimit returns a boolean if a field has been set. -func (o *ProviderReadList) HasLimit() bool { - if o != nil && o.Limit != nil { - return true - } - - return false + o.Limit = v } // GetLinks returns the Links field value -// If the value is explicit nil, the zero value for Links will be returned -func (o *ProviderReadList) GetLinks() *Links { +func (o *ProviderReadList) GetLinks() Links { if o == nil { - return nil + var ret Links + return ret } return o.Links - } // GetLinksOk returns a tuple with the Links 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 *ProviderReadList) GetLinksOk() (*Links, bool) { if o == nil { return nil, false } - - return o.Links, true + return &o.Links, true } // SetLinks sets field value func (o *ProviderReadList) SetLinks(v Links) { - - o.Links = &v - + o.Links = v } -// HasLinks returns a boolean if a field has been set. -func (o *ProviderReadList) HasLinks() bool { - if o != nil && o.Links != nil { - return true - } - - return false -} - -func (o ProviderReadList) MarshalJSON() ([]byte, error) { +func (o ProviderReadList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } - - if o.Items != nil { + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - if o.Offset != nil { - toSerialize["offset"] = o.Offset - } - - if o.Limit != nil { - toSerialize["limit"] = o.Limit - } - - if o.Links != nil { - toSerialize["_links"] = o.Links - } - - return json.Marshal(toSerialize) + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["_links"] = o.Links + return toSerialize, nil } type NullableProviderReadList struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list_all_of.go similarity index 64% rename from vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list_all_of.go index d1a09ef3a..2197ac46d 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/model_provider_read_list_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/model_provider_read_list_all_of.go @@ -8,22 +8,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package cert import ( "encoding/json" ) +// checks if the ProviderReadListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderReadListAllOf{} + // ProviderReadListAllOf struct for ProviderReadListAllOf type ProviderReadListAllOf struct { // ID of the list of Provider resources. - Id *string `json:"id"` + Id string `json:"id"` // The type of the resource. - Type *string `json:"type"` + Type string `json:"type"` // The URL of the list of Provider resources. - Href *string `json:"href"` + Href string `json:"href"` // The list of Provider resources. - Items *[]ProviderRead `json:"items,omitempty"` + Items []ProviderRead `json:"items,omitempty"` } // NewProviderReadListAllOf instantiates a new ProviderReadListAllOf object @@ -33,9 +36,9 @@ type ProviderReadListAllOf struct { func NewProviderReadListAllOf(id string, type_ string, href string) *ProviderReadListAllOf { this := ProviderReadListAllOf{} - this.Id = &id - this.Type = &type_ - this.Href = &href + this.Id = id + this.Type = type_ + this.Href = href return &this } @@ -49,176 +52,118 @@ func NewProviderReadListAllOfWithDefaults() *ProviderReadListAllOf { } // GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadListAllOf) GetId() *string { +func (o *ProviderReadListAllOf) GetId() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderReadListAllOf) GetIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.Id, true + return &o.Id, true } // SetId sets field value func (o *ProviderReadListAllOf) SetId(v string) { - - o.Id = &v - -} - -// HasId returns a boolean if a field has been set. -func (o *ProviderReadListAllOf) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false + o.Id = v } // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadListAllOf) GetType() *string { +func (o *ProviderReadListAllOf) GetType() string { if o == nil { - return 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderReadListAllOf) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - - return o.Type, true + return &o.Type, true } // SetType sets field value func (o *ProviderReadListAllOf) SetType(v string) { - - o.Type = &v - -} - -// HasType returns a boolean if a field has been set. -func (o *ProviderReadListAllOf) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false + o.Type = v } // GetHref returns the Href field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProviderReadListAllOf) GetHref() *string { +func (o *ProviderReadListAllOf) GetHref() string { if o == nil { - return nil + var ret string + return ret } return o.Href - } // GetHrefOk returns a tuple with the Href 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 *ProviderReadListAllOf) GetHrefOk() (*string, bool) { if o == nil { return nil, false } - - return o.Href, true + return &o.Href, true } // SetHref sets field value func (o *ProviderReadListAllOf) SetHref(v string) { - - o.Href = &v - + o.Href = v } -// HasHref returns a boolean if a field has been set. -func (o *ProviderReadListAllOf) HasHref() bool { - if o != nil && o.Href != nil { - return true +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ProviderReadListAllOf) GetItems() []ProviderRead { + if o == nil || IsNil(o.Items) { + var ret []ProviderRead + return ret } - - return false -} - -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []ProviderRead will be returned -func (o *ProviderReadListAllOf) GetItems() *[]ProviderRead { - if o == nil { - return nil - } - return o.Items - } -// GetItemsOk returns a tuple with the Items field value +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ProviderReadListAllOf) GetItemsOk() (*[]ProviderRead, bool) { - if o == nil { +func (o *ProviderReadListAllOf) GetItemsOk() ([]ProviderRead, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *ProviderReadListAllOf) SetItems(v []ProviderRead) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *ProviderReadListAllOf) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -func (o ProviderReadListAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - - if o.Type != nil { - toSerialize["type"] = o.Type - } - - if o.Href != nil { - toSerialize["href"] = o.Href - } +// SetItems gets a reference to the given []ProviderRead and assigns it to the Items field. +func (o *ProviderReadListAllOf) SetItems(v []ProviderRead) { + o.Items = v +} - if o.Items != nil { +func (o ProviderReadListAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + toSerialize["href"] = o.Href + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableProviderReadListAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/utils.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/utils.go new file mode 100644 index 000000000..94d3fb1cb --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/cert/v2/utils.go @@ -0,0 +1,362 @@ +/* + * Certificate Manager Service API + * + * Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose. + * + * API version: 2.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cert + +import ( + "encoding/json" + "github.com/ionos-cloud/sdk-go-bundle/shared" + "reflect" + "strings" + "time" +) + +type IonosTime struct { + time.Time +} + +type NullableIonosTime struct { + NullableTime +} + +func (t *IonosTime) UnmarshalJSON(data []byte) error { + str := string(data) + if shared.Strlen(str) == 0 { + t = nil + return nil + } + if str[0] == '"' { + str = str[1:] + } + if str[len(str)-1] == '"' { + str = str[:len(str)-1] + } + if !strings.Contains(str, "Z") { + /* forcefully adding timezone suffix to be able to parse the + * string using RFC3339 */ + str += "Z" + } + tt, err := time.Parse(time.RFC3339, str) + if err != nil { + return err + } + *t = IonosTime{tt} + return nil +} + +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 v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// 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 +} + +func IsZero(v interface{}) bool { + return reflect.ValueOf(v).IsZero() +} diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitbook.yaml b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitbook.yaml deleted file mode 100644 index 6c8fbd82b..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/.gitbook.yaml +++ /dev/null @@ -1,4 +0,0 @@ -root: docs -structure: - readme: README.md - summary: summary.md diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/README.md b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/README.md deleted file mode 100644 index 11952231b..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/README.md +++ /dev/null @@ -1,141 +0,0 @@ -[![Gitter](https://img.shields.io/gitter/room/ionos-cloud/sdk-general)](https://gitter.im/ionos-cloud/sdk-general) - -# Go API client for ionoscloud - -Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates -with IONOS services and your internal connected resources. - -For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), -you usually need a certificate to encrypt your HTTPS traffic. -The service provides the basic functions of uploading and deleting your certificates for this purpose. - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 2.0 -- Package version: 1.3.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -go get github.com/antihax/optional -``` - -Put the package under your project folder and add the following in import: - -```golang -import "./ionoscloud" -``` - -## Authentication - -All available server URLs are: - -- *https://certificate-manager.de-fra.ionos.com* - Frankfurt - -By default, *https://certificate-manager.de-fra.ionos.com* is used, however this can be overriden at authentication, either -by setting the `IONOS_API_URL` environment variable or by specifying the `hostUrl` parameter when -initializing the sdk client. - -The username and password or the authentication token can be manually specified when initializing -the sdk client: - -```golang - -client := ionoscloud.NewAPIClient(ionoscloud.NewConfiguration(username, password, token, hostUrl)) - -``` - -Environment variables can also be used. The sdk uses the following variables: -- IONOS_TOKEN - login via token. This is the recommended way to authenticate. -- IONOS_USERNAME - to specify the username used to login -- IONOS_PASSWORD - to specify the password -- IONOS_API_URL - to specify the API server URL - -In this case, the client configuration needs to be initialized using `NewConfigurationFromEnv()`. - -```golang - -client := ionoscloud.NewAPIClient(ionoscloud.NewConfigurationFromEnv()) - -``` - - -## Documentation for API Endpoints - -All URIs are relative to *https://certificate-manager.de-fra.ionos.com* -
- API Endpoints table - - -| Class | Method | HTTP request | Description | -| ------------- | ------------- | ------------- | ------------- | -| AutoCertificateApi | [**AutoCertificatesDelete**](docs/api/AutoCertificateApi.md#AutoCertificatesDelete) | **Delete** /auto-certificates/{autoCertificateId} | Delete AutoCertificate | -| AutoCertificateApi | [**AutoCertificatesFindById**](docs/api/AutoCertificateApi.md#AutoCertificatesFindById) | **Get** /auto-certificates/{autoCertificateId} | Retrieve AutoCertificate | -| AutoCertificateApi | [**AutoCertificatesGet**](docs/api/AutoCertificateApi.md#AutoCertificatesGet) | **Get** /auto-certificates | Retrieve all AutoCertificate | -| AutoCertificateApi | [**AutoCertificatesPatch**](docs/api/AutoCertificateApi.md#AutoCertificatesPatch) | **Patch** /auto-certificates/{autoCertificateId} | Updates AutoCertificate | -| AutoCertificateApi | [**AutoCertificatesPost**](docs/api/AutoCertificateApi.md#AutoCertificatesPost) | **Post** /auto-certificates | Create AutoCertificate | -| CertificateApi | [**CertificatesDelete**](docs/api/CertificateApi.md#CertificatesDelete) | **Delete** /certificates/{certificateId} | Delete Certificate | -| CertificateApi | [**CertificatesFindById**](docs/api/CertificateApi.md#CertificatesFindById) | **Get** /certificates/{certificateId} | Retrieve Certificate | -| CertificateApi | [**CertificatesGet**](docs/api/CertificateApi.md#CertificatesGet) | **Get** /certificates | Retrieve all Certificate | -| CertificateApi | [**CertificatesPatch**](docs/api/CertificateApi.md#CertificatesPatch) | **Patch** /certificates/{certificateId} | Updates Certificate | -| CertificateApi | [**CertificatesPost**](docs/api/CertificateApi.md#CertificatesPost) | **Post** /certificates | Create Certificate | -| ProviderApi | [**ProvidersDelete**](docs/api/ProviderApi.md#ProvidersDelete) | **Delete** /providers/{providerId} | Delete Provider | -| ProviderApi | [**ProvidersFindById**](docs/api/ProviderApi.md#ProvidersFindById) | **Get** /providers/{providerId} | Retrieve Provider | -| ProviderApi | [**ProvidersGet**](docs/api/ProviderApi.md#ProvidersGet) | **Get** /providers | Retrieve all Provider | -| ProviderApi | [**ProvidersPatch**](docs/api/ProviderApi.md#ProvidersPatch) | **Patch** /providers/{providerId} | Updates Provider | -| ProviderApi | [**ProvidersPost**](docs/api/ProviderApi.md#ProvidersPost) | **Post** /providers | Create Provider | - -
- -## Documentation For Models - -All URIs are relative to *https://certificate-manager.de-fra.ionos.com* -
-API models list - - - [AutoCertificate](docs/models/AutoCertificate) - - [AutoCertificateCreate](docs/models/AutoCertificateCreate) - - [AutoCertificatePatch](docs/models/AutoCertificatePatch) - - [AutoCertificateRead](docs/models/AutoCertificateRead) - - [AutoCertificateReadList](docs/models/AutoCertificateReadList) - - [AutoCertificateReadListAllOf](docs/models/AutoCertificateReadListAllOf) - - [Certificate](docs/models/Certificate) - - [CertificateCreate](docs/models/CertificateCreate) - - [CertificatePatch](docs/models/CertificatePatch) - - [CertificateRead](docs/models/CertificateRead) - - [CertificateReadList](docs/models/CertificateReadList) - - [CertificateReadListAllOf](docs/models/CertificateReadListAllOf) - - [Connection](docs/models/Connection) - - [DayOfTheWeek](docs/models/DayOfTheWeek) - - [Error](docs/models/Error) - - [ErrorMessages](docs/models/ErrorMessages) - - [Links](docs/models/Links) - - [MaintenanceWindow](docs/models/MaintenanceWindow) - - [Metadata](docs/models/Metadata) - - [MetadataWithAutoCertificateInformation](docs/models/MetadataWithAutoCertificateInformation) - - [MetadataWithAutoCertificateInformationAllOf](docs/models/MetadataWithAutoCertificateInformationAllOf) - - [MetadataWithCertificateInformation](docs/models/MetadataWithCertificateInformation) - - [MetadataWithCertificateInformationAllOf](docs/models/MetadataWithCertificateInformationAllOf) - - [MetadataWithStatus](docs/models/MetadataWithStatus) - - [MetadataWithStatusAllOf](docs/models/MetadataWithStatusAllOf) - - [Pagination](docs/models/Pagination) - - [PatchName](docs/models/PatchName) - - [Provider](docs/models/Provider) - - [ProviderCreate](docs/models/ProviderCreate) - - [ProviderExternalAccountBinding](docs/models/ProviderExternalAccountBinding) - - [ProviderPatch](docs/models/ProviderPatch) - - [ProviderRead](docs/models/ProviderRead) - - [ProviderReadList](docs/models/ProviderReadList) - - [ProviderReadListAllOf](docs/models/ProviderReadListAllOf) - - -[[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models) - -
diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/configuration.go b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/configuration.go deleted file mode 100644 index c9d6f3a59..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/configuration.go +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Certificate Manager Service API - * - * Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose. - * - * API version: 2.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionoscloud - -import ( - "context" - "fmt" - "net/http" - "net/url" - "os" - "strings" - "time" -) - -const ( - IonosUsernameEnvVar = "IONOS_USERNAME" - IonosPasswordEnvVar = "IONOS_PASSWORD" - IonosTokenEnvVar = "IONOS_TOKEN" - IonosApiUrlEnvVar = "IONOS_API_URL" - IonosPinnedCertEnvVar = "IONOS_PINNED_CERT" - IonosLogLevelEnvVar = "IONOS_LOG_LEVEL" - DefaultIonosServerUrl = "https://certificate-manager.de-fra.ionos.com" - DefaultIonosBasePath = "" - defaultMaxRetries = 3 - defaultWaitTime = time.Duration(100) * time.Millisecond - defaultMaxWaitTime = time.Duration(2000) * time.Millisecond -) - -var ( - IonosServerUrls = []string{ - "https://certificate-manager.de-fra.ionos.com", - } -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - DefaultQueryParams url.Values `json:"defaultQueryParams,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client - LogLevel LogLevel - Logger Logger - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Token string `json:"token,omitempty"` - MaxRetries int `json:"maxRetries,omitempty"` - WaitTime time.Duration `json:"waitTime,omitempty"` - MaxWaitTime time.Duration `json:"maxWaitTime,omitempty"` -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration(username, password, token, hostUrl string) *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - DefaultQueryParams: url.Values{}, - UserAgent: "ionos-cloud-sdk-go-cert-manager/v1.3.0", - Debug: false, - Username: username, - Password: password, - Token: token, - MaxRetries: defaultMaxRetries, - MaxWaitTime: defaultMaxWaitTime, - WaitTime: defaultWaitTime, - Logger: NewDefaultLogger(), - LogLevel: getLogLevelFromEnv(), - Servers: ServerConfigurations{ - { - URL: getServerUrl(hostUrl), - Description: "Frankfurt", - }, - }, - OperationServers: map[string]ServerConfigurations{}, - } - return cfg -} - -func NewConfigurationFromEnv() *Configuration { - return NewConfiguration(os.Getenv(IonosUsernameEnvVar), os.Getenv(IonosPasswordEnvVar), os.Getenv(IonosTokenEnvVar), os.Getenv(IonosApiUrlEnvVar)) -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -func (c *Configuration) AddDefaultQueryParam(key string, value string) { - c.DefaultQueryParams[key] = []string{value} -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -func getServerUrl(serverUrl string) string { - if serverUrl == "" { - return DefaultIonosServerUrl - } - // Support both HTTPS & HTTP schemas - if !strings.HasPrefix(serverUrl, "https://") && !strings.HasPrefix(serverUrl, "http://") { - serverUrl = fmt.Sprintf("https://%s", serverUrl) - } - if !strings.HasSuffix(serverUrl, DefaultIonosBasePath) { - serverUrl = fmt.Sprintf("%s%s", serverUrl, DefaultIonosBasePath) - } - return serverUrl -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/logger.go b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/logger.go deleted file mode 100644 index f3f48fe44..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/logger.go +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Certificate Manager Service API - * - * Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose. - * - * API version: 2.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionoscloud - -import ( - "log" - "os" - "strings" -) - -type LogLevel uint - -func (l *LogLevel) Get() LogLevel { - if l != nil { - return *l - } - return Off -} - -// Satisfies returns true if this LogLevel is at least high enough for v -func (l *LogLevel) Satisfies(v LogLevel) bool { - return l.Get() >= v -} - -const ( - Off LogLevel = 0x100 * iota - Debug - // Trace We recommend you only set this field for debugging purposes. - // Disable it in your production environments because it can log sensitive data. - // It logs the full request and response without encryption, even for an HTTPS call. - // Verbose request and response logging can also significantly impact your application's performance. - Trace -) - -var LogLevelMap = map[string]LogLevel{ - "off": Off, - "debug": Debug, - "trace": Trace, -} - -// getLogLevelFromEnv - gets LogLevel type from env variable IONOS_LOG_LEVEL -// returns Off if an invalid log level is encountered -func getLogLevelFromEnv() LogLevel { - strLogLevel := "off" - if os.Getenv(IonosLogLevelEnvVar) != "" { - strLogLevel = os.Getenv(IonosLogLevelEnvVar) - } - - logLevel, ok := LogLevelMap[strings.ToLower(strLogLevel)] - if !ok { - log.Printf("Cannot set logLevel for value: %s, setting loglevel to Off", strLogLevel) - } - return logLevel -} - -type Logger interface { - Printf(format string, args ...interface{}) -} - -func NewDefaultLogger() Logger { - return &defaultLogger{ - logger: log.New(os.Stderr, "IONOSLOG ", log.LstdFlags), - } -} - -type defaultLogger struct { - logger *log.Logger -} - -func (l defaultLogger) Printf(format string, args ...interface{}) { - l.logger.Printf(format, args...) -} diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/response.go b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/response.go deleted file mode 100644 index 85e9ae31c..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/response.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Certificate Manager Service API - * - * Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose. - * - * API version: 2.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionoscloud - -import ( - "log" - "net/http" - "time" -) - -// 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"` - // RequestTime is the time duration from the moment the APIClient sends - // the HTTP request to the moment it receives an HTTP response. - RequestTime time.Duration `json:"duration,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 -} - -// HttpNotFound - returns true if a 404 status code was returned -// returns false for nil APIResponse values -func (resp *APIResponse) HttpNotFound() bool { - if resp != nil && resp.Response != nil && resp.StatusCode == http.StatusNotFound { - return true - } - return false -} - -// LogInfo - logs APIResponse values like RequestTime, Operation and StatusCode -// does not print anything for nil APIResponse values -func (resp *APIResponse) LogInfo() { - if resp != nil { - log.Printf("[DEBUG] Request time : %s for operation : %s", - resp.RequestTime, resp.Operation) - if resp.Response != nil { - log.Printf("[DEBUG] response status code : %d\n", resp.StatusCode) - } - } -} diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/sonar-project.properties b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/sonar-project.properties deleted file mode 100644 index 6f544e1b9..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/sonar-project.properties +++ /dev/null @@ -1,12 +0,0 @@ -sonar.projectKey=ionos-cloud_sdk-go-cert-manager -sonar.organization=ionos-cloud - -# This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=sdk-go-cert-manager -#sonar.projectVersion=1.0 - -# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -#sonar.sources=. - -# Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 diff --git a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/utils.go b/vendor/github.com/ionos-cloud/sdk-go-cert-manager/utils.go deleted file mode 100644 index a9b3c4889..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-cert-manager/utils.go +++ /dev/null @@ -1,776 +0,0 @@ -/* - * Certificate Manager Service API - * - * Using the Certificate Manager Service, you can conveniently provision and manage SSL certificates with IONOS services and your internal connected resources. For the [Application Load Balancer](https://api.ionos.com/docs/cloud/v6/#Application-Load-Balancers-get-datacenters-datacenterId-applicationloadbalancers), you usually need a certificate to encrypt your HTTPS traffic. The service provides the basic functions of uploading and deleting your certificates for this purpose. - * - * API version: 2.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionoscloud - -import ( - "encoding/json" - "reflect" - "time" -) - -// ToPtr - returns a pointer to the given value. -func ToPtr[T any](v T) *T { - return &v -} - -// ToValue - returns the value of the pointer passed in -func ToValue[T any](ptr *T) T { - return *ptr -} - -// ToValueDefault - returns the value of the pointer passed in, or the default type value if the pointer is nil -func ToValueDefault[T any](ptr *T) T { - var defaultVal T - if ptr == nil { - return defaultVal - } - return *ptr -} - -func SliceToValueDefault[T any](ptrSlice *[]T) []T { - return append([]T{}, *ptrSlice...) -} - -// PtrBool - returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt - returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 - returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 - returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 - returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 - returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString - returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime - returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -// ToBool - returns the value of the bool pointer passed in -func ToBool(ptr *bool) bool { - return *ptr -} - -// ToBoolDefault - returns the value of the bool pointer passed in, or false if the pointer is nil -func ToBoolDefault(ptr *bool) bool { - var defaultVal bool - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToBoolSlice - returns a bool slice of the pointer passed in -func ToBoolSlice(ptrSlice *[]bool) []bool { - valSlice := make([]bool, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToByte - returns the value of the byte pointer passed in -func ToByte(ptr *byte) byte { - return *ptr -} - -// ToByteDefault - returns the value of the byte pointer passed in, or 0 if the pointer is nil -func ToByteDefault(ptr *byte) byte { - var defaultVal byte - if ptr == nil { - return defaultVal - } - - return *ptr -} - -// ToByteSlice - returns a byte slice of the pointer passed in -func ToByteSlice(ptrSlice *[]byte) []byte { - valSlice := make([]byte, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToString - returns the value of the string pointer passed in -func ToString(ptr *string) string { - return *ptr -} - -// ToStringDefault - returns the value of the string pointer passed in, or "" if the pointer is nil -func ToStringDefault(ptr *string) string { - var defaultVal string - if ptr == nil { - return defaultVal - } - - return *ptr -} - -// ToStringSlice - returns a string slice of the pointer passed in -func ToStringSlice(ptrSlice *[]string) []string { - valSlice := make([]string, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToInt - returns the value of the int pointer passed in -func ToInt(ptr *int) int { - return *ptr -} - -// ToIntDefault - returns the value of the int pointer passed in, or 0 if the pointer is nil -func ToIntDefault(ptr *int) int { - var defaultVal int - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToIntSlice - returns a int slice of the pointer passed in -func ToIntSlice(ptrSlice *[]int) []int { - valSlice := make([]int, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToInt8 - returns the value of the int8 pointer passed in -func ToInt8(ptr *int8) int8 { - return *ptr -} - -// ToInt8Default - returns the value of the int8 pointer passed in, or 0 if the pointer is nil -func ToInt8Default(ptr *int8) int8 { - var defaultVal int8 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToInt8Slice - returns a int8 slice of the pointer passed in -func ToInt8Slice(ptrSlice *[]int8) []int8 { - valSlice := make([]int8, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToInt16 - returns the value of the int16 pointer passed in -func ToInt16(ptr *int16) int16 { - return *ptr -} - -// ToInt16Default - returns the value of the int16 pointer passed in, or 0 if the pointer is nil -func ToInt16Default(ptr *int16) int16 { - var defaultVal int16 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToInt16Slice - returns a int16 slice of the pointer passed in -func ToInt16Slice(ptrSlice *[]int16) []int16 { - valSlice := make([]int16, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToInt32 - returns the value of the int32 pointer passed in -func ToInt32(ptr *int32) int32 { - return *ptr -} - -// ToInt32Default - returns the value of the int32 pointer passed in, or 0 if the pointer is nil -func ToInt32Default(ptr *int32) int32 { - var defaultVal int32 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToInt32Slice - returns a int32 slice of the pointer passed in -func ToInt32Slice(ptrSlice *[]int32) []int32 { - valSlice := make([]int32, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToInt64 - returns the value of the int64 pointer passed in -func ToInt64(ptr *int64) int64 { - return *ptr -} - -// ToInt64Default - returns the value of the int64 pointer passed in, or 0 if the pointer is nil -func ToInt64Default(ptr *int64) int64 { - var defaultVal int64 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToInt64Slice - returns a int64 slice of the pointer passed in -func ToInt64Slice(ptrSlice *[]int64) []int64 { - valSlice := make([]int64, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToUint - returns the value of the uint pointer passed in -func ToUint(ptr *uint) uint { - return *ptr -} - -// ToUintDefault - returns the value of the uint pointer passed in, or 0 if the pointer is nil -func ToUintDefault(ptr *uint) uint { - var defaultVal uint - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToUintSlice - returns a uint slice of the pointer passed in -func ToUintSlice(ptrSlice *[]uint) []uint { - valSlice := make([]uint, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToUint8 -returns the value of the uint8 pointer passed in -func ToUint8(ptr *uint8) uint8 { - return *ptr -} - -// ToUint8Default - returns the value of the uint8 pointer passed in, or 0 if the pointer is nil -func ToUint8Default(ptr *uint8) uint8 { - var defaultVal uint8 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToUint8Slice - returns a uint8 slice of the pointer passed in -func ToUint8Slice(ptrSlice *[]uint8) []uint8 { - valSlice := make([]uint8, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToUint16 - returns the value of the uint16 pointer passed in -func ToUint16(ptr *uint16) uint16 { - return *ptr -} - -// ToUint16Default - returns the value of the uint16 pointer passed in, or 0 if the pointer is nil -func ToUint16Default(ptr *uint16) uint16 { - var defaultVal uint16 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToUint16Slice - returns a uint16 slice of the pointer passed in -func ToUint16Slice(ptrSlice *[]uint16) []uint16 { - valSlice := make([]uint16, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToUint32 - returns the value of the uint32 pointer passed in -func ToUint32(ptr *uint32) uint32 { - return *ptr -} - -// ToUint32Default - returns the value of the uint32 pointer passed in, or 0 if the pointer is nil -func ToUint32Default(ptr *uint32) uint32 { - var defaultVal uint32 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToUint32Slice - returns a uint32 slice of the pointer passed in -func ToUint32Slice(ptrSlice *[]uint32) []uint32 { - valSlice := make([]uint32, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToUint64 - returns the value of the uint64 pointer passed in -func ToUint64(ptr *uint64) uint64 { - return *ptr -} - -// ToUint64Default - returns the value of the uint64 pointer passed in, or 0 if the pointer is nil -func ToUint64Default(ptr *uint64) uint64 { - var defaultVal uint64 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToUint64Slice - returns a uint63 slice of the pointer passed in -func ToUint64Slice(ptrSlice *[]uint64) []uint64 { - valSlice := make([]uint64, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToFloat32 - returns the value of the float32 pointer passed in -func ToFloat32(ptr *float32) float32 { - return *ptr -} - -// ToFloat32Default - returns the value of the float32 pointer passed in, or 0 if the pointer is nil -func ToFloat32Default(ptr *float32) float32 { - var defaultVal float32 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToFloat32Slice - returns a float32 slice of the pointer passed in -func ToFloat32Slice(ptrSlice *[]float32) []float32 { - valSlice := make([]float32, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToFloat64 - returns the value of the float64 pointer passed in -func ToFloat64(ptr *float64) float64 { - return *ptr -} - -// ToFloat64Default - returns the value of the float64 pointer passed in, or 0 if the pointer is nil -func ToFloat64Default(ptr *float64) float64 { - var defaultVal float64 - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToFloat64Slice - returns a float64 slice of the pointer passed in -func ToFloat64Slice(ptrSlice *[]float64) []float64 { - valSlice := make([]float64, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -// ToTime - returns the value of the Time pointer passed in -func ToTime(ptr *time.Time) time.Time { - return *ptr -} - -// ToTimeDefault - returns the value of the Time pointer passed in, or 0001-01-01 00:00:00 +0000 UTC if the pointer is nil -func ToTimeDefault(ptr *time.Time) time.Time { - var defaultVal time.Time - if ptr == nil { - return defaultVal - } - return *ptr -} - -// ToTimeSlice - returns a Time slice of the pointer passed in -func ToTimeSlice(ptrSlice *[]time.Time) []time.Time { - valSlice := make([]time.Time, len(*ptrSlice)) - for i, v := range *ptrSlice { - valSlice[i] = v - } - - return valSlice -} - -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 v.value.MarshalJSON() -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type IonosTime struct { - time.Time -} - -func (t *IonosTime) UnmarshalJSON(data []byte) error { - str := string(data) - if strlen(str) == 0 { - t = nil - return nil - } - if str[0] == '"' { - str = str[1:] - } - if str[len(str)-1] == '"' { - str = str[:len(str)-1] - } - tt, err := time.Parse(time.RFC3339, str) - if err != nil { - return err - } - *t = IonosTime{tt} - return nil -} - -// 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 -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 915e25671..38fbe54e6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -317,6 +317,9 @@ github.com/ionos-cloud/sdk-go-api-gateway # github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0 ## explicit; go 1.22 github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 +# github.com/ionos-cloud/sdk-go-bundle/products/cert/v2 v2.1.0 +## explicit; go 1.22 +github.com/ionos-cloud/sdk-go-bundle/products/cert/v2 # github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1 ## explicit; go 1.21 github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 @@ -329,9 +332,6 @@ github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 # github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1 ## explicit; go 1.20 github.com/ionos-cloud/sdk-go-bundle/shared -# github.com/ionos-cloud/sdk-go-cert-manager v1.3.0 -## explicit; go 1.18 -github.com/ionos-cloud/sdk-go-cert-manager # github.com/ionos-cloud/sdk-go-container-registry v1.2.0 ## explicit; go 1.18 github.com/ionos-cloud/sdk-go-container-registry