diff --git a/docs/resources/dbaas_inmemorydb_replica_set.md b/docs/resources/dbaas_inmemorydb_replica_set.md index 36f66c96b..a5b7981cf 100644 --- a/docs/resources/dbaas_inmemorydb_replica_set.md +++ b/docs/resources/dbaas_inmemorydb_replica_set.md @@ -33,7 +33,7 @@ resource "ionoscloud_server" "example" { ram = 2048 availability_zone = "ZONE_1" cpu_family = "INTEL_SKYLAKE" - image_name = "rockylinux-8-GenericCloud-20230518" + image_name = "rockylinux-8-GenericCloud-20240528" image_password = "password" volume { name = "example" diff --git a/docs/resources/dbaas_mariadb_cluster.md b/docs/resources/dbaas_mariadb_cluster.md index fb9ab1488..57cf06806 100644 --- a/docs/resources/dbaas_mariadb_cluster.md +++ b/docs/resources/dbaas_mariadb_cluster.md @@ -33,7 +33,7 @@ resource "ionoscloud_server" "example" { ram = 2048 availability_zone = "ZONE_1" cpu_family = "INTEL_SKYLAKE" - image_name = "rockylinux-8-GenericCloud-20230518" + image_name = "rockylinux-8-GenericCloud-20240528" image_password = "password" volume { name = "example" diff --git a/docs/resources/dbaas_pgsql_cluster.md b/docs/resources/dbaas_pgsql_cluster.md index dd8dd52b6..a2877f5cb 100644 --- a/docs/resources/dbaas_pgsql_cluster.md +++ b/docs/resources/dbaas_pgsql_cluster.md @@ -80,7 +80,7 @@ resource "ionoscloud_server" "example" { ram = 2048 availability_zone = "ZONE_1" cpu_family = "INTEL_SKYLAKE" - image_name = "rockylinux-8-GenericCloud-20230518" + image_name = "rockylinux-8-GenericCloud-20240528" image_password = "password" volume { name = "example" diff --git a/go.mod b/go.mod index bccf957f4..d32f7914e 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ 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/dbaas/mariadb/v2 v2.0.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 @@ -25,7 +26,6 @@ require ( 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 - github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1 github.com/ionos-cloud/sdk-go-dbaas-postgres v1.1.3 github.com/ionos-cloud/sdk-go-dns v1.2.1 diff --git a/go.sum b/go.sum index 808fbb186..8986fb9df 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/dbaas/mariadb/v2 v2.0.0 h1:HZiy10ADUUheZJFyMzN7a8ILt/2tp9SxasJh1AQ03QU= +github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2 v2.0.0/go.mod h1:viTYczukRYE3C94NUyKrSc2yEZvOq6mCbFwzVnjJnM4= 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= @@ -132,8 +134,6 @@ github.com/ionos-cloud/sdk-go-dataplatform v1.1.1 h1:Wu9TAiphRyMEweUcQlMblhVCl9q github.com/ionos-cloud/sdk-go-dataplatform v1.1.1/go.mod h1:3rQrOZFbXcjK3C5Dnjzahsd9x7PO+b4AARdBwdz//Mg= github.com/ionos-cloud/sdk-go-dbaas-in-memory-db v1.0.1 h1:vd3SCqZ1OI5l7Tzql7NDb5Zlpna8e2SsfEYZRGHOkOo= github.com/ionos-cloud/sdk-go-dbaas-in-memory-db v1.0.1/go.mod h1:JLbyt5wj7+f/njy7pnWD6K+cCfe32p8VrjmKks055+w= -github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 h1:dZLxaH2n0nxCOKMkt49TibOiY1hkaHThpXEgJL0oZng= -github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1/go.mod h1:NuUqBA9DyP4PB3MtKy/R9XRHY1RZcwVP6E3tP4FwI7I= github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1 h1:+tDoZ8IEPxYwJd6fDIpWksNJs9Zzw7Pu5A39jTew058= github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1/go.mod h1:rxOAeyAU6BTfghJibSRDdRNrKm2cIXMpSMe7JIWewJ8= github.com/ionos-cloud/sdk-go-dbaas-postgres v1.1.3 h1:T05nbKqBIw2zmPwaV2pWyFcUVjblLMoShPM9nAYQjLM= diff --git a/ionoscloud/data_source_dbaas_mariadb_backups.go b/ionoscloud/data_source_dbaas_mariadb_backups.go index 442f67681..94838c10c 100644 --- a/ionoscloud/data_source_dbaas_mariadb_backups.go +++ b/ionoscloud/data_source_dbaas_mariadb_backups.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - mariadbSDK "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + mariadbSDK "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/dbaas/mariadb" @@ -109,7 +109,7 @@ func dataSourceDBaaSMariaDBReadBackups(ctx context.Context, d *schema.ResourceDa if backupsResponse.Items == nil { return diag.FromErr(fmt.Errorf("expected valid properties in the API response for cluster backups, but received 'nil' instead, cluster ID: %s", clusterId)) } - backups = *backupsResponse.Items + backups = backupsResponse.Items } else { var backup mariadbSDK.BackupResponse backup, _, err = client.FindBackupByID(ctx, backupId, location) diff --git a/ionoscloud/data_source_dbaas_mariadb_cluster.go b/ionoscloud/data_source_dbaas_mariadb_cluster.go index e3475edf1..a31446d87 100644 --- a/ionoscloud/data_source_dbaas_mariadb_cluster.go +++ b/ionoscloud/data_source_dbaas_mariadb_cluster.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" - dbaas "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + dbaas "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" ) @@ -143,7 +143,7 @@ func dataSourceMariaDBClusterRead(ctx context.Context, d *schema.ResourceData, m var results []dbaas.ClusterResponse if clusters.Items != nil { - for _, clusterItem := range *clusters.Items { + for _, clusterItem := range clusters.Items { if clusterItem.Properties != nil && clusterItem.Properties.DisplayName != nil && strings.EqualFold(*clusterItem.Properties.DisplayName, name.(string)) { results = append(results, clusterItem) } diff --git a/ionoscloud/resource_dbaas_inmemorydb_replicaset_test.go b/ionoscloud/resource_dbaas_inmemorydb_replicaset_test.go index 83a91cf84..229ecdff6 100644 --- a/ionoscloud/resource_dbaas_inmemorydb_replicaset_test.go +++ b/ionoscloud/resource_dbaas_inmemorydb_replicaset_test.go @@ -245,7 +245,7 @@ resource ` + constant.ServerResource + ` ` + constant.ServerTestResource + ` { ram = 2048 availability_zone = "ZONE_1" cpu_family = "INTEL_SKYLAKE" - image_name = "rockylinux-8-GenericCloud-20230518" + image_name = "rockylinux-8-GenericCloud-20240528" image_password = ` + constant.RandomPassword + `.server_image_password.result volume { name = "example" diff --git a/ionoscloud/resource_dbaas_mariadb_cluster_test.go b/ionoscloud/resource_dbaas_mariadb_cluster_test.go index 857bba06a..a4e369947 100644 --- a/ionoscloud/resource_dbaas_mariadb_cluster_test.go +++ b/ionoscloud/resource_dbaas_mariadb_cluster_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - mariadb "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services" ) @@ -193,7 +193,7 @@ resource ` + constant.ServerResource + ` ` + constant.ServerTestResource + ` { ram = 2048 availability_zone = "ZONE_1" cpu_family = "INTEL_SKYLAKE" - image_name = "rockylinux-8-GenericCloud-20230518" + image_name = "rockylinux-8-GenericCloud-20240528" image_password = ` + constant.RandomPassword + `.server_image_password.result volume { name = "example" @@ -235,9 +235,9 @@ resource ` + constant.DBaaSMariaDBClusterResource + ` ` + constant.DBaaSClusterT } # Wait few seconds after cluster creation so the backups can be properly retrieved -resource "time_sleep" "wait_30_seconds" { +resource "time_sleep" "wait_5_minutes" { depends_on = [` + constant.DBaaSMariaDBClusterResource + `.` + constant.DBaaSClusterTestResource + `] - create_duration = "30s" + create_duration = "300s" } ` @@ -292,7 +292,7 @@ data ` + constant.DBaaSMariaDBBackupsDataSource + ` ` + constant.DBaasMariaDBBac cluster_id = ` + constant.DBaaSMariaDBClusterResource + `.` + constant.DBaaSClusterTestResource + `.id ` + clusterLocationAttribute + ` = "` + clusterLocationValue + `" # Use the previously created 'time' resource to delay information retrieval for the data source - depends_on = [time_sleep.wait_30_seconds] + depends_on = [time_sleep.wait_5_minutes] } ` const mariaDBClusterDataSourceWrongName = ` diff --git a/services/dbaas/mariadb/backups.go b/services/dbaas/mariadb/backups.go index da4e80b80..29196afd6 100644 --- a/services/dbaas/mariadb/backups.go +++ b/services/dbaas/mariadb/backups.go @@ -7,11 +7,12 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - mariadb "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" + shared "github.com/ionos-cloud/sdk-go-bundle/shared" ) // GetClusterBackups retrieves a list of backups for a given cluster ID and the location in which the cluster is created. -func (c *MariaDBClient) GetClusterBackups(ctx context.Context, clusterID, location string) (mariadb.BackupList, *mariadb.APIResponse, error) { +func (c *MariaDBClient) GetClusterBackups(ctx context.Context, clusterID, location string) (mariadb.BackupList, *shared.APIResponse, error) { c.modifyConfigURL(location) backups, apiResponse, err := c.sdkClient.BackupsApi.ClusterBackupsGet(ctx, clusterID).Execute() apiResponse.LogInfo() @@ -19,7 +20,7 @@ func (c *MariaDBClient) GetClusterBackups(ctx context.Context, clusterID, locati } // FindBackupByID retrieves a backup by its ID and the location in which the cluster is created. -func (c *MariaDBClient) FindBackupByID(ctx context.Context, backupID, location string) (mariadb.BackupResponse, *mariadb.APIResponse, error) { +func (c *MariaDBClient) FindBackupByID(ctx context.Context, backupID, location string) (mariadb.BackupResponse, *shared.APIResponse, error) { c.modifyConfigURL(location) backups, apiResponse, err := c.sdkClient.BackupsApi.BackupsFindById(ctx, backupID).Execute() apiResponse.LogInfo() @@ -47,7 +48,7 @@ func SetMariaDBClusterBackupsData(d *schema.ResourceData, retrievedBackups []mar backupEntry["size"] = *retrievedBackup.Properties.Size } var baseBackupsToBeSet []interface{} - for _, baseBackup := range *retrievedBackup.Properties.BaseBackups { + for _, baseBackup := range retrievedBackup.Properties.BaseBackups { baseBackupEntry := make(map[string]interface{}) if baseBackup.Size != nil { baseBackupEntry["size"] = *baseBackup.Size diff --git a/services/dbaas/mariadb/client.go b/services/dbaas/mariadb/client.go index c2a030aab..1c265807d 100644 --- a/services/dbaas/mariadb/client.go +++ b/services/dbaas/mariadb/client.go @@ -3,11 +3,11 @@ package mariadb import ( "fmt" "net/http" - "os" "runtime" "github.com/hashicorp/terraform-plugin-sdk/v2/meta" - mariadb "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" + shared "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" @@ -18,20 +18,18 @@ type MariaDBClient struct { } func NewMariaDBClient(username, password, token, url, version, terraformVersion string, insecure bool) *MariaDBClient { - newConfigDbaas := mariadb.NewConfiguration(username, password, token, url) + newConfigDbaas := shared.NewConfiguration(username, password, token, url) - if os.Getenv(constant.IonosDebug) != "" { - newConfigDbaas.Debug = true - } newConfigDbaas.MaxRetries = constant.MaxRetries newConfigDbaas.MaxWaitTime = constant.MaxWaitTime - newConfigDbaas.HTTPClient = &http.Client{Transport: utils.CreateTransport(insecure)} newConfigDbaas.UserAgent = fmt.Sprintf( "terraform-provider/%s_ionos-cloud-sdk-go-dbaas-mariadb/%s_hashicorp-terraform/%s_terraform-plugin-sdk/%s_os/%s_arch/%s", version, mariadb.Version, terraformVersion, meta.SDKVersionString(), runtime.GOOS, runtime.GOARCH) - - return &MariaDBClient{ + client := &MariaDBClient{ sdkClient: mariadb.NewAPIClient(newConfigDbaas), } + client.sdkClient.GetConfig().HTTPClient = &http.Client{Transport: utils.CreateTransport(insecure)} + + return client } diff --git a/services/dbaas/mariadb/cluster.go b/services/dbaas/mariadb/cluster.go index 6c10128a3..5165ee482 100644 --- a/services/dbaas/mariadb/cluster.go +++ b/services/dbaas/mariadb/cluster.go @@ -8,7 +8,8 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - mariadb "github.com/ionos-cloud/sdk-go-dbaas-mariadb" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2" + shared "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" @@ -32,14 +33,14 @@ var ionosAPIURLMariaDB = "IONOS_API_URL_MARIADB" func (c *MariaDBClient) modifyConfigURL(location string) { clientConfig := c.sdkClient.GetConfig() if location == "" && os.Getenv(ionosAPIURLMariaDB) != "" { - clientConfig.Servers = mariadb.ServerConfigurations{ + clientConfig.Servers = shared.ServerConfigurations{ { URL: utils.CleanURL(os.Getenv(ionosAPIURLMariaDB)), }, } return } - clientConfig.Servers = mariadb.ServerConfigurations{ + clientConfig.Servers = shared.ServerConfigurations{ { URL: locationToURL[location], }, @@ -47,7 +48,7 @@ func (c *MariaDBClient) modifyConfigURL(location string) { } // GetCluster retrieves a cluster by its ID and the location in which the cluster is created. -func (c *MariaDBClient) GetCluster(ctx context.Context, clusterID, location string) (mariadb.ClusterResponse, *mariadb.APIResponse, error) { +func (c *MariaDBClient) GetCluster(ctx context.Context, clusterID, location string) (mariadb.ClusterResponse, *shared.APIResponse, error) { c.modifyConfigURL(location) cluster, apiResponse, err := c.sdkClient.ClustersApi.ClustersFindById(ctx, clusterID).Execute() apiResponse.LogInfo() @@ -55,7 +56,7 @@ func (c *MariaDBClient) GetCluster(ctx context.Context, clusterID, location stri } // ListClusters retrieves a list of clusters based on the location. Filters can be used. -func (c *MariaDBClient) ListClusters(ctx context.Context, filterName, location string) (mariadb.ClusterList, *mariadb.APIResponse, error) { +func (c *MariaDBClient) ListClusters(ctx context.Context, filterName, location string) (mariadb.ClusterList, *shared.APIResponse, error) { c.modifyConfigURL(location) request := c.sdkClient.ClustersApi.ClustersGet(ctx) if filterName != "" { @@ -67,7 +68,7 @@ func (c *MariaDBClient) ListClusters(ctx context.Context, filterName, location s } // CreateCluster creates a new cluster using the provided data in the request and the location. -func (c *MariaDBClient) CreateCluster(ctx context.Context, cluster mariadb.CreateClusterRequest, location string) (mariadb.ClusterResponse, *mariadb.APIResponse, error) { +func (c *MariaDBClient) CreateCluster(ctx context.Context, cluster mariadb.CreateClusterRequest, location string) (mariadb.ClusterResponse, *shared.APIResponse, error) { c.modifyConfigURL(location) clusterResponse, apiResponse, err := c.sdkClient.ClustersApi.ClustersPost(ctx).CreateClusterRequest(cluster).Execute() apiResponse.LogInfo() @@ -75,7 +76,7 @@ func (c *MariaDBClient) CreateCluster(ctx context.Context, cluster mariadb.Creat } // UpdateCluster updates a cluster by its ID and the location in which the cluster is created. -func (c *MariaDBClient) UpdateCluster(ctx context.Context, cluster mariadb.PatchClusterRequest, clusterID, location string) (mariadb.ClusterResponse, *mariadb.APIResponse, error) { +func (c *MariaDBClient) UpdateCluster(ctx context.Context, cluster mariadb.PatchClusterRequest, clusterID, location string) (mariadb.ClusterResponse, *shared.APIResponse, error) { c.modifyConfigURL(location) clusterResponse, apiResponse, err := c.sdkClient.ClustersApi.ClustersPatch(ctx, clusterID).PatchClusterRequest(cluster).Execute() apiResponse.LogInfo() @@ -83,7 +84,7 @@ func (c *MariaDBClient) UpdateCluster(ctx context.Context, cluster mariadb.Patch } // DeleteCluster deletes a cluster by its ID and the location in which the cluster is created. -func (c *MariaDBClient) DeleteCluster(ctx context.Context, clusterID, location string) (mariadb.ClusterResponse, *mariadb.APIResponse, error) { +func (c *MariaDBClient) DeleteCluster(ctx context.Context, clusterID, location string) (mariadb.ClusterResponse, *shared.APIResponse, error) { c.modifyConfigURL(location) clusterResponse, apiResponse, err := c.sdkClient.ClustersApi.ClustersDelete(ctx, clusterID).Execute() apiResponse.LogInfo() @@ -125,27 +126,27 @@ func GetMariaDBClusterDataCreate(d *schema.ResourceData) (*mariadb.CreateCluster if mariaDBVersion, ok := d.GetOk("mariadb_version"); ok { mariaDBVersion := mariaDBVersion.(string) - cluster.Properties.MariadbVersion = (*mariadb.MariadbVersion)(&mariaDBVersion) + cluster.Properties.MariadbVersion = (mariadb.MariadbVersion)(mariaDBVersion) } if instances, ok := d.GetOk("instances"); ok { instances := int32(instances.(int)) - cluster.Properties.Instances = &instances + cluster.Properties.Instances = instances } if cores, ok := d.GetOk("cores"); ok { cores := int32(cores.(int)) - cluster.Properties.Cores = &cores + cluster.Properties.Cores = cores } if ram, ok := d.GetOk("ram"); ok { ram := int32(ram.(int)) - cluster.Properties.Ram = &ram + cluster.Properties.Ram = ram } if storageSize, ok := d.GetOk("storage_size"); ok { storageSize := int32(storageSize.(int)) - cluster.Properties.StorageSize = &storageSize + cluster.Properties.StorageSize = storageSize } if _, ok := d.GetOk("connections"); ok { @@ -154,7 +155,7 @@ func GetMariaDBClusterDataCreate(d *schema.ResourceData) (*mariadb.CreateCluster if displayName, ok := d.GetOk("display_name"); ok { displayName := displayName.(string) - cluster.Properties.DisplayName = &displayName + cluster.Properties.DisplayName = displayName } cluster.Properties.Credentials = GetMariaClusterCredentialsData(d) @@ -214,7 +215,8 @@ func GetMariaDBClusterDataUpdate(d *schema.ResourceData) (*mariadb.PatchClusterR return &cluster, nil } -func GetMariaClusterConnectionsData(d *schema.ResourceData) *[]mariadb.Connection { +// GetMariaClusterConnectionsData retrieves the data from the terraform resource and sets it in the MariaDB connection struct. +func GetMariaClusterConnectionsData(d *schema.ResourceData) []mariadb.Connection { connections := make([]mariadb.Connection, 0) if connectionsIntf, ok := d.GetOk("connections"); ok { @@ -224,54 +226,56 @@ func GetMariaClusterConnectionsData(d *schema.ResourceData) *[]mariadb.Connectio if datacenterID, ok := d.GetOk(fmt.Sprintf("connections.%d.datacenter_id", connectionIdx)); ok { datacenterID := datacenterID.(string) - connection.DatacenterId = &datacenterID + connection.DatacenterId = datacenterID } if lanID, ok := d.GetOk(fmt.Sprintf("connections.%d.lan_id", connectionIdx)); ok { lanID := lanID.(string) - connection.LanId = &lanID + connection.LanId = lanID } if cidr, ok := d.GetOk(fmt.Sprintf("connections.%d.cidr", connectionIdx)); ok { cidr := cidr.(string) - connection.Cidr = &cidr + connection.Cidr = cidr } connections = append(connections, connection) } } - return &connections + return connections } +// GetMariaClusterMaintenanceWindowData retrieves the data from the terraform resource and sets it in the MariaDB MaintenanceWindow struct. func GetMariaClusterMaintenanceWindowData(d *schema.ResourceData) *mariadb.MaintenanceWindow { var maintenanceWindow mariadb.MaintenanceWindow if timeV, ok := d.GetOk("maintenance_window.0.time"); ok { timeV := timeV.(string) - maintenanceWindow.Time = &timeV + maintenanceWindow.Time = timeV } if dayOfTheWeek, ok := d.GetOk("maintenance_window.0.day_of_the_week"); ok { dayOfTheWeek := mariadb.DayOfTheWeek(dayOfTheWeek.(string)) - maintenanceWindow.DayOfTheWeek = &dayOfTheWeek + maintenanceWindow.DayOfTheWeek = dayOfTheWeek } return &maintenanceWindow } -func GetMariaClusterCredentialsData(d *schema.ResourceData) *mariadb.DBUser { +// GetMariaClusterCredentialsData retrieves the data from the terraform resource and sets it in the MariaDB DBUser struct. +func GetMariaClusterCredentialsData(d *schema.ResourceData) mariadb.DBUser { var user mariadb.DBUser if username, ok := d.GetOk("credentials.0.username"); ok { username := username.(string) - user.Username = &username + user.Username = username } if password, ok := d.GetOk("credentials.0.password"); ok { password := password.(string) - user.Password = &password + user.Password = password } - return &user + return user } func (c *MariaDBClient) SetMariaDBClusterData(d *schema.ResourceData, cluster mariadb.ClusterResponse) error { @@ -316,9 +320,9 @@ func (c *MariaDBClient) SetMariaDBClusterData(d *schema.ResourceData, cluster ma } } - if cluster.Properties.Connections != nil && len(*cluster.Properties.Connections) > 0 { + if len(cluster.Properties.Connections) > 0 { var connections []interface{} - for _, connection := range *cluster.Properties.Connections { + for _, connection := range cluster.Properties.Connections { connectionEntry := c.SetConnectionProperties(connection) connections = append(connections, connectionEntry) } diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.gitignore b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/.gitignore similarity index 100% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.gitignore rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/.gitignore diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.travis.yml b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/.travis.yml similarity index 100% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.travis.yml rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/.travis.yml diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/LICENSE b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/LICENSE similarity index 100% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/LICENSE rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/LICENSE diff --git a/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/README.md b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/README.md new file mode 100644 index 000000000..901679652 --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/README.md @@ -0,0 +1,278 @@ +# Go API client for mariadb + +An enterprise-grade Database is provided as a Service (DBaaS) solution that +can be managed through a browser-based \"Data Center Designer\" (DCD) tool or +via an easy to use API. + +The API allows you to create additional MariaDB database clusters or modify existing +ones. It is designed to allow users to leverage the same power and +flexibility found within the DCD visual tool. Both tools are consistent with +their concepts and lend well to making the experience smooth and intuitive. + + +## 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/dbaas/mariadb.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/dbaas/mariadb.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/dbaas/mariadb@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://mariadb.de-txl.ionos.com* - Berlin, Germany +- *https://mariadb.de-fra.ionos.com* - Frankfurt, Germany +- *https://mariadb.es-vit.ionos.com* - Logroño, Spain +- *https://mariadb.fr-par.ionos.com* - Paris, France +- *https://mariadb.gb-lhr.ionos.com* - London, Great Britain +- *https://mariadb.us-ewr.ionos.com* - Newark, USA +- *https://mariadb.us-las.ionos.com* - Las Vegas, USA +- *https://mariadb.us-mci.ionos.com* - Lenexa, USA + +By default, *https://mariadb.de-txl.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" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb" + "log" +) + +func basicAuthExample() error { + cfg := shared.NewConfiguration("username_here", "pwd_here", "", "hostUrl_here") + cfg.LogLevel = Trace + apiClient := mariadb.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" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb" + "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 := mariadb.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" + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb" + "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 := mariadb.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 ( + mariadb "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb" + "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 := mariadb.NewAPIClient(cfg) +} +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://mariadb.de-txl.ionos.com* +
+API Endpoints table + + +Class | Method | HTTP request | Description +------------- | ------------- | ------------- | ------------- +BackupsApi | [**BackupsFindById**](docs/api/BackupsApi.md#backupsfindbyid) | **Get** /backups/{backupId} | Fetch backups +BackupsApi | [**BackupsGet**](docs/api/BackupsApi.md#backupsget) | **Get** /backups | List of backups. +BackupsApi | [**ClusterBackupsGet**](docs/api/BackupsApi.md#clusterbackupsget) | **Get** /clusters/{clusterId}/backups | List backups of cluster +ClustersApi | [**ClustersDelete**](docs/api/ClustersApi.md#clustersdelete) | **Delete** /clusters/{clusterId} | Delete a cluster +ClustersApi | [**ClustersFindById**](docs/api/ClustersApi.md#clustersfindbyid) | **Get** /clusters/{clusterId} | Fetch a cluster +ClustersApi | [**ClustersGet**](docs/api/ClustersApi.md#clustersget) | **Get** /clusters | List clusters +ClustersApi | [**ClustersPatch**](docs/api/ClustersApi.md#clusterspatch) | **Patch** /clusters/{clusterId} | Update a cluster +ClustersApi | [**ClustersPost**](docs/api/ClustersApi.md#clusterspost) | **Post** /clusters | Create a cluster +RestoreApi | [**ClustersRestore**](docs/api/RestoreApi.md#clustersrestore) | **Post** /clusters/{clusterId}/restore | In-place restore of a cluster. + +
+ +## Documentation For Models + +All URIs are relative to *https://mariadb.de-txl.ionos.com* +
+API models list + + - [Backup](docs/models/Backup) + - [BackupList](docs/models/BackupList) + - [BackupListAllOf](docs/models/BackupListAllOf) + - [BackupResponse](docs/models/BackupResponse) + - [BaseBackup](docs/models/BaseBackup) + - [ClusterList](docs/models/ClusterList) + - [ClusterListAllOf](docs/models/ClusterListAllOf) + - [ClusterMetadata](docs/models/ClusterMetadata) + - [ClusterProperties](docs/models/ClusterProperties) + - [ClusterResponse](docs/models/ClusterResponse) + - [ClustersGet400Response](docs/models/ClustersGet400Response) + - [ClustersGet401Response](docs/models/ClustersGet401Response) + - [ClustersGet403Response](docs/models/ClustersGet403Response) + - [ClustersGet404Response](docs/models/ClustersGet404Response) + - [ClustersGet405Response](docs/models/ClustersGet405Response) + - [ClustersGet415Response](docs/models/ClustersGet415Response) + - [ClustersGet422Response](docs/models/ClustersGet422Response) + - [ClustersGet429Response](docs/models/ClustersGet429Response) + - [ClustersGet500Response](docs/models/ClustersGet500Response) + - [ClustersGet503Response](docs/models/ClustersGet503Response) + - [Connection](docs/models/Connection) + - [CreateClusterProperties](docs/models/CreateClusterProperties) + - [CreateClusterRequest](docs/models/CreateClusterRequest) + - [DBUser](docs/models/DBUser) + - [DayOfTheWeek](docs/models/DayOfTheWeek) + - [ErrorMessage](docs/models/ErrorMessage) + - [MaintenanceWindow](docs/models/MaintenanceWindow) + - [MariadbVersion](docs/models/MariadbVersion) + - [Pagination](docs/models/Pagination) + - [PaginationLinks](docs/models/PaginationLinks) + - [PatchClusterProperties](docs/models/PatchClusterProperties) + - [PatchClusterRequest](docs/models/PatchClusterRequest) + - [RestoreRequest](docs/models/RestoreRequest) + - [State](docs/models/State) + + +[[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-dbaas-mariadb/api_backups.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_backups.go similarity index 81% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_backups.go index c930a0ca0..f281df527 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_backups.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -33,7 +34,7 @@ type ApiBackupsFindByIdRequest struct { backupId string } -func (r ApiBackupsFindByIdRequest) Execute() (BackupResponse, *APIResponse, error) { +func (r ApiBackupsFindByIdRequest) Execute() (BackupResponse, *shared.APIResponse, error) { return r.ApiService.BackupsFindByIdExecute(r) } @@ -59,7 +60,7 @@ func (a *BackupsApiService) BackupsFindById(ctx _context.Context, backupId strin * Execute executes the request * @return BackupResponse */ -func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) (BackupResponse, *APIResponse, error) { +func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) (BackupResponse, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -71,11 +72,13 @@ func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupsApiService.BackupsFindById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/backups/{backupId}" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", _neturl.PathEscape(parameterToString(r.backupId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", _neturl.PathEscape(parameterValueToString(r.backupId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -100,7 +103,7 @@ func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -119,7 +122,7 @@ func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -139,111 +142,109 @@ func (a *BackupsApiService) BackupsFindByIdExecute(r ApiBackupsFindByIdRequest) } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -266,7 +267,7 @@ func (r ApiBackupsGetRequest) Offset(offset int32) ApiBackupsGetRequest { return r } -func (r ApiBackupsGetRequest) Execute() (BackupList, *APIResponse, error) { +func (r ApiBackupsGetRequest) Execute() (BackupList, *shared.APIResponse, error) { return r.ApiService.BackupsGetExecute(r) } @@ -288,7 +289,7 @@ func (a *BackupsApiService) BackupsGet(ctx _context.Context) ApiBackupsGetReques * Execute executes the request * @return BackupList */ -func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupList, *APIResponse, error) { +func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -300,7 +301,9 @@ func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupLis localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupsApiService.BackupsGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/backups" @@ -310,10 +313,10 @@ func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupLis localVarFormParams := _neturl.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -334,7 +337,7 @@ func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupLis } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -353,7 +356,7 @@ func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupLis localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -373,111 +376,109 @@ func (a *BackupsApiService) BackupsGetExecute(r ApiBackupsGetRequest) (BackupLis } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -501,7 +502,7 @@ func (r ApiClusterBackupsGetRequest) Offset(offset int32) ApiClusterBackupsGetRe return r } -func (r ApiClusterBackupsGetRequest) Execute() (BackupList, *APIResponse, error) { +func (r ApiClusterBackupsGetRequest) Execute() (BackupList, *shared.APIResponse, error) { return r.ApiService.ClusterBackupsGetExecute(r) } @@ -525,7 +526,7 @@ func (a *BackupsApiService) ClusterBackupsGet(ctx _context.Context, clusterId st * Execute executes the request * @return BackupList */ -func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetRequest) (BackupList, *APIResponse, error) { +func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetRequest) (BackupList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -537,21 +538,23 @@ func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetReque localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupsApiService.ClusterBackupsGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters/{clusterId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterValueToString(r.clusterId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -572,7 +575,7 @@ func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetReque } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -591,7 +594,7 @@ func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetReque localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -611,111 +614,109 @@ func (a *BackupsApiService) ClusterBackupsGetExecute(r ApiClusterBackupsGetReque } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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-dbaas-mariadb/api_clusters.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_clusters.go similarity index 82% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_clusters.go index a1a9f4080..b60ca1ff8 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_clusters.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -33,7 +34,7 @@ type ApiClustersDeleteRequest struct { clusterId string } -func (r ApiClustersDeleteRequest) Execute() (ClusterResponse, *APIResponse, error) { +func (r ApiClustersDeleteRequest) Execute() (ClusterResponse, *shared.APIResponse, error) { return r.ApiService.ClustersDeleteExecute(r) } @@ -56,7 +57,7 @@ func (a *ClustersApiService) ClustersDelete(ctx _context.Context, clusterId stri * Execute executes the request * @return ClusterResponse */ -func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) (ClusterResponse, *APIResponse, error) { +func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) (ClusterResponse, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -68,11 +69,13 @@ func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) ( localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters/{clusterId}" - localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterValueToString(r.clusterId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -97,7 +100,7 @@ func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) ( } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -116,7 +119,7 @@ func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) ( localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -136,111 +139,109 @@ func (a *ClustersApiService) ClustersDeleteExecute(r ApiClustersDeleteRequest) ( } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -253,7 +254,7 @@ type ApiClustersFindByIdRequest struct { clusterId string } -func (r ApiClustersFindByIdRequest) Execute() (ClusterResponse, *APIResponse, error) { +func (r ApiClustersFindByIdRequest) Execute() (ClusterResponse, *shared.APIResponse, error) { return r.ApiService.ClustersFindByIdExecute(r) } @@ -280,7 +281,7 @@ func (a *ClustersApiService) ClustersFindById(ctx _context.Context, clusterId st * Execute executes the request * @return ClusterResponse */ -func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdRequest) (ClusterResponse, *APIResponse, error) { +func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdRequest) (ClusterResponse, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -292,11 +293,13 @@ func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdReques localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersFindById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters/{clusterId}" - localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterValueToString(r.clusterId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -321,7 +324,7 @@ func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdReques } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -340,7 +343,7 @@ func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdReques localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -360,111 +363,109 @@ func (a *ClustersApiService) ClustersFindByIdExecute(r ApiClustersFindByIdReques } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -492,7 +493,7 @@ func (r ApiClustersGetRequest) FilterName(filterName string) ApiClustersGetReque return r } -func (r ApiClustersGetRequest) Execute() (ClusterList, *APIResponse, error) { +func (r ApiClustersGetRequest) Execute() (ClusterList, *shared.APIResponse, error) { return r.ApiService.ClustersGetExecute(r) } @@ -513,7 +514,7 @@ func (a *ClustersApiService) ClustersGet(ctx _context.Context) ApiClustersGetReq * Execute executes the request * @return ClusterList */ -func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (ClusterList, *APIResponse, error) { +func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (ClusterList, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -525,7 +526,9 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters" @@ -535,13 +538,13 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste localVarFormParams := _neturl.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") } if r.filterName != nil { - localVarQueryParams.Add("filter.name", parameterToString(*r.filterName, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "filter.name", r.filterName, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -562,7 +565,7 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste } if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -581,7 +584,7 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -601,111 +604,109 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -724,7 +725,7 @@ func (r ApiClustersPatchRequest) PatchClusterRequest(patchClusterRequest PatchCl return r } -func (r ApiClustersPatchRequest) Execute() (ClusterResponse, *APIResponse, error) { +func (r ApiClustersPatchRequest) Execute() (ClusterResponse, *shared.APIResponse, error) { return r.ApiService.ClustersPatchExecute(r) } @@ -747,7 +748,7 @@ func (a *ClustersApiService) ClustersPatch(ctx _context.Context, clusterId strin * Execute executes the request * @return ClusterResponse */ -func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (ClusterResponse, *APIResponse, error) { +func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (ClusterResponse, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -759,11 +760,13 @@ func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (Cl localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters/{clusterId}" - localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterValueToString(r.clusterId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -793,7 +796,7 @@ func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (Cl localVarPostBody = r.patchClusterRequest if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -812,7 +815,7 @@ func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (Cl localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -832,111 +835,109 @@ func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (Cl } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } @@ -954,7 +955,7 @@ func (r ApiClustersPostRequest) CreateClusterRequest(createClusterRequest Create return r } -func (r ApiClustersPostRequest) Execute() (ClusterResponse, *APIResponse, error) { +func (r ApiClustersPostRequest) Execute() (ClusterResponse, *shared.APIResponse, error) { return r.ApiService.ClustersPostExecute(r) } @@ -976,7 +977,7 @@ func (a *ClustersApiService) ClustersPost(ctx _context.Context) ApiClustersPostR * Execute executes the request * @return ClusterResponse */ -func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (ClusterResponse, *APIResponse, error) { +func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (ClusterResponse, *shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -988,7 +989,9 @@ func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (Clus localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return localVarReturnValue, nil, gerr } localVarPath := localBasePath + "/clusters" @@ -1021,7 +1024,7 @@ func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (Clus localVarPostBody = r.createClusterRequest if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -1040,7 +1043,7 @@ func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (Clus localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -1060,111 +1063,109 @@ func (a *ClustersApiService) ClustersPostExecute(r ApiClustersPostRequest) (Clus } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 ClustersGet415Response 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 ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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-dbaas-mariadb/api_restore.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_restore.go similarity index 84% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_restore.go index 62b8f1816..d0b20a639 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/api_restore.go @@ -8,11 +8,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( _context "context" "fmt" + "github.com/ionos-cloud/sdk-go-bundle/shared" "io" _nethttp "net/http" _neturl "net/url" @@ -39,7 +40,7 @@ func (r ApiClustersRestoreRequest) RestoreRequest(restoreRequest RestoreRequest) return r } -func (r ApiClustersRestoreRequest) Execute() (*APIResponse, error) { +func (r ApiClustersRestoreRequest) Execute() (*shared.APIResponse, error) { return r.ApiService.ClustersRestoreExecute(r) } @@ -66,7 +67,7 @@ func (a *RestoreApiService) ClustersRestore(ctx _context.Context, clusterId stri /* * Execute executes the request */ -func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) (*APIResponse, error) { +func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) (*shared.APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -77,11 +78,13 @@ func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RestoreApiService.ClustersRestore") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + gerr := shared.GenericOpenAPIError{} + gerr.SetError(err.Error()) + return nil, gerr } localVarPath := localBasePath + "/clusters/{clusterId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterValueToString(r.clusterId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -111,7 +114,7 @@ func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) localVarPostBody = r.restoreRequest if r.ctx != nil { // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := r.ctx.Value(shared.ContextAPIKeys).(map[string]shared.APIKey); ok { if apiKey, ok := auth["tokenAuth"]; ok { var key string if apiKey.Prefix != "" { @@ -130,7 +133,7 @@ func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse{ + localVarAPIResponse := &shared.APIResponse{ Response: localVarHTTPResponse, Method: localVarHTTPMethod, RequestTime: httpRequestTime, @@ -150,100 +153,99 @@ func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) } 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 ClustersGet400Response 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 ClustersGet401Response 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 ClustersGet403Response 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 ClustersGet404Response 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 == 405 { var v ClustersGet405Response 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 == 415 { var v ClustersGet415Response 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 == 422 { var v ClustersGet422Response 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 ClustersGet429Response 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 ClustersGet500Response 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 ClustersGet503Response 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 } diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/client.go similarity index 72% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/client.go index e5d662fa0..370990cae 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/client.go @@ -8,7 +8,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb 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.1.1" + Version = "products/dbaas/mariadb/v2.0.0" ) // APIClient manages communication with the IONOS DBaaS MariaDB REST API API v0.1.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,91 @@ 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://mariadb.de-txl.ionos.com", + Description: "Berlin, Germany", + }, + { + URL: "https://mariadb.de-fra.ionos.com", + Description: "Frankfurt, Germany", + }, + { + URL: "https://mariadb.es-vit.ionos.com", + Description: "Logroño, Spain", + }, + { + URL: "https://mariadb.fr-par.ionos.com", + Description: "Paris, France", + }, + { + URL: "https://mariadb.gb-lhr.ionos.com", + Description: "London, Great Britain", + }, + { + URL: "https://mariadb.us-ewr.ionos.com", + Description: "Newark, USA", + }, + { + URL: "https://mariadb.us-las.ionos.com", + Description: "Las Vegas, USA", + }, + { + URL: "https://mariadb.us-mci.ionos.com", + Description: "Lenexa, USA", + }, + } } - //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 +312,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 +430,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 +448,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 +484,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 +500,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 +517,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 +631,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 +674,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 +685,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 +856,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-dbaas-mariadb/model_backup.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup.go similarity index 65% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup.go index ff6f0605c..e77cbae68 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "time" ) +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + // Backup A backup object. type Backup struct { // The unique ID of the cluster that was backed up. @@ -22,8 +26,8 @@ type Backup struct { // The oldest available timestamp to which you can restore. EarliestRecoveryTargetTime *IonosTime `json:"earliestRecoveryTargetTime,omitempty"` // Size of all base backups in MiB. This is at least the sum of all base backup sizes. - Size *int32 `json:"size,omitempty"` - BaseBackups *[]BaseBackup `json:"baseBackups,omitempty"` + Size *int32 `json:"size,omitempty"` + BaseBackups []BaseBackup `json:"baseBackups,omitempty"` } // NewBackup instantiates a new Backup object @@ -44,184 +48,149 @@ func NewBackupWithDefaults() *Backup { return &this } -// GetClusterId returns the ClusterId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *Backup) GetClusterId() *string { - if o == nil { - return nil +// GetClusterId returns the ClusterId field value if set, zero value otherwise. +func (o *Backup) GetClusterId() string { + if o == nil || IsNil(o.ClusterId) { + var ret string + return ret } - - return o.ClusterId - + return *o.ClusterId } -// GetClusterIdOk returns a tuple with the ClusterId field value +// GetClusterIdOk returns a tuple with the ClusterId 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 *Backup) GetClusterIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.ClusterId) { return nil, false } - return o.ClusterId, true } -// SetClusterId sets field value -func (o *Backup) SetClusterId(v string) { - - o.ClusterId = &v - -} - // HasClusterId returns a boolean if a field has been set. func (o *Backup) HasClusterId() bool { - if o != nil && o.ClusterId != nil { + if o != nil && !IsNil(o.ClusterId) { return true } return false } -// GetEarliestRecoveryTargetTime returns the EarliestRecoveryTargetTime field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *Backup) GetEarliestRecoveryTargetTime() *time.Time { - if o == nil { - return nil - } +// SetClusterId gets a reference to the given string and assigns it to the ClusterId field. +func (o *Backup) SetClusterId(v string) { + o.ClusterId = &v +} - if o.EarliestRecoveryTargetTime == nil { - return nil +// GetEarliestRecoveryTargetTime returns the EarliestRecoveryTargetTime field value if set, zero value otherwise. +func (o *Backup) GetEarliestRecoveryTargetTime() time.Time { + if o == nil || IsNil(o.EarliestRecoveryTargetTime) { + var ret time.Time + return ret } - return &o.EarliestRecoveryTargetTime.Time - + return o.EarliestRecoveryTargetTime.Time } -// GetEarliestRecoveryTargetTimeOk returns a tuple with the EarliestRecoveryTargetTime field value +// GetEarliestRecoveryTargetTimeOk returns a tuple with the EarliestRecoveryTargetTime 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 *Backup) GetEarliestRecoveryTargetTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.EarliestRecoveryTargetTime == nil { + if o == nil || IsNil(o.EarliestRecoveryTargetTime) { return nil, false } return &o.EarliestRecoveryTargetTime.Time, true - -} - -// SetEarliestRecoveryTargetTime sets field value -func (o *Backup) SetEarliestRecoveryTargetTime(v time.Time) { - - o.EarliestRecoveryTargetTime = &IonosTime{v} - } // HasEarliestRecoveryTargetTime returns a boolean if a field has been set. func (o *Backup) HasEarliestRecoveryTargetTime() bool { - if o != nil && o.EarliestRecoveryTargetTime != nil { + if o != nil && !IsNil(o.EarliestRecoveryTargetTime) { return true } return false } -// GetSize returns the Size field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *Backup) GetSize() *int32 { - if o == nil { - return nil - } - - return o.Size +// SetEarliestRecoveryTargetTime gets a reference to the given time.Time and assigns it to the EarliestRecoveryTargetTime field. +func (o *Backup) SetEarliestRecoveryTargetTime(v time.Time) { + o.EarliestRecoveryTargetTime = &IonosTime{v} +} +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size } -// GetSizeOk returns a tuple with the Size field value +// GetSizeOk returns a tuple with the Size 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 *Backup) GetSizeOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Size) { return nil, false } - return o.Size, true } -// SetSize sets field value -func (o *Backup) SetSize(v int32) { - - o.Size = &v - -} - // HasSize returns a boolean if a field has been set. func (o *Backup) HasSize() bool { - if o != nil && o.Size != nil { + if o != nil && !IsNil(o.Size) { return true } return false } -// GetBaseBackups returns the BaseBackups field value -// If the value is explicit nil, the zero value for []BaseBackup will be returned -func (o *Backup) GetBaseBackups() *[]BaseBackup { - if o == nil { - return nil - } +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} +// GetBaseBackups returns the BaseBackups field value if set, zero value otherwise. +func (o *Backup) GetBaseBackups() []BaseBackup { + if o == nil || IsNil(o.BaseBackups) { + var ret []BaseBackup + return ret + } return o.BaseBackups - } -// GetBaseBackupsOk returns a tuple with the BaseBackups field value +// GetBaseBackupsOk returns a tuple with the BaseBackups 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 *Backup) GetBaseBackupsOk() (*[]BaseBackup, bool) { - if o == nil { +func (o *Backup) GetBaseBackupsOk() ([]BaseBackup, bool) { + if o == nil || IsNil(o.BaseBackups) { return nil, false } - return o.BaseBackups, true } -// SetBaseBackups sets field value -func (o *Backup) SetBaseBackups(v []BaseBackup) { - - o.BaseBackups = &v - -} - // HasBaseBackups returns a boolean if a field has been set. func (o *Backup) HasBaseBackups() bool { - if o != nil && o.BaseBackups != nil { + if o != nil && !IsNil(o.BaseBackups) { return true } return false } -func (o Backup) MarshalJSON() ([]byte, error) { +// SetBaseBackups gets a reference to the given []BaseBackup and assigns it to the BaseBackups field. +func (o *Backup) SetBaseBackups(v []BaseBackup) { + o.BaseBackups = v +} + +func (o Backup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ClusterId != nil { + if !IsNil(o.ClusterId) { toSerialize["clusterId"] = o.ClusterId } - - if o.EarliestRecoveryTargetTime != nil { + if !IsNil(o.EarliestRecoveryTargetTime) { toSerialize["earliestRecoveryTargetTime"] = o.EarliestRecoveryTargetTime } - - if o.Size != nil { + if !IsNil(o.Size) { toSerialize["size"] = o.Size } - - if o.BaseBackups != nil { + if !IsNil(o.BaseBackups) { toSerialize["baseBackups"] = o.BaseBackups } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBackup struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list.go similarity index 62% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list.go index 1ea8caa5d..0b443abcd 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the BackupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupList{} + // BackupList List of backups. type BackupList struct { // The unique ID of the resource. - Id *string `json:"id,omitempty"` - Items *[]BackupResponse `json:"items,omitempty"` + Id *string `json:"id,omitempty"` + Items []BackupResponse `json:"items,omitempty"` // The offset specified in the request (if none was specified, the default offset is 0). Offset *int32 `json:"offset,omitempty"` // The limit specified in the request (if none was specified, the default limit is 100). @@ -59,261 +62,219 @@ func NewBackupListWithDefaults() *BackupList { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *BackupList) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupList) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *BackupList) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *BackupList) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *BackupList) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []BackupResponse will be returned -func (o *BackupList) GetItems() *[]BackupResponse { - if o == nil { - return nil - } +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BackupList) SetId(v string) { + o.Id = &v +} +// GetItems returns the Items field value if set, zero value otherwise. +func (o *BackupList) GetItems() []BackupResponse { + if o == nil || IsNil(o.Items) { + var ret []BackupResponse + return ret + } 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 *BackupList) GetItemsOk() (*[]BackupResponse, bool) { - if o == nil { +func (o *BackupList) GetItemsOk() ([]BackupResponse, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *BackupList) SetItems(v []BackupResponse) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *BackupList) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -// GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *BackupList) GetOffset() *int32 { - if o == nil { - return nil - } - - return o.Offset +// SetItems gets a reference to the given []BackupResponse and assigns it to the Items field. +func (o *BackupList) SetItems(v []BackupResponse) { + o.Items = v +} +// GetOffset returns the Offset field value if set, zero value otherwise. +func (o *BackupList) GetOffset() int32 { + if o == nil || IsNil(o.Offset) { + var ret int32 + return ret + } + return *o.Offset } -// GetOffsetOk returns a tuple with the Offset field value +// GetOffsetOk returns a tuple with the Offset 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 *BackupList) GetOffsetOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Offset) { return nil, false } - return o.Offset, true } -// SetOffset sets field value -func (o *BackupList) SetOffset(v int32) { - - o.Offset = &v - -} - // HasOffset returns a boolean if a field has been set. func (o *BackupList) HasOffset() bool { - if o != nil && o.Offset != nil { + if o != nil && !IsNil(o.Offset) { return true } return false } -// GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *BackupList) GetLimit() *int32 { - if o == nil { - return nil - } - - return o.Limit +// SetOffset gets a reference to the given int32 and assigns it to the Offset field. +func (o *BackupList) SetOffset(v int32) { + o.Offset = &v +} +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *BackupList) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit } -// GetLimitOk returns a tuple with the Limit field value +// GetLimitOk returns a tuple with the Limit 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 *BackupList) GetLimitOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Limit) { return nil, false } - return o.Limit, true } -// SetLimit sets field value -func (o *BackupList) SetLimit(v int32) { - - o.Limit = &v - -} - // HasLimit returns a boolean if a field has been set. func (o *BackupList) HasLimit() bool { - if o != nil && o.Limit != nil { + if o != nil && !IsNil(o.Limit) { return true } return false } -// GetTotal returns the Total field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *BackupList) GetTotal() *int32 { - if o == nil { - return nil - } - - return o.Total +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *BackupList) SetLimit(v int32) { + o.Limit = &v +} +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *BackupList) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total } -// GetTotalOk returns a tuple with the Total field value +// GetTotalOk returns a tuple with the Total 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 *BackupList) GetTotalOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Total) { return nil, false } - return o.Total, true } -// SetTotal sets field value -func (o *BackupList) SetTotal(v int32) { - - o.Total = &v - -} - // HasTotal returns a boolean if a field has been set. func (o *BackupList) HasTotal() bool { - if o != nil && o.Total != nil { + if o != nil && !IsNil(o.Total) { return true } return false } -// GetLinks returns the Links field value -// If the value is explicit nil, the zero value for PaginationLinks will be returned -func (o *BackupList) GetLinks() *PaginationLinks { - if o == nil { - return nil - } - - return o.Links +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *BackupList) SetTotal(v int32) { + o.Total = &v +} +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *BackupList) GetLinks() PaginationLinks { + if o == nil || IsNil(o.Links) { + var ret PaginationLinks + return ret + } + return *o.Links } -// GetLinksOk returns a tuple with the Links field value +// GetLinksOk returns a tuple with the Links 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 *BackupList) GetLinksOk() (*PaginationLinks, bool) { - if o == nil { + if o == nil || IsNil(o.Links) { return nil, false } - return o.Links, true } -// SetLinks sets field value -func (o *BackupList) SetLinks(v PaginationLinks) { - - o.Links = &v - -} - // HasLinks returns a boolean if a field has been set. func (o *BackupList) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !IsNil(o.Links) { return true } return false } -func (o BackupList) MarshalJSON() ([]byte, error) { +// SetLinks gets a reference to the given PaginationLinks and assigns it to the Links field. +func (o *BackupList) SetLinks(v PaginationLinks) { + o.Links = &v +} + +func (o BackupList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Items != nil { + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - if o.Offset != nil { + if !IsNil(o.Offset) { toSerialize["offset"] = o.Offset } - - if o.Limit != nil { + if !IsNil(o.Limit) { toSerialize["limit"] = o.Limit } - - if o.Total != nil { + if !IsNil(o.Total) { toSerialize["total"] = o.Total } - - if o.Links != nil { + if !IsNil(o.Links) { toSerialize["_links"] = o.Links } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBackupList struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list_all_of.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list_all_of.go index 40903802c..050f4a785 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_list_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_list_all_of.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the BackupListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListAllOf{} + // BackupListAllOf struct for BackupListAllOf type BackupListAllOf struct { // The unique ID of the resource. - Id *string `json:"id,omitempty"` - Items *[]BackupResponse `json:"items,omitempty"` + Id *string `json:"id,omitempty"` + Items []BackupResponse `json:"items,omitempty"` } // NewBackupListAllOf instantiates a new BackupListAllOf object @@ -39,93 +42,79 @@ func NewBackupListAllOfWithDefaults() *BackupListAllOf { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *BackupListAllOf) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupListAllOf) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *BackupListAllOf) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *BackupListAllOf) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *BackupListAllOf) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []BackupResponse will be returned -func (o *BackupListAllOf) GetItems() *[]BackupResponse { - if o == nil { - return nil - } +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BackupListAllOf) SetId(v string) { + o.Id = &v +} +// GetItems returns the Items field value if set, zero value otherwise. +func (o *BackupListAllOf) GetItems() []BackupResponse { + if o == nil || IsNil(o.Items) { + var ret []BackupResponse + return ret + } 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 *BackupListAllOf) GetItemsOk() (*[]BackupResponse, bool) { - if o == nil { +func (o *BackupListAllOf) GetItemsOk() ([]BackupResponse, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *BackupListAllOf) SetItems(v []BackupResponse) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *BackupListAllOf) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -func (o BackupListAllOf) MarshalJSON() ([]byte, error) { +// SetItems gets a reference to the given []BackupResponse and assigns it to the Items field. +func (o *BackupListAllOf) SetItems(v []BackupResponse) { + o.Items = v +} + +func (o BackupListAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Items != nil { + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBackupListAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_response.go similarity index 74% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_response.go index f130c0cdf..491f2ecf6 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_backup_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_backup_response.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the BackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupResponse{} + // BackupResponse A database backup. type BackupResponse struct { // The unique ID of the resource. @@ -39,93 +42,79 @@ func NewBackupResponseWithDefaults() *BackupResponse { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *BackupResponse) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *BackupResponse) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *BackupResponse) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *BackupResponse) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for Backup will be returned -func (o *BackupResponse) GetProperties() *Backup { - if o == nil { - return nil - } - - return o.Properties +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BackupResponse) SetId(v string) { + o.Id = &v +} +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *BackupResponse) GetProperties() Backup { + if o == nil || IsNil(o.Properties) { + var ret Backup + return ret + } + return *o.Properties } -// GetPropertiesOk returns a tuple with the Properties field value +// GetPropertiesOk returns a tuple with the Properties 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 *BackupResponse) GetPropertiesOk() (*Backup, bool) { - if o == nil { + if o == nil || IsNil(o.Properties) { return nil, false } - return o.Properties, true } -// SetProperties sets field value -func (o *BackupResponse) SetProperties(v Backup) { - - o.Properties = &v - -} - // HasProperties returns a boolean if a field has been set. func (o *BackupResponse) HasProperties() bool { - if o != nil && o.Properties != nil { + if o != nil && !IsNil(o.Properties) { return true } return false } -func (o BackupResponse) MarshalJSON() ([]byte, error) { +// SetProperties gets a reference to the given Backup and assigns it to the Properties field. +func (o *BackupResponse) SetProperties(v Backup) { + o.Properties = &v +} + +func (o BackupResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Properties != nil { + if !IsNil(o.Properties) { toSerialize["properties"] = o.Properties } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBackupResponse struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_base_backup.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_base_backup.go similarity index 73% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_base_backup.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_base_backup.go index 1aa45fa85..5a7eb8cfd 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_base_backup.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_base_backup.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "time" ) +// checks if the BaseBackup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseBackup{} + // BaseBackup A single base backup. type BaseBackup struct { // The ISO 8601 creation timestamp. @@ -41,100 +45,79 @@ func NewBaseBackupWithDefaults() *BaseBackup { return &this } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *BaseBackup) GetCreated() *time.Time { - if o == nil { - return nil +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *BaseBackup) GetCreated() time.Time { + if o == nil || IsNil(o.Created) { + var ret time.Time + return ret } - - if o.Created == nil { - return nil - } - return &o.Created.Time - + return o.Created.Time } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created 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 *BaseBackup) GetCreatedOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.Created == nil { + if o == nil || IsNil(o.Created) { return nil, false } return &o.Created.Time, true - -} - -// SetCreated sets field value -func (o *BaseBackup) SetCreated(v time.Time) { - - o.Created = &IonosTime{v} - } // HasCreated returns a boolean if a field has been set. func (o *BaseBackup) HasCreated() bool { - if o != nil && o.Created != nil { + if o != nil && !IsNil(o.Created) { return true } return false } -// GetSize returns the Size field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *BaseBackup) GetSize() *int32 { - if o == nil { - return nil - } - - return o.Size +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *BaseBackup) SetCreated(v time.Time) { + o.Created = &IonosTime{v} +} +// GetSize returns the Size field value if set, zero value otherwise. +func (o *BaseBackup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size } -// GetSizeOk returns a tuple with the Size field value +// GetSizeOk returns a tuple with the Size 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 *BaseBackup) GetSizeOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Size) { return nil, false } - return o.Size, true } -// SetSize sets field value -func (o *BaseBackup) SetSize(v int32) { - - o.Size = &v - -} - // HasSize returns a boolean if a field has been set. func (o *BaseBackup) HasSize() bool { - if o != nil && o.Size != nil { + if o != nil && !IsNil(o.Size) { return true } return false } -func (o BaseBackup) MarshalJSON() ([]byte, error) { +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *BaseBackup) SetSize(v int32) { + o.Size = &v +} + +func (o BaseBackup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Created != nil { + if !IsNil(o.Created) { toSerialize["created"] = o.Created } - - if o.Size != nil { + if !IsNil(o.Size) { toSerialize["size"] = o.Size } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBaseBackup struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list.go similarity index 62% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list.go index 75a123204..f6096c603 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClusterList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterList{} + // ClusterList List of clusters. type ClusterList struct { // The unique ID of the resource. - Id *string `json:"id,omitempty"` - Items *[]ClusterResponse `json:"items,omitempty"` + Id *string `json:"id,omitempty"` + Items []ClusterResponse `json:"items,omitempty"` // The offset specified in the request (if none was specified, the default offset is 0). Offset *int32 `json:"offset,omitempty"` // The limit specified in the request (if none was specified, the default limit is 100). @@ -59,261 +62,219 @@ func NewClusterListWithDefaults() *ClusterList { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ClusterList) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *ClusterList) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *ClusterList) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *ClusterList) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *ClusterList) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []ClusterResponse will be returned -func (o *ClusterList) GetItems() *[]ClusterResponse { - if o == nil { - return nil - } +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ClusterList) SetId(v string) { + o.Id = &v +} +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ClusterList) GetItems() []ClusterResponse { + if o == nil || IsNil(o.Items) { + var ret []ClusterResponse + return ret + } 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 *ClusterList) GetItemsOk() (*[]ClusterResponse, bool) { - if o == nil { +func (o *ClusterList) GetItemsOk() ([]ClusterResponse, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *ClusterList) SetItems(v []ClusterResponse) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *ClusterList) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -// GetOffset returns the Offset field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterList) GetOffset() *int32 { - if o == nil { - return nil - } - - return o.Offset +// SetItems gets a reference to the given []ClusterResponse and assigns it to the Items field. +func (o *ClusterList) SetItems(v []ClusterResponse) { + o.Items = v +} +// GetOffset returns the Offset field value if set, zero value otherwise. +func (o *ClusterList) GetOffset() int32 { + if o == nil || IsNil(o.Offset) { + var ret int32 + return ret + } + return *o.Offset } -// GetOffsetOk returns a tuple with the Offset field value +// GetOffsetOk returns a tuple with the Offset 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 *ClusterList) GetOffsetOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Offset) { return nil, false } - return o.Offset, true } -// SetOffset sets field value -func (o *ClusterList) SetOffset(v int32) { - - o.Offset = &v - -} - // HasOffset returns a boolean if a field has been set. func (o *ClusterList) HasOffset() bool { - if o != nil && o.Offset != nil { + if o != nil && !IsNil(o.Offset) { return true } return false } -// GetLimit returns the Limit field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterList) GetLimit() *int32 { - if o == nil { - return nil - } - - return o.Limit +// SetOffset gets a reference to the given int32 and assigns it to the Offset field. +func (o *ClusterList) SetOffset(v int32) { + o.Offset = &v +} +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *ClusterList) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit } -// GetLimitOk returns a tuple with the Limit field value +// GetLimitOk returns a tuple with the Limit 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 *ClusterList) GetLimitOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Limit) { return nil, false } - return o.Limit, true } -// SetLimit sets field value -func (o *ClusterList) SetLimit(v int32) { - - o.Limit = &v - -} - // HasLimit returns a boolean if a field has been set. func (o *ClusterList) HasLimit() bool { - if o != nil && o.Limit != nil { + if o != nil && !IsNil(o.Limit) { return true } return false } -// GetTotal returns the Total field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterList) GetTotal() *int32 { - if o == nil { - return nil - } - - return o.Total +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *ClusterList) SetLimit(v int32) { + o.Limit = &v +} +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *ClusterList) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total } -// GetTotalOk returns a tuple with the Total field value +// GetTotalOk returns a tuple with the Total 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 *ClusterList) GetTotalOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Total) { return nil, false } - return o.Total, true } -// SetTotal sets field value -func (o *ClusterList) SetTotal(v int32) { - - o.Total = &v - -} - // HasTotal returns a boolean if a field has been set. func (o *ClusterList) HasTotal() bool { - if o != nil && o.Total != nil { + if o != nil && !IsNil(o.Total) { return true } return false } -// GetLinks returns the Links field value -// If the value is explicit nil, the zero value for PaginationLinks will be returned -func (o *ClusterList) GetLinks() *PaginationLinks { - if o == nil { - return nil - } - - return o.Links +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *ClusterList) SetTotal(v int32) { + o.Total = &v +} +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ClusterList) GetLinks() PaginationLinks { + if o == nil || IsNil(o.Links) { + var ret PaginationLinks + return ret + } + return *o.Links } -// GetLinksOk returns a tuple with the Links field value +// GetLinksOk returns a tuple with the Links 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 *ClusterList) GetLinksOk() (*PaginationLinks, bool) { - if o == nil { + if o == nil || IsNil(o.Links) { return nil, false } - return o.Links, true } -// SetLinks sets field value -func (o *ClusterList) SetLinks(v PaginationLinks) { - - o.Links = &v - -} - // HasLinks returns a boolean if a field has been set. func (o *ClusterList) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !IsNil(o.Links) { return true } return false } -func (o ClusterList) MarshalJSON() ([]byte, error) { +// SetLinks gets a reference to the given PaginationLinks and assigns it to the Links field. +func (o *ClusterList) SetLinks(v PaginationLinks) { + o.Links = &v +} + +func (o ClusterList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Items != nil { + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - if o.Offset != nil { + if !IsNil(o.Offset) { toSerialize["offset"] = o.Offset } - - if o.Limit != nil { + if !IsNil(o.Limit) { toSerialize["limit"] = o.Limit } - - if o.Total != nil { + if !IsNil(o.Total) { toSerialize["total"] = o.Total } - - if o.Links != nil { + if !IsNil(o.Links) { toSerialize["_links"] = o.Links } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClusterList struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list_all_of.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list_all_of.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list_all_of.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list_all_of.go index cf901b1ea..499bd0e9d 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_list_all_of.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_list_all_of.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClusterListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterListAllOf{} + // ClusterListAllOf struct for ClusterListAllOf type ClusterListAllOf struct { // The unique ID of the resource. - Id *string `json:"id,omitempty"` - Items *[]ClusterResponse `json:"items,omitempty"` + Id *string `json:"id,omitempty"` + Items []ClusterResponse `json:"items,omitempty"` } // NewClusterListAllOf instantiates a new ClusterListAllOf object @@ -39,93 +42,79 @@ func NewClusterListAllOfWithDefaults() *ClusterListAllOf { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ClusterListAllOf) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *ClusterListAllOf) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *ClusterListAllOf) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *ClusterListAllOf) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *ClusterListAllOf) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetItems returns the Items field value -// If the value is explicit nil, the zero value for []ClusterResponse will be returned -func (o *ClusterListAllOf) GetItems() *[]ClusterResponse { - if o == nil { - return nil - } +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ClusterListAllOf) SetId(v string) { + o.Id = &v +} +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ClusterListAllOf) GetItems() []ClusterResponse { + if o == nil || IsNil(o.Items) { + var ret []ClusterResponse + return ret + } 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 *ClusterListAllOf) GetItemsOk() (*[]ClusterResponse, bool) { - if o == nil { +func (o *ClusterListAllOf) GetItemsOk() ([]ClusterResponse, bool) { + if o == nil || IsNil(o.Items) { return nil, false } - return o.Items, true } -// SetItems sets field value -func (o *ClusterListAllOf) SetItems(v []ClusterResponse) { - - o.Items = &v - -} - // HasItems returns a boolean if a field has been set. func (o *ClusterListAllOf) HasItems() bool { - if o != nil && o.Items != nil { + if o != nil && !IsNil(o.Items) { return true } return false } -func (o ClusterListAllOf) MarshalJSON() ([]byte, error) { +// SetItems gets a reference to the given []ClusterResponse and assigns it to the Items field. +func (o *ClusterListAllOf) SetItems(v []ClusterResponse) { + o.Items = v +} + +func (o ClusterListAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Items != nil { + if !IsNil(o.Items) { toSerialize["items"] = o.Items } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClusterListAllOf struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_metadata.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_metadata.go similarity index 64% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_metadata.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_metadata.go index 1631c6fb2..0b7a55ad5 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_metadata.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_metadata.go @@ -8,13 +8,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "time" ) +// checks if the ClusterMetadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterMetadata{} + // ClusterMetadata Metadata of the resource. type ClusterMetadata struct { // The ISO 8601 creation timestamp. @@ -46,317 +50,254 @@ func NewClusterMetadataWithDefaults() *ClusterMetadata { 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 *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetCreatedDate(v time.Time) { - - o.CreatedDate = &IonosTime{v} - } // HasCreatedDate returns a boolean if a field has been set. func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetCreatedDate(v time.Time) { + o.CreatedDate = &IonosTime{v} +} +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetCreatedBy(v string) { - - o.CreatedBy = &v - -} - // HasCreatedBy returns a boolean if a field has been set. func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetCreatedBy(v string) { + o.CreatedBy = &v +} +// GetCreatedByUserId returns the CreatedByUserId field value if set, zero value otherwise. +func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetCreatedByUserId(v string) { - - o.CreatedByUserId = &v - -} - // HasCreatedByUserId returns a boolean if a field has been set. func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetLastModifiedDate(v time.Time) { - - o.LastModifiedDate = &IonosTime{v} - } // HasLastModifiedDate returns a boolean if a field has been set. func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetLastModifiedDate(v time.Time) { + o.LastModifiedDate = &IonosTime{v} +} +// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise. +func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetLastModifiedBy(v string) { - - o.LastModifiedBy = &v - -} - // HasLastModifiedBy returns a boolean if a field has been set. func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v +} +// GetLastModifiedByUserId returns the LastModifiedByUserId field value if set, zero value otherwise. +func (o *ClusterMetadata) 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 *ClusterMetadata) 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 *ClusterMetadata) SetLastModifiedByUserId(v string) { - - o.LastModifiedByUserId = &v - -} - // HasLastModifiedByUserId returns a boolean if a field has been set. func (o *ClusterMetadata) HasLastModifiedByUserId() bool { - if o != nil && o.LastModifiedByUserId != nil { + if o != nil && !IsNil(o.LastModifiedByUserId) { return true } return false } -// GetState returns the State field value -// If the value is explicit nil, the zero value for State will be returned -func (o *ClusterMetadata) GetState() *State { - if o == nil { - return nil - } - - return o.State +// SetLastModifiedByUserId gets a reference to the given string and assigns it to the LastModifiedByUserId field. +func (o *ClusterMetadata) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v +} +// GetState returns the State field value if set, zero value otherwise. +func (o *ClusterMetadata) GetState() State { + if o == nil || IsNil(o.State) { + var ret State + return ret + } + return *o.State } -// GetStateOk returns a tuple with the State field value +// GetStateOk returns a tuple with the State 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 *ClusterMetadata) GetStateOk() (*State, bool) { - if o == nil { + if o == nil || IsNil(o.State) { return nil, false } - return o.State, true } -// SetState sets field value -func (o *ClusterMetadata) SetState(v State) { - - o.State = &v - -} - // HasState returns a boolean if a field has been set. func (o *ClusterMetadata) HasState() bool { - if o != nil && o.State != nil { + if o != nil && !IsNil(o.State) { return true } return false } -func (o ClusterMetadata) MarshalJSON() ([]byte, error) { +// SetState gets a reference to the given State and assigns it to the State field. +func (o *ClusterMetadata) SetState(v State) { + o.State = &v +} + +func (o ClusterMetadata) 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.State != nil { + if !IsNil(o.State) { toSerialize["state"] = o.State } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClusterMetadata struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_properties.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_properties.go similarity index 62% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_properties.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_properties.go index 4bdbbbe36..3bad18709 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_properties.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_properties.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClusterProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterProperties{} + // ClusterProperties Properties of a database cluster. type ClusterProperties struct { // The friendly name of your cluster. @@ -29,7 +32,7 @@ type ClusterProperties struct { Cores *int32 `json:"cores,omitempty"` // The amount of storage per instance in gigabytes (GB). StorageSize *int32 `json:"storageSize,omitempty"` - Connections *[]Connection `json:"connections,omitempty"` + Connections []Connection `json:"connections,omitempty"` MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` } @@ -51,387 +54,324 @@ func NewClusterPropertiesWithDefaults() *ClusterProperties { return &this } -// GetDisplayName returns the DisplayName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ClusterProperties) GetDisplayName() *string { - if o == nil { - return nil +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *ClusterProperties) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret } - - return o.DisplayName - + return *o.DisplayName } -// GetDisplayNameOk returns a tuple with the DisplayName field value +// GetDisplayNameOk returns a tuple with the DisplayName 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 *ClusterProperties) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.DisplayName) { return nil, false } - return o.DisplayName, true } -// SetDisplayName sets field value -func (o *ClusterProperties) SetDisplayName(v string) { - - o.DisplayName = &v - -} - // HasDisplayName returns a boolean if a field has been set. func (o *ClusterProperties) HasDisplayName() bool { - if o != nil && o.DisplayName != nil { + if o != nil && !IsNil(o.DisplayName) { return true } return false } -// GetMariadbVersion returns the MariadbVersion field value -// If the value is explicit nil, the zero value for MariadbVersion will be returned -func (o *ClusterProperties) GetMariadbVersion() *MariadbVersion { - if o == nil { - return nil - } - - return o.MariadbVersion +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *ClusterProperties) SetDisplayName(v string) { + o.DisplayName = &v +} +// GetMariadbVersion returns the MariadbVersion field value if set, zero value otherwise. +func (o *ClusterProperties) GetMariadbVersion() MariadbVersion { + if o == nil || IsNil(o.MariadbVersion) { + var ret MariadbVersion + return ret + } + return *o.MariadbVersion } -// GetMariadbVersionOk returns a tuple with the MariadbVersion field value +// GetMariadbVersionOk returns a tuple with the MariadbVersion 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 *ClusterProperties) GetMariadbVersionOk() (*MariadbVersion, bool) { - if o == nil { + if o == nil || IsNil(o.MariadbVersion) { return nil, false } - return o.MariadbVersion, true } -// SetMariadbVersion sets field value -func (o *ClusterProperties) SetMariadbVersion(v MariadbVersion) { - - o.MariadbVersion = &v - -} - // HasMariadbVersion returns a boolean if a field has been set. func (o *ClusterProperties) HasMariadbVersion() bool { - if o != nil && o.MariadbVersion != nil { + if o != nil && !IsNil(o.MariadbVersion) { return true } return false } -// GetDnsName returns the DnsName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ClusterProperties) GetDnsName() *string { - if o == nil { - return nil - } - - return o.DnsName +// SetMariadbVersion gets a reference to the given MariadbVersion and assigns it to the MariadbVersion field. +func (o *ClusterProperties) SetMariadbVersion(v MariadbVersion) { + o.MariadbVersion = &v +} +// GetDnsName returns the DnsName field value if set, zero value otherwise. +func (o *ClusterProperties) GetDnsName() string { + if o == nil || IsNil(o.DnsName) { + var ret string + return ret + } + return *o.DnsName } -// GetDnsNameOk returns a tuple with the DnsName field value +// GetDnsNameOk returns a tuple with the DnsName 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 *ClusterProperties) GetDnsNameOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.DnsName) { return nil, false } - return o.DnsName, true } -// SetDnsName sets field value -func (o *ClusterProperties) SetDnsName(v string) { - - o.DnsName = &v - -} - // HasDnsName returns a boolean if a field has been set. func (o *ClusterProperties) HasDnsName() bool { - if o != nil && o.DnsName != nil { + if o != nil && !IsNil(o.DnsName) { return true } return false } -// GetInstances returns the Instances field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterProperties) GetInstances() *int32 { - if o == nil { - return nil - } - - return o.Instances +// SetDnsName gets a reference to the given string and assigns it to the DnsName field. +func (o *ClusterProperties) SetDnsName(v string) { + o.DnsName = &v +} +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *ClusterProperties) GetInstances() int32 { + if o == nil || IsNil(o.Instances) { + var ret int32 + return ret + } + return *o.Instances } -// GetInstancesOk returns a tuple with the Instances field value +// GetInstancesOk returns a tuple with the Instances 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 *ClusterProperties) GetInstancesOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Instances) { return nil, false } - return o.Instances, true } -// SetInstances sets field value -func (o *ClusterProperties) SetInstances(v int32) { - - o.Instances = &v - -} - // HasInstances returns a boolean if a field has been set. func (o *ClusterProperties) HasInstances() bool { - if o != nil && o.Instances != nil { + if o != nil && !IsNil(o.Instances) { return true } return false } -// GetRam returns the Ram field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterProperties) GetRam() *int32 { - if o == nil { - return nil - } - - return o.Ram +// SetInstances gets a reference to the given int32 and assigns it to the Instances field. +func (o *ClusterProperties) SetInstances(v int32) { + o.Instances = &v +} +// GetRam returns the Ram field value if set, zero value otherwise. +func (o *ClusterProperties) GetRam() int32 { + if o == nil || IsNil(o.Ram) { + var ret int32 + return ret + } + return *o.Ram } -// GetRamOk returns a tuple with the Ram field value +// GetRamOk returns a tuple with the Ram 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 *ClusterProperties) GetRamOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Ram) { return nil, false } - return o.Ram, true } -// SetRam sets field value -func (o *ClusterProperties) SetRam(v int32) { - - o.Ram = &v - -} - // HasRam returns a boolean if a field has been set. func (o *ClusterProperties) HasRam() bool { - if o != nil && o.Ram != nil { + if o != nil && !IsNil(o.Ram) { return true } return false } -// GetCores returns the Cores field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterProperties) GetCores() *int32 { - if o == nil { - return nil - } - - return o.Cores +// SetRam gets a reference to the given int32 and assigns it to the Ram field. +func (o *ClusterProperties) SetRam(v int32) { + o.Ram = &v +} +// GetCores returns the Cores field value if set, zero value otherwise. +func (o *ClusterProperties) GetCores() int32 { + if o == nil || IsNil(o.Cores) { + var ret int32 + return ret + } + return *o.Cores } -// GetCoresOk returns a tuple with the Cores field value +// GetCoresOk returns a tuple with the Cores 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 *ClusterProperties) GetCoresOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Cores) { return nil, false } - return o.Cores, true } -// SetCores sets field value -func (o *ClusterProperties) SetCores(v int32) { - - o.Cores = &v - -} - // HasCores returns a boolean if a field has been set. func (o *ClusterProperties) HasCores() bool { - if o != nil && o.Cores != nil { + if o != nil && !IsNil(o.Cores) { return true } return false } -// GetStorageSize returns the StorageSize field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClusterProperties) GetStorageSize() *int32 { - if o == nil { - return nil - } - - return o.StorageSize +// SetCores gets a reference to the given int32 and assigns it to the Cores field. +func (o *ClusterProperties) SetCores(v int32) { + o.Cores = &v +} +// GetStorageSize returns the StorageSize field value if set, zero value otherwise. +func (o *ClusterProperties) GetStorageSize() int32 { + if o == nil || IsNil(o.StorageSize) { + var ret int32 + return ret + } + return *o.StorageSize } -// GetStorageSizeOk returns a tuple with the StorageSize field value +// GetStorageSizeOk returns a tuple with the StorageSize 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 *ClusterProperties) GetStorageSizeOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.StorageSize) { return nil, false } - return o.StorageSize, true } -// SetStorageSize sets field value -func (o *ClusterProperties) SetStorageSize(v int32) { - - o.StorageSize = &v - -} - // HasStorageSize returns a boolean if a field has been set. func (o *ClusterProperties) HasStorageSize() bool { - if o != nil && o.StorageSize != nil { + if o != nil && !IsNil(o.StorageSize) { return true } return false } -// GetConnections returns the Connections field value -// If the value is explicit nil, the zero value for []Connection will be returned -func (o *ClusterProperties) GetConnections() *[]Connection { - if o == nil { - return nil - } +// SetStorageSize gets a reference to the given int32 and assigns it to the StorageSize field. +func (o *ClusterProperties) SetStorageSize(v int32) { + o.StorageSize = &v +} +// GetConnections returns the Connections field value if set, zero value otherwise. +func (o *ClusterProperties) GetConnections() []Connection { + if o == nil || IsNil(o.Connections) { + var ret []Connection + return ret + } return o.Connections - } -// GetConnectionsOk returns a tuple with the Connections field value +// GetConnectionsOk returns a tuple with the Connections 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 *ClusterProperties) GetConnectionsOk() (*[]Connection, bool) { - if o == nil { +func (o *ClusterProperties) GetConnectionsOk() ([]Connection, bool) { + if o == nil || IsNil(o.Connections) { return nil, false } - return o.Connections, true } -// SetConnections sets field value -func (o *ClusterProperties) SetConnections(v []Connection) { - - o.Connections = &v - -} - // HasConnections returns a boolean if a field has been set. func (o *ClusterProperties) HasConnections() bool { - if o != nil && o.Connections != nil { + if o != nil && !IsNil(o.Connections) { return true } return false } -// GetMaintenanceWindow returns the MaintenanceWindow field value -// If the value is explicit nil, the zero value for MaintenanceWindow will be returned -func (o *ClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { - if o == nil { - return nil - } - - return o.MaintenanceWindow +// SetConnections gets a reference to the given []Connection and assigns it to the Connections field. +func (o *ClusterProperties) SetConnections(v []Connection) { + o.Connections = v +} +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *ClusterProperties) GetMaintenanceWindow() MaintenanceWindow { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret MaintenanceWindow + return ret + } + return *o.MaintenanceWindow } -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *ClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { - if o == nil { + if o == nil || IsNil(o.MaintenanceWindow) { return nil, false } - return o.MaintenanceWindow, true } -// SetMaintenanceWindow sets field value -func (o *ClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { - - o.MaintenanceWindow = &v - -} - // HasMaintenanceWindow returns a boolean if a field has been set. func (o *ClusterProperties) HasMaintenanceWindow() bool { - if o != nil && o.MaintenanceWindow != nil { + if o != nil && !IsNil(o.MaintenanceWindow) { return true } return false } -func (o ClusterProperties) MarshalJSON() ([]byte, error) { +// SetMaintenanceWindow gets a reference to the given MaintenanceWindow and assigns it to the MaintenanceWindow field. +func (o *ClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + o.MaintenanceWindow = &v +} + +func (o ClusterProperties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DisplayName != nil { + if !IsNil(o.DisplayName) { toSerialize["displayName"] = o.DisplayName } - - if o.MariadbVersion != nil { + if !IsNil(o.MariadbVersion) { toSerialize["mariadbVersion"] = o.MariadbVersion } - - if o.DnsName != nil { + if !IsNil(o.DnsName) { toSerialize["dnsName"] = o.DnsName } - - if o.Instances != nil { + if !IsNil(o.Instances) { toSerialize["instances"] = o.Instances } - - if o.Ram != nil { + if !IsNil(o.Ram) { toSerialize["ram"] = o.Ram } - - if o.Cores != nil { + if !IsNil(o.Cores) { toSerialize["cores"] = o.Cores } - - if o.StorageSize != nil { + if !IsNil(o.StorageSize) { toSerialize["storageSize"] = o.StorageSize } - - if o.Connections != nil { + if !IsNil(o.Connections) { toSerialize["connections"] = o.Connections } - - if o.MaintenanceWindow != nil { + if !IsNil(o.MaintenanceWindow) { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClusterProperties struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_response.go similarity index 69% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_response.go index 5dce94b0b..2fe37a34c 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_cluster_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_cluster_response.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClusterResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterResponse{} + // ClusterResponse A database cluster. type ClusterResponse struct { // The unique ID of the resource. @@ -40,135 +43,114 @@ func NewClusterResponseWithDefaults() *ClusterResponse { return &this } -// GetId returns the Id field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ClusterResponse) GetId() *string { - if o == nil { - return nil +// GetId returns the Id field value if set, zero value otherwise. +func (o *ClusterResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret } - - return o.Id - + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id 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 *ClusterResponse) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Id, true } -// SetId sets field value -func (o *ClusterResponse) SetId(v string) { - - o.Id = &v - -} - // HasId returns a boolean if a field has been set. func (o *ClusterResponse) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !IsNil(o.Id) { return true } return false } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for ClusterMetadata will be returned -func (o *ClusterResponse) GetMetadata() *ClusterMetadata { - if o == nil { - return nil - } - - return o.Metadata +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ClusterResponse) SetId(v string) { + o.Id = &v +} +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ClusterResponse) GetMetadata() ClusterMetadata { + if o == nil || IsNil(o.Metadata) { + var ret ClusterMetadata + 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 *ClusterResponse) GetMetadataOk() (*ClusterMetadata, bool) { - if o == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *ClusterResponse) SetMetadata(v ClusterMetadata) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *ClusterResponse) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } -// GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for ClusterProperties will be returned -func (o *ClusterResponse) GetProperties() *ClusterProperties { - if o == nil { - return nil - } - - return o.Properties +// SetMetadata gets a reference to the given ClusterMetadata and assigns it to the Metadata field. +func (o *ClusterResponse) SetMetadata(v ClusterMetadata) { + o.Metadata = &v +} +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *ClusterResponse) GetProperties() ClusterProperties { + if o == nil || IsNil(o.Properties) { + var ret ClusterProperties + return ret + } + return *o.Properties } -// GetPropertiesOk returns a tuple with the Properties field value +// GetPropertiesOk returns a tuple with the Properties 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 *ClusterResponse) GetPropertiesOk() (*ClusterProperties, bool) { - if o == nil { + if o == nil || IsNil(o.Properties) { return nil, false } - return o.Properties, true } -// SetProperties sets field value -func (o *ClusterResponse) SetProperties(v ClusterProperties) { - - o.Properties = &v - -} - // HasProperties returns a boolean if a field has been set. func (o *ClusterResponse) HasProperties() bool { - if o != nil && o.Properties != nil { + if o != nil && !IsNil(o.Properties) { return true } return false } -func (o ClusterResponse) MarshalJSON() ([]byte, error) { +// SetProperties gets a reference to the given ClusterProperties and assigns it to the Properties field. +func (o *ClusterResponse) SetProperties(v ClusterProperties) { + o.Properties = &v +} + +func (o ClusterResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !IsNil(o.Id) { toSerialize["id"] = o.Id } - - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { + if !IsNil(o.Properties) { toSerialize["properties"] = o.Properties } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClusterResponse struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_400_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_400_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_400_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_400_response.go index 6bfbbb8bd..a5655a0a4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_400_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_400_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet400Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet400Response{} + // ClustersGet400Response struct for ClustersGet400Response type ClustersGet400Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet400Response instantiates a new ClustersGet400Response object @@ -28,8 +31,8 @@ type ClustersGet400Response struct { func NewClustersGet400Response(httpStatus int32, messages []ErrorMessage) *ClustersGet400Response { this := ClustersGet400Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet400ResponseWithDefaults() *ClustersGet400Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet400Response) GetHttpStatus() *int32 { +func (o *ClustersGet400Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet400Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet400Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet400Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet400Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet400Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet400Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet400Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet400Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet400Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet400Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet400Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet400Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_401_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_401_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_401_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_401_response.go index 46e059b90..7fe15edd4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_401_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_401_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet401Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet401Response{} + // ClustersGet401Response struct for ClustersGet401Response type ClustersGet401Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet401Response instantiates a new ClustersGet401Response object @@ -28,8 +31,8 @@ type ClustersGet401Response struct { func NewClustersGet401Response(httpStatus int32, messages []ErrorMessage) *ClustersGet401Response { this := ClustersGet401Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet401ResponseWithDefaults() *ClustersGet401Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet401Response) GetHttpStatus() *int32 { +func (o *ClustersGet401Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet401Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet401Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet401Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet401Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet401Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet401Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet401Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet401Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet401Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet401Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet401Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet401Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_403_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_403_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_403_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_403_response.go index 67944c0ec..f65e15a5e 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_403_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_403_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet403Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet403Response{} + // ClustersGet403Response struct for ClustersGet403Response type ClustersGet403Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet403Response instantiates a new ClustersGet403Response object @@ -28,8 +31,8 @@ type ClustersGet403Response struct { func NewClustersGet403Response(httpStatus int32, messages []ErrorMessage) *ClustersGet403Response { this := ClustersGet403Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet403ResponseWithDefaults() *ClustersGet403Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet403Response) GetHttpStatus() *int32 { +func (o *ClustersGet403Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet403Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet403Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet403Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet403Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet403Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet403Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet403Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet403Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet403Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet403Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet403Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet403Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_404_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_404_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_404_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_404_response.go index f5e24fca3..96b2e0ada 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_404_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_404_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet404Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet404Response{} + // ClustersGet404Response struct for ClustersGet404Response type ClustersGet404Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet404Response instantiates a new ClustersGet404Response object @@ -28,8 +31,8 @@ type ClustersGet404Response struct { func NewClustersGet404Response(httpStatus int32, messages []ErrorMessage) *ClustersGet404Response { this := ClustersGet404Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet404ResponseWithDefaults() *ClustersGet404Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet404Response) GetHttpStatus() *int32 { +func (o *ClustersGet404Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet404Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet404Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet404Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet404Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet404Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet404Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet404Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet404Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet404Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet404Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet404Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet404Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_405_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_405_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_405_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_405_response.go index c40d59e96..961becc0d 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_405_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_405_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet405Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet405Response{} + // ClustersGet405Response struct for ClustersGet405Response type ClustersGet405Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet405Response instantiates a new ClustersGet405Response object @@ -28,8 +31,8 @@ type ClustersGet405Response struct { func NewClustersGet405Response(httpStatus int32, messages []ErrorMessage) *ClustersGet405Response { this := ClustersGet405Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet405ResponseWithDefaults() *ClustersGet405Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet405Response) GetHttpStatus() *int32 { +func (o *ClustersGet405Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet405Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet405Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet405Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet405Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet405Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet405Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet405Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet405Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet405Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet405Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet405Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet405Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_415_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_415_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_415_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_415_response.go index 72ce39abc..c68e14895 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_415_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_415_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet415Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet415Response{} + // ClustersGet415Response struct for ClustersGet415Response type ClustersGet415Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet415Response instantiates a new ClustersGet415Response object @@ -28,8 +31,8 @@ type ClustersGet415Response struct { func NewClustersGet415Response(httpStatus int32, messages []ErrorMessage) *ClustersGet415Response { this := ClustersGet415Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet415ResponseWithDefaults() *ClustersGet415Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet415Response) GetHttpStatus() *int32 { +func (o *ClustersGet415Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet415Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet415Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet415Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet415Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet415Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet415Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet415Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet415Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet415Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet415Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet415Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet415Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_422_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_422_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_422_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_422_response.go index 8951ae978..0ce17281d 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_422_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_422_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet422Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet422Response{} + // ClustersGet422Response struct for ClustersGet422Response type ClustersGet422Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet422Response instantiates a new ClustersGet422Response object @@ -28,8 +31,8 @@ type ClustersGet422Response struct { func NewClustersGet422Response(httpStatus int32, messages []ErrorMessage) *ClustersGet422Response { this := ClustersGet422Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet422ResponseWithDefaults() *ClustersGet422Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet422Response) GetHttpStatus() *int32 { +func (o *ClustersGet422Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet422Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet422Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet422Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet422Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet422Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet422Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet422Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet422Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet422Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet422Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet422Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet422Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_429_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_429_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_429_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_429_response.go index b85498cc6..c594db1d8 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_429_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_429_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet429Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet429Response{} + // ClustersGet429Response struct for ClustersGet429Response type ClustersGet429Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet429Response instantiates a new ClustersGet429Response object @@ -28,8 +31,8 @@ type ClustersGet429Response struct { func NewClustersGet429Response(httpStatus int32, messages []ErrorMessage) *ClustersGet429Response { this := ClustersGet429Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet429ResponseWithDefaults() *ClustersGet429Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet429Response) GetHttpStatus() *int32 { +func (o *ClustersGet429Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet429Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet429Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet429Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet429Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet429Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet429Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet429Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet429Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet429Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet429Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet429Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet429Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_500_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_500_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_500_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_500_response.go index a68d7d144..b32324eb0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_500_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_500_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet500Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet500Response{} + // ClustersGet500Response struct for ClustersGet500Response type ClustersGet500Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet500Response instantiates a new ClustersGet500Response object @@ -28,8 +31,8 @@ type ClustersGet500Response struct { func NewClustersGet500Response(httpStatus int32, messages []ErrorMessage) *ClustersGet500Response { this := ClustersGet500Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet500ResponseWithDefaults() *ClustersGet500Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet500Response) GetHttpStatus() *int32 { +func (o *ClustersGet500Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet500Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet500Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet500Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet500Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet500Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet500Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet500Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet500Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet500Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet500Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet500Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet500Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_503_response.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_503_response.go similarity index 70% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_503_response.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_503_response.go index 7d9b2837c..962e42ce0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_clusters_get_503_response.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_clusters_get_503_response.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ClustersGet503Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersGet503Response{} + // ClustersGet503Response struct for ClustersGet503Response type ClustersGet503Response struct { // The HTTP status code of the operation. - HttpStatus *int32 `json:"httpStatus"` - Messages *[]ErrorMessage `json:"messages"` + HttpStatus int32 `json:"httpStatus"` + Messages []ErrorMessage `json:"messages"` } // NewClustersGet503Response instantiates a new ClustersGet503Response object @@ -28,8 +31,8 @@ type ClustersGet503Response struct { func NewClustersGet503Response(httpStatus int32, messages []ErrorMessage) *ClustersGet503Response { this := ClustersGet503Response{} - this.HttpStatus = &httpStatus - this.Messages = &messages + this.HttpStatus = httpStatus + this.Messages = messages return &this } @@ -43,92 +46,58 @@ func NewClustersGet503ResponseWithDefaults() *ClustersGet503Response { } // GetHttpStatus returns the HttpStatus field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *ClustersGet503Response) GetHttpStatus() *int32 { +func (o *ClustersGet503Response) GetHttpStatus() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.HttpStatus - } // GetHttpStatusOk returns a tuple with the HttpStatus 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 *ClustersGet503Response) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } - - return o.HttpStatus, true + return &o.HttpStatus, true } // SetHttpStatus sets field value func (o *ClustersGet503Response) SetHttpStatus(v int32) { - - o.HttpStatus = &v - -} - -// HasHttpStatus returns a boolean if a field has been set. -func (o *ClustersGet503Response) HasHttpStatus() bool { - if o != nil && o.HttpStatus != nil { - return true - } - - return false + o.HttpStatus = v } // GetMessages returns the Messages field value -// If the value is explicit nil, the zero value for []ErrorMessage will be returned -func (o *ClustersGet503Response) GetMessages() *[]ErrorMessage { +func (o *ClustersGet503Response) GetMessages() []ErrorMessage { if o == nil { - return nil + var ret []ErrorMessage + return ret } return o.Messages - } // GetMessagesOk returns a tuple with the Messages 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 *ClustersGet503Response) GetMessagesOk() (*[]ErrorMessage, bool) { +func (o *ClustersGet503Response) GetMessagesOk() ([]ErrorMessage, bool) { if o == nil { return nil, false } - return o.Messages, true } // SetMessages sets field value func (o *ClustersGet503Response) SetMessages(v []ErrorMessage) { - - o.Messages = &v - -} - -// HasMessages returns a boolean if a field has been set. -func (o *ClustersGet503Response) HasMessages() bool { - if o != nil && o.Messages != nil { - return true - } - - return false + o.Messages = v } -func (o ClustersGet503Response) MarshalJSON() ([]byte, error) { +func (o ClustersGet503Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.HttpStatus != nil { - toSerialize["httpStatus"] = o.HttpStatus - } - - if o.Messages != nil { - toSerialize["messages"] = o.Messages - } - - return json.Marshal(toSerialize) + toSerialize["httpStatus"] = o.HttpStatus + toSerialize["messages"] = o.Messages + return toSerialize, nil } type NullableClustersGet503Response struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_connection.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_connection.go similarity index 67% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_connection.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_connection.go index 1fc900e85..536fd6079 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_connection.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_connection.go @@ -8,20 +8,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb 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 cluster. type Connection struct { // The datacenter to connect your cluster to. - DatacenterId *string `json:"datacenterId"` + DatacenterId string `json:"datacenterId"` // The numeric LAN ID to connect your cluster to. - LanId *string `json:"lanId"` + LanId string `json:"lanId"` // The IP and subnet for your cluster. Note the following unavailable IP ranges: 10.233.64.0/18 10.233.0.0/18 10.233.114.0/24 - 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-dbaas-mariadb/model_create_cluster_properties.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_properties.go similarity index 56% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_properties.go index 64f4c72c4..69e5ec35f 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_properties.go @@ -8,29 +8,32 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the CreateClusterProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateClusterProperties{} + // CreateClusterProperties Properties with all data needed to create a new MariaDB cluster. type CreateClusterProperties struct { - MariadbVersion *MariadbVersion `json:"mariadbVersion"` + MariadbVersion MariadbVersion `json:"mariadbVersion"` // The total number of instances in the cluster (one primary and n-1 secondary). - Instances *int32 `json:"instances"` + Instances int32 `json:"instances"` // The number of CPU cores per instance. - Cores *int32 `json:"cores"` + Cores int32 `json:"cores"` // The amount of memory per instance in gigabytes (GB). - Ram *int32 `json:"ram"` + Ram int32 `json:"ram"` // The amount of storage per instance in gigabytes (GB). - StorageSize *int32 `json:"storageSize"` + StorageSize int32 `json:"storageSize"` // The network connection for your cluster. Only one connection is allowed. - Connections *[]Connection `json:"connections"` + Connections []Connection `json:"connections"` // The friendly name of your cluster. - DisplayName *string `json:"displayName"` + DisplayName string `json:"displayName"` MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` - Credentials *DBUser `json:"credentials"` + Credentials DBUser `json:"credentials"` FromBackup *RestoreRequest `json:"fromBackup,omitempty"` } @@ -41,14 +44,14 @@ type CreateClusterProperties struct { func NewCreateClusterProperties(mariadbVersion MariadbVersion, instances int32, cores int32, ram int32, storageSize int32, connections []Connection, displayName string, credentials DBUser) *CreateClusterProperties { this := CreateClusterProperties{} - this.MariadbVersion = &mariadbVersion - this.Instances = &instances - this.Cores = &cores - this.Ram = &ram - this.StorageSize = &storageSize - this.Connections = &connections - this.DisplayName = &displayName - this.Credentials = &credentials + this.MariadbVersion = mariadbVersion + this.Instances = instances + this.Cores = cores + this.Ram = ram + this.StorageSize = storageSize + this.Connections = connections + this.DisplayName = displayName + this.Credentials = credentials return &this } @@ -62,428 +65,278 @@ func NewCreateClusterPropertiesWithDefaults() *CreateClusterProperties { } // GetMariadbVersion returns the MariadbVersion field value -// If the value is explicit nil, the zero value for MariadbVersion will be returned -func (o *CreateClusterProperties) GetMariadbVersion() *MariadbVersion { +func (o *CreateClusterProperties) GetMariadbVersion() MariadbVersion { if o == nil { - return nil + var ret MariadbVersion + return ret } return o.MariadbVersion - } // GetMariadbVersionOk returns a tuple with the MariadbVersion 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 *CreateClusterProperties) GetMariadbVersionOk() (*MariadbVersion, bool) { if o == nil { return nil, false } - - return o.MariadbVersion, true + return &o.MariadbVersion, true } // SetMariadbVersion sets field value func (o *CreateClusterProperties) SetMariadbVersion(v MariadbVersion) { - - o.MariadbVersion = &v - -} - -// HasMariadbVersion returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasMariadbVersion() bool { - if o != nil && o.MariadbVersion != nil { - return true - } - - return false + o.MariadbVersion = v } // GetInstances returns the Instances field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CreateClusterProperties) GetInstances() *int32 { +func (o *CreateClusterProperties) GetInstances() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Instances - } // GetInstancesOk returns a tuple with the Instances field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateClusterProperties) GetInstancesOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Instances, true + return &o.Instances, true } // SetInstances sets field value func (o *CreateClusterProperties) SetInstances(v int32) { - - o.Instances = &v - -} - -// HasInstances returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasInstances() bool { - if o != nil && o.Instances != nil { - return true - } - - return false + o.Instances = v } // GetCores returns the Cores field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CreateClusterProperties) GetCores() *int32 { +func (o *CreateClusterProperties) GetCores() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Cores - } // GetCoresOk returns a tuple with the Cores 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 *CreateClusterProperties) GetCoresOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Cores, true + return &o.Cores, true } // SetCores sets field value func (o *CreateClusterProperties) SetCores(v int32) { - - o.Cores = &v - -} - -// HasCores returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasCores() bool { - if o != nil && o.Cores != nil { - return true - } - - return false + o.Cores = v } // GetRam returns the Ram field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CreateClusterProperties) GetRam() *int32 { +func (o *CreateClusterProperties) GetRam() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.Ram - } // GetRamOk returns a tuple with the Ram field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateClusterProperties) GetRamOk() (*int32, bool) { if o == nil { return nil, false } - - return o.Ram, true + return &o.Ram, true } // SetRam sets field value func (o *CreateClusterProperties) SetRam(v int32) { - - o.Ram = &v - -} - -// HasRam returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasRam() bool { - if o != nil && o.Ram != nil { - return true - } - - return false + o.Ram = v } // GetStorageSize returns the StorageSize field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *CreateClusterProperties) GetStorageSize() *int32 { +func (o *CreateClusterProperties) GetStorageSize() int32 { if o == nil { - return nil + var ret int32 + return ret } return o.StorageSize - } // GetStorageSizeOk returns a tuple with the StorageSize 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 *CreateClusterProperties) GetStorageSizeOk() (*int32, bool) { if o == nil { return nil, false } - - return o.StorageSize, true + return &o.StorageSize, true } // SetStorageSize sets field value func (o *CreateClusterProperties) SetStorageSize(v int32) { - - o.StorageSize = &v - -} - -// HasStorageSize returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasStorageSize() bool { - if o != nil && o.StorageSize != nil { - return true - } - - return false + o.StorageSize = v } // GetConnections returns the Connections field value -// If the value is explicit nil, the zero value for []Connection will be returned -func (o *CreateClusterProperties) GetConnections() *[]Connection { +func (o *CreateClusterProperties) GetConnections() []Connection { if o == nil { - return nil + var ret []Connection + return ret } return o.Connections - } // GetConnectionsOk returns a tuple with the Connections 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 *CreateClusterProperties) GetConnectionsOk() (*[]Connection, bool) { +func (o *CreateClusterProperties) GetConnectionsOk() ([]Connection, bool) { if o == nil { return nil, false } - return o.Connections, true } // SetConnections sets field value func (o *CreateClusterProperties) SetConnections(v []Connection) { - - o.Connections = &v - -} - -// HasConnections returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasConnections() bool { - if o != nil && o.Connections != nil { - return true - } - - return false + o.Connections = v } // GetDisplayName returns the DisplayName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *CreateClusterProperties) GetDisplayName() *string { +func (o *CreateClusterProperties) GetDisplayName() string { if o == nil { - return nil + var ret string + return ret } return o.DisplayName - } // GetDisplayNameOk returns a tuple with the DisplayName field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateClusterProperties) GetDisplayNameOk() (*string, bool) { if o == nil { return nil, false } - - return o.DisplayName, true + return &o.DisplayName, true } // SetDisplayName sets field value func (o *CreateClusterProperties) SetDisplayName(v string) { - - o.DisplayName = &v - + o.DisplayName = v } -// HasDisplayName returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasDisplayName() bool { - if o != nil && o.DisplayName != nil { - return true - } - - return false -} - -// GetMaintenanceWindow returns the MaintenanceWindow field value -// If the value is explicit nil, the zero value for MaintenanceWindow will be returned -func (o *CreateClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { - if o == nil { - return nil +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *CreateClusterProperties) GetMaintenanceWindow() MaintenanceWindow { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret MaintenanceWindow + return ret } - - return o.MaintenanceWindow - + return *o.MaintenanceWindow } -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *CreateClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { - if o == nil { + if o == nil || IsNil(o.MaintenanceWindow) { return nil, false } - return o.MaintenanceWindow, true } -// SetMaintenanceWindow sets field value -func (o *CreateClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { - - o.MaintenanceWindow = &v - -} - // HasMaintenanceWindow returns a boolean if a field has been set. func (o *CreateClusterProperties) HasMaintenanceWindow() bool { - if o != nil && o.MaintenanceWindow != nil { + if o != nil && !IsNil(o.MaintenanceWindow) { return true } return false } +// SetMaintenanceWindow gets a reference to the given MaintenanceWindow and assigns it to the MaintenanceWindow field. +func (o *CreateClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + o.MaintenanceWindow = &v +} + // GetCredentials returns the Credentials field value -// If the value is explicit nil, the zero value for DBUser will be returned -func (o *CreateClusterProperties) GetCredentials() *DBUser { +func (o *CreateClusterProperties) GetCredentials() DBUser { if o == nil { - return nil + var ret DBUser + return ret } return o.Credentials - } // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateClusterProperties) GetCredentialsOk() (*DBUser, bool) { if o == nil { return nil, false } - - return o.Credentials, true + return &o.Credentials, true } // SetCredentials sets field value func (o *CreateClusterProperties) SetCredentials(v DBUser) { - - o.Credentials = &v - -} - -// HasCredentials returns a boolean if a field has been set. -func (o *CreateClusterProperties) HasCredentials() bool { - if o != nil && o.Credentials != nil { - return true - } - - return false + o.Credentials = v } -// GetFromBackup returns the FromBackup field value -// If the value is explicit nil, the zero value for RestoreRequest will be returned -func (o *CreateClusterProperties) GetFromBackup() *RestoreRequest { - if o == nil { - return nil +// GetFromBackup returns the FromBackup field value if set, zero value otherwise. +func (o *CreateClusterProperties) GetFromBackup() RestoreRequest { + if o == nil || IsNil(o.FromBackup) { + var ret RestoreRequest + return ret } - - return o.FromBackup - + return *o.FromBackup } -// GetFromBackupOk returns a tuple with the FromBackup field value +// GetFromBackupOk returns a tuple with the FromBackup 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 *CreateClusterProperties) GetFromBackupOk() (*RestoreRequest, bool) { - if o == nil { + if o == nil || IsNil(o.FromBackup) { return nil, false } - return o.FromBackup, true } -// SetFromBackup sets field value -func (o *CreateClusterProperties) SetFromBackup(v RestoreRequest) { - - o.FromBackup = &v - -} - // HasFromBackup returns a boolean if a field has been set. func (o *CreateClusterProperties) HasFromBackup() bool { - if o != nil && o.FromBackup != nil { + if o != nil && !IsNil(o.FromBackup) { return true } return false } -func (o CreateClusterProperties) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MariadbVersion != nil { - toSerialize["mariadbVersion"] = o.MariadbVersion - } - - if o.Instances != nil { - toSerialize["instances"] = o.Instances - } - - if o.Cores != nil { - toSerialize["cores"] = o.Cores - } - - if o.Ram != nil { - toSerialize["ram"] = o.Ram - } - - if o.StorageSize != nil { - toSerialize["storageSize"] = o.StorageSize - } - - if o.Connections != nil { - toSerialize["connections"] = o.Connections - } - - if o.DisplayName != nil { - toSerialize["displayName"] = o.DisplayName - } +// SetFromBackup gets a reference to the given RestoreRequest and assigns it to the FromBackup field. +func (o *CreateClusterProperties) SetFromBackup(v RestoreRequest) { + o.FromBackup = &v +} - if o.MaintenanceWindow != nil { +func (o CreateClusterProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["mariadbVersion"] = o.MariadbVersion + toSerialize["instances"] = o.Instances + toSerialize["cores"] = o.Cores + toSerialize["ram"] = o.Ram + toSerialize["storageSize"] = o.StorageSize + toSerialize["connections"] = o.Connections + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.MaintenanceWindow) { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - - if o.Credentials != nil { - toSerialize["credentials"] = o.Credentials - } - - if o.FromBackup != nil { + toSerialize["credentials"] = o.Credentials + if !IsNil(o.FromBackup) { toSerialize["fromBackup"] = o.FromBackup } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCreateClusterProperties struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_request.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_request.go similarity index 80% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_request.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_request.go index 710a88443..8f9cbf5f2 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_request.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_create_cluster_request.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the CreateClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateClusterRequest{} + // CreateClusterRequest Request payload with all data needed to create a new MariaDB cluster. type CreateClusterRequest struct { Properties *CreateClusterProperties `json:"properties,omitempty"` @@ -37,51 +40,44 @@ func NewCreateClusterRequestWithDefaults() *CreateClusterRequest { return &this } -// GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for CreateClusterProperties will be returned -func (o *CreateClusterRequest) GetProperties() *CreateClusterProperties { - if o == nil { - return nil +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *CreateClusterRequest) GetProperties() CreateClusterProperties { + if o == nil || IsNil(o.Properties) { + var ret CreateClusterProperties + return ret } - - return o.Properties - + return *o.Properties } -// GetPropertiesOk returns a tuple with the Properties field value +// GetPropertiesOk returns a tuple with the Properties 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 *CreateClusterRequest) GetPropertiesOk() (*CreateClusterProperties, bool) { - if o == nil { + if o == nil || IsNil(o.Properties) { return nil, false } - return o.Properties, true } -// SetProperties sets field value -func (o *CreateClusterRequest) SetProperties(v CreateClusterProperties) { - - o.Properties = &v - -} - // HasProperties returns a boolean if a field has been set. func (o *CreateClusterRequest) HasProperties() bool { - if o != nil && o.Properties != nil { + if o != nil && !IsNil(o.Properties) { return true } return false } -func (o CreateClusterRequest) MarshalJSON() ([]byte, error) { +// SetProperties gets a reference to the given CreateClusterProperties and assigns it to the Properties field. +func (o *CreateClusterRequest) SetProperties(v CreateClusterProperties) { + o.Properties = &v +} + +func (o CreateClusterRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Properties != nil { + if !IsNil(o.Properties) { toSerialize["properties"] = o.Properties } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCreateClusterRequest struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_day_of_the_week.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_day_of_the_week.go similarity index 99% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_day_of_the_week.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_day_of_the_week.go index 801b90dbc..e01f7e614 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_day_of_the_week.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/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 mariadb import ( "encoding/json" + "fmt" ) diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_db_user.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_db_user.go similarity index 72% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_db_user.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_db_user.go index bc7a19b15..8e336d8f3 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_db_user.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_db_user.go @@ -8,18 +8,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the DBUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DBUser{} + // DBUser Credentials for the database user to be created. type DBUser struct { // The username for the initial MariaDB user. Some system usernames are restricted (e.g. \"mariadb\", \"admin\", \"standby\"). The username should be compliant with the following rules: - Must not exceed 16 characters - Must start with a letter - Must contain only letters, numbers, or underscores - Username *string `json:"username"` + Username string `json:"username"` // The password for a MariaDB user. - Password *string `json:"password"` + Password string `json:"password"` } // NewDBUser instantiates a new DBUser object @@ -29,8 +32,8 @@ type DBUser struct { func NewDBUser(username string, password string) *DBUser { this := DBUser{} - this.Username = &username - this.Password = &password + this.Username = username + this.Password = password return &this } @@ -44,92 +47,58 @@ func NewDBUserWithDefaults() *DBUser { } // GetUsername returns the Username field value -// If the value is explicit nil, the zero value for string will be returned -func (o *DBUser) GetUsername() *string { +func (o *DBUser) GetUsername() string { if o == nil { - return nil + var ret string + return ret } return o.Username - } // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DBUser) GetUsernameOk() (*string, bool) { if o == nil { return nil, false } - - return o.Username, true + return &o.Username, true } // SetUsername sets field value func (o *DBUser) SetUsername(v string) { - - o.Username = &v - -} - -// HasUsername returns a boolean if a field has been set. -func (o *DBUser) HasUsername() bool { - if o != nil && o.Username != nil { - return true - } - - return false + o.Username = v } // GetPassword returns the Password field value -// If the value is explicit nil, the zero value for string will be returned -func (o *DBUser) GetPassword() *string { +func (o *DBUser) GetPassword() string { if o == nil { - return nil + var ret string + return ret } return o.Password - } // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DBUser) GetPasswordOk() (*string, bool) { if o == nil { return nil, false } - - return o.Password, true + return &o.Password, true } // SetPassword sets field value func (o *DBUser) SetPassword(v string) { - - o.Password = &v - -} - -// HasPassword returns a boolean if a field has been set. -func (o *DBUser) HasPassword() bool { - if o != nil && o.Password != nil { - return true - } - - return false + o.Password = v } -func (o DBUser) MarshalJSON() ([]byte, error) { +func (o DBUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Username != nil { - toSerialize["username"] = o.Username - } - - if o.Password != nil { - toSerialize["password"] = o.Password - } - - return json.Marshal(toSerialize) + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + return toSerialize, nil } type NullableDBUser struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_error_message.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_error_message.go similarity index 74% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_error_message.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_error_message.go index 34569afca..6183635a8 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_error_message.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_error_message.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the ErrorMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorMessage{} + // ErrorMessage struct for ErrorMessage type ErrorMessage struct { // Application internal error code @@ -40,93 +43,79 @@ func NewErrorMessageWithDefaults() *ErrorMessage { return &this } -// GetErrorCode returns the ErrorCode field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ErrorMessage) GetErrorCode() *string { - if o == nil { - return nil +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *ErrorMessage) 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 *ErrorMessage) 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 *ErrorMessage) SetErrorCode(v string) { - - o.ErrorCode = &v - -} - // HasErrorCode returns a boolean if a field has been set. func (o *ErrorMessage) 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 *ErrorMessage) 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 *ErrorMessage) SetErrorCode(v string) { + o.ErrorCode = &v +} +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ErrorMessage) 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 *ErrorMessage) 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 *ErrorMessage) SetMessage(v string) { - - o.Message = &v - -} - // HasMessage returns a boolean if a field has been set. func (o *ErrorMessage) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !IsNil(o.Message) { return true } return false } -func (o ErrorMessage) MarshalJSON() ([]byte, error) { +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ErrorMessage) SetMessage(v string) { + o.Message = &v +} + +func (o ErrorMessage) 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 NullableErrorMessage struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_maintenance_window.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_maintenance_window.go similarity index 71% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_maintenance_window.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_maintenance_window.go index 12efe6e79..1c6ce3000 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_maintenance_window.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_maintenance_window.go @@ -8,17 +8,20 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb 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-dbaas-mariadb/model_mariadb_version.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_mariadb_version.go similarity index 99% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_mariadb_version.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_mariadb_version.go index 0b9e4b2f8..c63dbaac0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_mariadb_version.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_mariadb_version.go @@ -8,10 +8,11 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "fmt" ) diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination.go similarity index 68% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination.go index 45bcebde8..421577de0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + // Pagination Pagination information in list responses. type Pagination struct { // The offset specified in the request (if none was specified, the default offset is 0). @@ -56,177 +59,149 @@ func NewPaginationWithDefaults() *Pagination { return &this } -// 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 { - if o == nil { - return nil +// GetOffset returns the Offset field value if set, zero value otherwise. +func (o *Pagination) GetOffset() int32 { + if o == nil || IsNil(o.Offset) { + var ret int32 + return ret } - - return o.Offset - + return *o.Offset } -// GetOffsetOk returns a tuple with the Offset field value +// GetOffsetOk returns a tuple with the Offset 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 *Pagination) GetOffsetOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Offset) { return nil, false } - 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 { + if o != nil && !IsNil(o.Offset) { return true } return false } -// 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 { - if o == nil { - return nil - } - - return o.Limit +// SetOffset gets a reference to the given int32 and assigns it to the Offset field. +func (o *Pagination) SetOffset(v int32) { + o.Offset = &v +} +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *Pagination) GetLimit() int32 { + if o == nil || IsNil(o.Limit) { + var ret int32 + return ret + } + return *o.Limit } -// GetLimitOk returns a tuple with the Limit field value +// GetLimitOk returns a tuple with the Limit 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 *Pagination) GetLimitOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Limit) { return nil, false } - 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 { + if o != nil && !IsNil(o.Limit) { return true } return false } -// GetTotal returns the Total field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *Pagination) GetTotal() *int32 { - if o == nil { - return nil - } - - return o.Total +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *Pagination) SetLimit(v int32) { + o.Limit = &v +} +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *Pagination) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total } -// GetTotalOk returns a tuple with the Total field value +// GetTotalOk returns a tuple with the Total 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 *Pagination) GetTotalOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Total) { return nil, false } - return o.Total, true } -// SetTotal sets field value -func (o *Pagination) SetTotal(v int32) { - - o.Total = &v - -} - // HasTotal returns a boolean if a field has been set. func (o *Pagination) HasTotal() bool { - if o != nil && o.Total != nil { + if o != nil && !IsNil(o.Total) { return true } return false } -// GetLinks returns the Links field value -// If the value is explicit nil, the zero value for PaginationLinks will be returned -func (o *Pagination) GetLinks() *PaginationLinks { - if o == nil { - return nil - } - - return o.Links +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *Pagination) SetTotal(v int32) { + o.Total = &v +} +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *Pagination) GetLinks() PaginationLinks { + if o == nil || IsNil(o.Links) { + var ret PaginationLinks + return ret + } + return *o.Links } -// GetLinksOk returns a tuple with the Links field value +// GetLinksOk returns a tuple with the Links 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 *Pagination) GetLinksOk() (*PaginationLinks, bool) { - if o == nil { + if o == nil || IsNil(o.Links) { return nil, false } - return o.Links, true } -// SetLinks sets field value -func (o *Pagination) SetLinks(v PaginationLinks) { - - o.Links = &v - -} - // HasLinks returns a boolean if a field has been set. func (o *Pagination) HasLinks() bool { - if o != nil && o.Links != nil { + if o != nil && !IsNil(o.Links) { return true } return false } -func (o Pagination) MarshalJSON() ([]byte, error) { +// SetLinks gets a reference to the given PaginationLinks and assigns it to the Links field. +func (o *Pagination) SetLinks(v PaginationLinks) { + o.Links = &v +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Offset != nil { + if !IsNil(o.Offset) { toSerialize["offset"] = o.Offset } - - if o.Limit != nil { + if !IsNil(o.Limit) { toSerialize["limit"] = o.Limit } - - if o.Total != nil { + if !IsNil(o.Total) { toSerialize["total"] = o.Total } - - if o.Links != nil { + if !IsNil(o.Links) { toSerialize["_links"] = o.Links } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullablePagination struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination_links.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination_links.go similarity index 71% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination_links.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination_links.go index 42bf76a2e..e97f7f0a4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_pagination_links.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_pagination_links.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the PaginationLinks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginationLinks{} + // PaginationLinks URLs to navigate the different pages. type PaginationLinks struct { // URL (with offset and limit parameters) of the previous page; only present if offset is greater than 0. @@ -42,135 +45,114 @@ func NewPaginationLinksWithDefaults() *PaginationLinks { return &this } -// GetPrev returns the Prev field value -// If the value is explicit nil, the zero value for string will be returned -func (o *PaginationLinks) GetPrev() *string { - if o == nil { - return nil +// GetPrev returns the Prev field value if set, zero value otherwise. +func (o *PaginationLinks) 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 *PaginationLinks) 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 *PaginationLinks) SetPrev(v string) { - - o.Prev = &v - -} - // HasPrev returns a boolean if a field has been set. func (o *PaginationLinks) 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 *PaginationLinks) 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 *PaginationLinks) SetPrev(v string) { + o.Prev = &v +} +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *PaginationLinks) 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 *PaginationLinks) 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 *PaginationLinks) SetSelf(v string) { - - o.Self = &v - -} - // HasSelf returns a boolean if a field has been set. func (o *PaginationLinks) 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 *PaginationLinks) 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 *PaginationLinks) SetSelf(v string) { + o.Self = &v +} +// GetNext returns the Next field value if set, zero value otherwise. +func (o *PaginationLinks) 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 *PaginationLinks) 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 *PaginationLinks) SetNext(v string) { - - o.Next = &v - -} - // HasNext returns a boolean if a field has been set. func (o *PaginationLinks) HasNext() bool { - if o != nil && o.Next != nil { + if o != nil && !IsNil(o.Next) { return true } return false } -func (o PaginationLinks) MarshalJSON() ([]byte, error) { +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *PaginationLinks) SetNext(v string) { + o.Next = &v +} + +func (o PaginationLinks) 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 NullablePaginationLinks struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_properties.go similarity index 66% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_properties.go index 96e5071da..f4aea910f 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_properties.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the PatchClusterProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchClusterProperties{} + // PatchClusterProperties Properties of the payload to change a cluster: - instances can only be increased (3, 5, 7), - mariadbVersion can only be increased (no downgrade) - storageSize can only be increased, - ram and cores can be both increased and decreased. type PatchClusterProperties struct { MariadbVersion *MariadbVersion `json:"mariadbVersion,omitempty"` @@ -48,303 +51,254 @@ func NewPatchClusterPropertiesWithDefaults() *PatchClusterProperties { return &this } -// GetMariadbVersion returns the MariadbVersion field value -// If the value is explicit nil, the zero value for MariadbVersion will be returned -func (o *PatchClusterProperties) GetMariadbVersion() *MariadbVersion { - if o == nil { - return nil +// GetMariadbVersion returns the MariadbVersion field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetMariadbVersion() MariadbVersion { + if o == nil || IsNil(o.MariadbVersion) { + var ret MariadbVersion + return ret } - - return o.MariadbVersion - + return *o.MariadbVersion } -// GetMariadbVersionOk returns a tuple with the MariadbVersion field value +// GetMariadbVersionOk returns a tuple with the MariadbVersion 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 *PatchClusterProperties) GetMariadbVersionOk() (*MariadbVersion, bool) { - if o == nil { + if o == nil || IsNil(o.MariadbVersion) { return nil, false } - return o.MariadbVersion, true } -// SetMariadbVersion sets field value -func (o *PatchClusterProperties) SetMariadbVersion(v MariadbVersion) { - - o.MariadbVersion = &v - -} - // HasMariadbVersion returns a boolean if a field has been set. func (o *PatchClusterProperties) HasMariadbVersion() bool { - if o != nil && o.MariadbVersion != nil { + if o != nil && !IsNil(o.MariadbVersion) { return true } return false } -// GetInstances returns the Instances field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *PatchClusterProperties) GetInstances() *int32 { - if o == nil { - return nil - } - - return o.Instances +// SetMariadbVersion gets a reference to the given MariadbVersion and assigns it to the MariadbVersion field. +func (o *PatchClusterProperties) SetMariadbVersion(v MariadbVersion) { + o.MariadbVersion = &v +} +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetInstances() int32 { + if o == nil || IsNil(o.Instances) { + var ret int32 + return ret + } + return *o.Instances } -// GetInstancesOk returns a tuple with the Instances field value +// GetInstancesOk returns a tuple with the Instances 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 *PatchClusterProperties) GetInstancesOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Instances) { return nil, false } - return o.Instances, true } -// SetInstances sets field value -func (o *PatchClusterProperties) SetInstances(v int32) { - - o.Instances = &v - -} - // HasInstances returns a boolean if a field has been set. func (o *PatchClusterProperties) HasInstances() bool { - if o != nil && o.Instances != nil { + if o != nil && !IsNil(o.Instances) { return true } return false } -// GetCores returns the Cores field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *PatchClusterProperties) GetCores() *int32 { - if o == nil { - return nil - } - - return o.Cores +// SetInstances gets a reference to the given int32 and assigns it to the Instances field. +func (o *PatchClusterProperties) SetInstances(v int32) { + o.Instances = &v +} +// GetCores returns the Cores field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetCores() int32 { + if o == nil || IsNil(o.Cores) { + var ret int32 + return ret + } + return *o.Cores } -// GetCoresOk returns a tuple with the Cores field value +// GetCoresOk returns a tuple with the Cores 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 *PatchClusterProperties) GetCoresOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Cores) { return nil, false } - return o.Cores, true } -// SetCores sets field value -func (o *PatchClusterProperties) SetCores(v int32) { - - o.Cores = &v - -} - // HasCores returns a boolean if a field has been set. func (o *PatchClusterProperties) HasCores() bool { - if o != nil && o.Cores != nil { + if o != nil && !IsNil(o.Cores) { return true } return false } -// GetRam returns the Ram field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *PatchClusterProperties) GetRam() *int32 { - if o == nil { - return nil - } - - return o.Ram +// SetCores gets a reference to the given int32 and assigns it to the Cores field. +func (o *PatchClusterProperties) SetCores(v int32) { + o.Cores = &v +} +// GetRam returns the Ram field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetRam() int32 { + if o == nil || IsNil(o.Ram) { + var ret int32 + return ret + } + return *o.Ram } -// GetRamOk returns a tuple with the Ram field value +// GetRamOk returns a tuple with the Ram 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 *PatchClusterProperties) GetRamOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.Ram) { return nil, false } - return o.Ram, true } -// SetRam sets field value -func (o *PatchClusterProperties) SetRam(v int32) { - - o.Ram = &v - -} - // HasRam returns a boolean if a field has been set. func (o *PatchClusterProperties) HasRam() bool { - if o != nil && o.Ram != nil { + if o != nil && !IsNil(o.Ram) { return true } return false } -// GetStorageSize returns the StorageSize field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *PatchClusterProperties) GetStorageSize() *int32 { - if o == nil { - return nil - } - - return o.StorageSize +// SetRam gets a reference to the given int32 and assigns it to the Ram field. +func (o *PatchClusterProperties) SetRam(v int32) { + o.Ram = &v +} +// GetStorageSize returns the StorageSize field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetStorageSize() int32 { + if o == nil || IsNil(o.StorageSize) { + var ret int32 + return ret + } + return *o.StorageSize } -// GetStorageSizeOk returns a tuple with the StorageSize field value +// GetStorageSizeOk returns a tuple with the StorageSize 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 *PatchClusterProperties) GetStorageSizeOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.StorageSize) { return nil, false } - return o.StorageSize, true } -// SetStorageSize sets field value -func (o *PatchClusterProperties) SetStorageSize(v int32) { - - o.StorageSize = &v - -} - // HasStorageSize returns a boolean if a field has been set. func (o *PatchClusterProperties) HasStorageSize() bool { - if o != nil && o.StorageSize != nil { + if o != nil && !IsNil(o.StorageSize) { return true } return false } -// GetDisplayName returns the DisplayName field value -// If the value is explicit nil, the zero value for string will be returned -func (o *PatchClusterProperties) GetDisplayName() *string { - if o == nil { - return nil - } - - return o.DisplayName +// SetStorageSize gets a reference to the given int32 and assigns it to the StorageSize field. +func (o *PatchClusterProperties) SetStorageSize(v int32) { + o.StorageSize = &v +} +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName } -// GetDisplayNameOk returns a tuple with the DisplayName field value +// GetDisplayNameOk returns a tuple with the DisplayName 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 *PatchClusterProperties) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.DisplayName) { return nil, false } - return o.DisplayName, true } -// SetDisplayName sets field value -func (o *PatchClusterProperties) SetDisplayName(v string) { - - o.DisplayName = &v - -} - // HasDisplayName returns a boolean if a field has been set. func (o *PatchClusterProperties) HasDisplayName() bool { - if o != nil && o.DisplayName != nil { + if o != nil && !IsNil(o.DisplayName) { return true } return false } -// GetMaintenanceWindow returns the MaintenanceWindow field value -// If the value is explicit nil, the zero value for MaintenanceWindow will be returned -func (o *PatchClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { - if o == nil { - return nil - } - - return o.MaintenanceWindow +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *PatchClusterProperties) SetDisplayName(v string) { + o.DisplayName = &v +} +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *PatchClusterProperties) GetMaintenanceWindow() MaintenanceWindow { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret MaintenanceWindow + return ret + } + return *o.MaintenanceWindow } -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *PatchClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { - if o == nil { + if o == nil || IsNil(o.MaintenanceWindow) { return nil, false } - return o.MaintenanceWindow, true } -// SetMaintenanceWindow sets field value -func (o *PatchClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { - - o.MaintenanceWindow = &v - -} - // HasMaintenanceWindow returns a boolean if a field has been set. func (o *PatchClusterProperties) HasMaintenanceWindow() bool { - if o != nil && o.MaintenanceWindow != nil { + if o != nil && !IsNil(o.MaintenanceWindow) { return true } return false } -func (o PatchClusterProperties) MarshalJSON() ([]byte, error) { +// SetMaintenanceWindow gets a reference to the given MaintenanceWindow and assigns it to the MaintenanceWindow field. +func (o *PatchClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + o.MaintenanceWindow = &v +} + +func (o PatchClusterProperties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.MariadbVersion != nil { + if !IsNil(o.MariadbVersion) { toSerialize["mariadbVersion"] = o.MariadbVersion } - - if o.Instances != nil { + if !IsNil(o.Instances) { toSerialize["instances"] = o.Instances } - - if o.Cores != nil { + if !IsNil(o.Cores) { toSerialize["cores"] = o.Cores } - - if o.Ram != nil { + if !IsNil(o.Ram) { toSerialize["ram"] = o.Ram } - - if o.StorageSize != nil { + if !IsNil(o.StorageSize) { toSerialize["storageSize"] = o.StorageSize } - - if o.DisplayName != nil { + if !IsNil(o.DisplayName) { toSerialize["displayName"] = o.DisplayName } - - if o.MaintenanceWindow != nil { + if !IsNil(o.MaintenanceWindow) { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullablePatchClusterProperties struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_request.go similarity index 73% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_request.go index 2bc625e9a..4828dd116 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_patch_cluster_request.go @@ -8,12 +8,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" ) +// checks if the PatchClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchClusterRequest{} + // PatchClusterRequest Request payload to change a cluster. type PatchClusterRequest struct { Metadata *ClusterMetadata `json:"metadata,omitempty"` @@ -38,93 +41,79 @@ func NewPatchClusterRequestWithDefaults() *PatchClusterRequest { return &this } -// GetMetadata returns the Metadata field value -// If the value is explicit nil, the zero value for ClusterMetadata will be returned -func (o *PatchClusterRequest) GetMetadata() *ClusterMetadata { - if o == nil { - return nil +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *PatchClusterRequest) GetMetadata() ClusterMetadata { + if o == nil || IsNil(o.Metadata) { + var ret ClusterMetadata + return ret } - - return o.Metadata - + 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 *PatchClusterRequest) GetMetadataOk() (*ClusterMetadata, bool) { - if o == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } - return o.Metadata, true } -// SetMetadata sets field value -func (o *PatchClusterRequest) SetMetadata(v ClusterMetadata) { - - o.Metadata = &v - -} - // HasMetadata returns a boolean if a field has been set. func (o *PatchClusterRequest) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } return false } -// GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for PatchClusterProperties will be returned -func (o *PatchClusterRequest) GetProperties() *PatchClusterProperties { - if o == nil { - return nil - } - - return o.Properties +// SetMetadata gets a reference to the given ClusterMetadata and assigns it to the Metadata field. +func (o *PatchClusterRequest) SetMetadata(v ClusterMetadata) { + o.Metadata = &v +} +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *PatchClusterRequest) GetProperties() PatchClusterProperties { + if o == nil || IsNil(o.Properties) { + var ret PatchClusterProperties + return ret + } + return *o.Properties } -// GetPropertiesOk returns a tuple with the Properties field value +// GetPropertiesOk returns a tuple with the Properties 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 *PatchClusterRequest) GetPropertiesOk() (*PatchClusterProperties, bool) { - if o == nil { + if o == nil || IsNil(o.Properties) { return nil, false } - return o.Properties, true } -// SetProperties sets field value -func (o *PatchClusterRequest) SetProperties(v PatchClusterProperties) { - - o.Properties = &v - -} - // HasProperties returns a boolean if a field has been set. func (o *PatchClusterRequest) HasProperties() bool { - if o != nil && o.Properties != nil { + if o != nil && !IsNil(o.Properties) { return true } return false } -func (o PatchClusterRequest) MarshalJSON() ([]byte, error) { +// SetProperties gets a reference to the given PatchClusterProperties and assigns it to the Properties field. +func (o *PatchClusterRequest) SetProperties(v PatchClusterProperties) { + o.Properties = &v +} + +func (o PatchClusterRequest) 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 { + if !IsNil(o.Properties) { toSerialize["properties"] = o.Properties } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullablePatchClusterRequest struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_restore_request.go similarity index 75% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_restore_request.go index c2c1b1fb8..b790dfcfa 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_restore_request.go @@ -8,17 +8,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "time" ) +// checks if the RestoreRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreRequest{} + // RestoreRequest Request payload to restore a cluster from a backup. type RestoreRequest struct { // The unique ID of the resource. - BackupId *string `json:"backupId"` + BackupId string `json:"backupId"` // The timestamp to which the cluster should be restored. If empty, the backup will be applied to the latest timestamp. This value must be supplied as ISO 8601 timestamp, the backup will be replayed up until the given timestamp. If empty, the backup will be applied completely. Must be within the earliestRecoveryTargetTime and now. The earliestRecoveryTargetTime can be looked up in the backup object. RecoveryTargetTime *IonosTime `json:"recoveryTargetTime,omitempty"` } @@ -30,7 +34,7 @@ type RestoreRequest struct { func NewRestoreRequest(backupId string) *RestoreRequest { this := RestoreRequest{} - this.BackupId = &backupId + this.BackupId = backupId return &this } @@ -44,99 +48,68 @@ func NewRestoreRequestWithDefaults() *RestoreRequest { } // GetBackupId returns the BackupId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *RestoreRequest) GetBackupId() *string { +func (o *RestoreRequest) GetBackupId() string { if o == nil { - return nil + var ret string + return ret } return o.BackupId - } // GetBackupIdOk returns a tuple with the BackupId field value // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RestoreRequest) GetBackupIdOk() (*string, bool) { if o == nil { return nil, false } - - return o.BackupId, true + return &o.BackupId, true } // SetBackupId sets field value func (o *RestoreRequest) SetBackupId(v string) { - - o.BackupId = &v - + o.BackupId = v } -// HasBackupId returns a boolean if a field has been set. -func (o *RestoreRequest) HasBackupId() bool { - if o != nil && o.BackupId != nil { - return true +// GetRecoveryTargetTime returns the RecoveryTargetTime field value if set, zero value otherwise. +func (o *RestoreRequest) GetRecoveryTargetTime() time.Time { + if o == nil || IsNil(o.RecoveryTargetTime) { + var ret time.Time + return ret } - - return false + return o.RecoveryTargetTime.Time } -// GetRecoveryTargetTime returns the RecoveryTargetTime field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *RestoreRequest) GetRecoveryTargetTime() *time.Time { - if o == nil { - return nil - } - - if o.RecoveryTargetTime == nil { - return nil - } - return &o.RecoveryTargetTime.Time - -} - -// GetRecoveryTargetTimeOk returns a tuple with the RecoveryTargetTime field value +// GetRecoveryTargetTimeOk returns a tuple with the RecoveryTargetTime 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 *RestoreRequest) GetRecoveryTargetTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - - if o.RecoveryTargetTime == nil { + if o == nil || IsNil(o.RecoveryTargetTime) { return nil, false } return &o.RecoveryTargetTime.Time, true - -} - -// SetRecoveryTargetTime sets field value -func (o *RestoreRequest) SetRecoveryTargetTime(v time.Time) { - - o.RecoveryTargetTime = &IonosTime{v} - } // HasRecoveryTargetTime returns a boolean if a field has been set. func (o *RestoreRequest) HasRecoveryTargetTime() bool { - if o != nil && o.RecoveryTargetTime != nil { + if o != nil && !IsNil(o.RecoveryTargetTime) { return true } return false } -func (o RestoreRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.BackupId != nil { - toSerialize["backupId"] = o.BackupId - } +// SetRecoveryTargetTime gets a reference to the given time.Time and assigns it to the RecoveryTargetTime field. +func (o *RestoreRequest) SetRecoveryTargetTime(v time.Time) { + o.RecoveryTargetTime = &IonosTime{v} +} - if o.RecoveryTargetTime != nil { +func (o RestoreRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupId"] = o.BackupId + if !IsNil(o.RecoveryTargetTime) { toSerialize["recoveryTargetTime"] = o.RecoveryTargetTime } - - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableRestoreRequest struct { diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_state.go similarity index 99% rename from vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go rename to vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_state.go index 9f51a4c35..21c7fb7b4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/model_state.go @@ -8,10 +8,11 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionoscloud +package mariadb import ( "encoding/json" + "fmt" ) diff --git a/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/utils.go b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/utils.go new file mode 100644 index 000000000..e8ca47ead --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/v2/utils.go @@ -0,0 +1,362 @@ +/* + * IONOS DBaaS MariaDB REST API + * + * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package mariadb + +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-dbaas-mariadb/.gitbook.yaml b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.gitbook.yaml deleted file mode 100644 index 6c8fbd82b..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/.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-dbaas-mariadb/README.md b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md deleted file mode 100644 index e3b0342ce..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md +++ /dev/null @@ -1,145 +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 - -An enterprise-grade Database is provided as a Service (DBaaS) solution that -can be managed through a browser-based \"Data Center Designer\" (DCD) tool or -via an easy to use API. - -The API allows you to create additional MariaDB database clusters or modify existing -ones. It is designed to allow users to leverage the same power and -flexibility found within the DCD visual tool. Both tools are consistent with -their concepts and lend well to making the experience smooth and intuitive. - - -## 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: 0.1.0 -- Package version: 1.1.1 -- 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://mariadb.de-txl.ionos.com* - Berlin, Germany -- *https://mariadb.de-fra.ionos.com* - Frankfurt, Germany -- *https://mariadb.es-vit.ionos.com* - Logroño, Spain -- *https://mariadb.fr-par.ionos.com* - Paris, France -- *https://mariadb.gb-lhr.ionos.com* - London, Great Britain -- *https://mariadb.us-ewr.ionos.com* - Newark, USA -- *https://mariadb.us-las.ionos.com* - Las Vegas, USA -- *https://mariadb.us-mci.ionos.com* - Lenexa, USA - -By default, *https://mariadb.de-txl.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://mariadb.de-txl.ionos.com* -
- API Endpoints table - - -| Class | Method | HTTP request | Description | -| ------------- | ------------- | ------------- | ------------- | -| BackupsApi | [**BackupsFindById**](docs/api/BackupsApi.md#BackupsFindById) | **Get** /backups/{backupId} | Fetch backups | -| BackupsApi | [**BackupsGet**](docs/api/BackupsApi.md#BackupsGet) | **Get** /backups | List of backups. | -| BackupsApi | [**ClusterBackupsGet**](docs/api/BackupsApi.md#ClusterBackupsGet) | **Get** /clusters/{clusterId}/backups | List backups of cluster | -| ClustersApi | [**ClustersDelete**](docs/api/ClustersApi.md#ClustersDelete) | **Delete** /clusters/{clusterId} | Delete a cluster | -| ClustersApi | [**ClustersFindById**](docs/api/ClustersApi.md#ClustersFindById) | **Get** /clusters/{clusterId} | Fetch a cluster | -| ClustersApi | [**ClustersGet**](docs/api/ClustersApi.md#ClustersGet) | **Get** /clusters | List clusters | -| ClustersApi | [**ClustersPatch**](docs/api/ClustersApi.md#ClustersPatch) | **Patch** /clusters/{clusterId} | Update a cluster | -| ClustersApi | [**ClustersPost**](docs/api/ClustersApi.md#ClustersPost) | **Post** /clusters | Create a cluster | -| RestoreApi | [**ClustersRestore**](docs/api/RestoreApi.md#ClustersRestore) | **Post** /clusters/{clusterId}/restore | In-place restore of a cluster. | - -
- -## Documentation For Models - -All URIs are relative to *https://mariadb.de-txl.ionos.com* -
-API models list - - - [Backup](docs/models/Backup) - - [BackupList](docs/models/BackupList) - - [BackupListAllOf](docs/models/BackupListAllOf) - - [BackupResponse](docs/models/BackupResponse) - - [BaseBackup](docs/models/BaseBackup) - - [ClusterList](docs/models/ClusterList) - - [ClusterListAllOf](docs/models/ClusterListAllOf) - - [ClusterMetadata](docs/models/ClusterMetadata) - - [ClusterProperties](docs/models/ClusterProperties) - - [ClusterResponse](docs/models/ClusterResponse) - - [ClustersGet400Response](docs/models/ClustersGet400Response) - - [ClustersGet401Response](docs/models/ClustersGet401Response) - - [ClustersGet403Response](docs/models/ClustersGet403Response) - - [ClustersGet404Response](docs/models/ClustersGet404Response) - - [ClustersGet405Response](docs/models/ClustersGet405Response) - - [ClustersGet415Response](docs/models/ClustersGet415Response) - - [ClustersGet422Response](docs/models/ClustersGet422Response) - - [ClustersGet429Response](docs/models/ClustersGet429Response) - - [ClustersGet500Response](docs/models/ClustersGet500Response) - - [ClustersGet503Response](docs/models/ClustersGet503Response) - - [Connection](docs/models/Connection) - - [CreateClusterProperties](docs/models/CreateClusterProperties) - - [CreateClusterRequest](docs/models/CreateClusterRequest) - - [DBUser](docs/models/DBUser) - - [DayOfTheWeek](docs/models/DayOfTheWeek) - - [ErrorMessage](docs/models/ErrorMessage) - - [MaintenanceWindow](docs/models/MaintenanceWindow) - - [MariadbVersion](docs/models/MariadbVersion) - - [Pagination](docs/models/Pagination) - - [PaginationLinks](docs/models/PaginationLinks) - - [PatchClusterProperties](docs/models/PatchClusterProperties) - - [PatchClusterRequest](docs/models/PatchClusterRequest) - - [RestoreRequest](docs/models/RestoreRequest) - - [State](docs/models/State) - - -[[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-dbaas-mariadb/configuration.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go deleted file mode 100644 index 6f3be7ffc..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go +++ /dev/null @@ -1,327 +0,0 @@ -/* - * IONOS DBaaS MariaDB REST API - * - * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. - * - * API version: 0.1.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://mariadb.de-txl.ionos.com" - DefaultIonosBasePath = "" - defaultMaxRetries = 3 - defaultWaitTime = time.Duration(100) * time.Millisecond - defaultMaxWaitTime = time.Duration(2000) * time.Millisecond -) - -var ( - IonosServerUrls = []string{ - "https://mariadb.de-txl.ionos.com", - "https://mariadb.de-fra.ionos.com", - "https://mariadb.es-vit.ionos.com", - "https://mariadb.fr-par.ionos.com", - "https://mariadb.gb-lhr.ionos.com", - "https://mariadb.us-ewr.ionos.com", - "https://mariadb.us-las.ionos.com", - "https://mariadb.us-mci.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-dbaas-mariadb/v1.1.1", - Debug: false, - Username: username, - Password: password, - Token: token, - MaxRetries: defaultMaxRetries, - MaxWaitTime: defaultMaxWaitTime, - WaitTime: defaultWaitTime, - Logger: NewDefaultLogger(), - LogLevel: getLogLevelFromEnv(), - Servers: ServerConfigurations{ - { - URL: getServerUrl(hostUrl), - Description: "Berlin, Germany", - }, - { - URL: getServerUrl(hostUrl), - Description: "Frankfurt, Germany", - }, - { - URL: getServerUrl(hostUrl), - Description: "Logroño, Spain", - }, - { - URL: getServerUrl(hostUrl), - Description: "Paris, France", - }, - { - URL: getServerUrl(hostUrl), - Description: "London, Great Britain", - }, - { - URL: getServerUrl(hostUrl), - Description: "Newark, USA", - }, - { - URL: getServerUrl(hostUrl), - Description: "Las Vegas, USA", - }, - { - URL: getServerUrl(hostUrl), - Description: "Lenexa, USA", - }, - }, - 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-dbaas-mariadb/logger.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/logger.go deleted file mode 100644 index 97060b456..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/logger.go +++ /dev/null @@ -1,80 +0,0 @@ -/* - * IONOS DBaaS MariaDB REST API - * - * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. - * - * API version: 0.1.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-dbaas-mariadb/response.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/response.go deleted file mode 100644 index ce87e90ed..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/response.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - * IONOS DBaaS MariaDB REST API - * - * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. - * - * API version: 0.1.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-dbaas-mariadb/sonar-project.properties b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/sonar-project.properties deleted file mode 100644 index e1bdfb856..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/sonar-project.properties +++ /dev/null @@ -1,12 +0,0 @@ -sonar.projectKey=ionos-cloud_sdk-go-dbaas-mariadb -sonar.organization=ionos-cloud - -# This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=sdk-go-dbaas-mariadb -#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 \ No newline at end of file diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/utils.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/utils.go deleted file mode 100644 index 41aa74b09..000000000 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/utils.go +++ /dev/null @@ -1,776 +0,0 @@ -/* - * IONOS DBaaS MariaDB REST API - * - * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. - * - * API version: 0.1.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..9f610d8bd 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/dbaas/mariadb/v2 v2.0.0 +## explicit; go 1.22 +github.com/ionos-cloud/sdk-go-bundle/products/dbaas/mariadb/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 @@ -341,9 +344,6 @@ github.com/ionos-cloud/sdk-go-dataplatform # github.com/ionos-cloud/sdk-go-dbaas-in-memory-db v1.0.1 ## explicit; go 1.18 github.com/ionos-cloud/sdk-go-dbaas-in-memory-db -# github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 -## explicit; go 1.18 -github.com/ionos-cloud/sdk-go-dbaas-mariadb # github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1 ## explicit; go 1.18 github.com/ionos-cloud/sdk-go-dbaas-mongo