diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/README.md b/cluster-autoscaler/cloudprovider/ionoscloud/README.md index 0893372159c0..acd9fd38ff42 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/README.md +++ b/cluster-autoscaler/cloudprovider/ionoscloud/README.md @@ -21,6 +21,12 @@ make make-image BUILD_TAGS=ionoscloud TAG='' REGISTRY='' make push-image BUILD_TAGS=ionoscloud TAG='' REGISTRY='' ``` +If you're using [rootless podman](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md), create a symlink to docker and build the image using: + +```sh +make make-image BUILD_TAGS=ionoscloud TAG='' REGISTRY='' DOCKER_NETWORK=host +``` + If you don't have a token, generate one: ```sh @@ -32,3 +38,12 @@ Edit [`cluster-autoscaler-standard.yaml`](./examples/cluster-autoscaler-standard ```console kubectl apply -f examples/cluster-autoscaler-standard.yaml ``` + +## Development + +The unit tests use mocks generated by [mockery](https://github.com/vektra/mockery) v2. To update them run: + +```sh +mockery --inpackage --testonly --case snake --boilerplate-file ../../../hack/boilerplate/boilerplate.generatego.txt --name APIClient +mockery --inpackage --testonly --case snake --boilerplate-file ../../../hack/boilerplate/boilerplate.generatego.txt --name IonosCloudManager +``` diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/cache.go b/cluster-autoscaler/cloudprovider/ionoscloud/cache.go index 8ff67699122b..235397bdb68b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/cache.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/cache.go @@ -41,7 +41,6 @@ type IonosCache struct { nodeGroups map[string]nodeGroupCacheEntry nodesToNodeGroups map[string]string - instances map[string]cloudprovider.Instance nodeGroupSizes map[string]int nodeGroupTargetSizes map[string]int nodeGroupLockTable map[string]bool @@ -52,31 +51,12 @@ func NewIonosCache() *IonosCache { return &IonosCache{ nodeGroups: map[string]nodeGroupCacheEntry{}, nodesToNodeGroups: map[string]string{}, - instances: map[string]cloudprovider.Instance{}, nodeGroupSizes: map[string]int{}, nodeGroupTargetSizes: map[string]int{}, nodeGroupLockTable: map[string]bool{}, } } -// GetInstancesForNodeGroup returns the list of cached instances a node group. -func (cache *IonosCache) GetInstancesForNodeGroup(id string) []cloudprovider.Instance { - cache.mutex.Lock() - defer cache.mutex.Unlock() - - var nodeIds []string - for nodeId, nodeGroupId := range cache.nodesToNodeGroups { - if nodeGroupId == id { - nodeIds = append(nodeIds, nodeId) - } - } - instances := make([]cloudprovider.Instance, len(nodeIds)) - for i, id := range nodeIds { - instances[i] = cache.instances[id] - } - return instances -} - // AddNodeGroup adds a node group to the cache. func (cache *IonosCache) AddNodeGroup(newPool cloudprovider.NodeGroup) { cache.mutex.Lock() @@ -88,7 +68,6 @@ func (cache *IonosCache) AddNodeGroup(newPool cloudprovider.NodeGroup) { func (cache *IonosCache) removeNodesForNodeGroupNoLock(id string) { for nodeId, nodeGroupId := range cache.nodesToNodeGroups { if nodeGroupId == id { - delete(cache.instances, nodeId) delete(cache.nodesToNodeGroups, nodeId) } } @@ -103,23 +82,9 @@ func (cache *IonosCache) RemoveInstanceFromCache(id string) { klog.V(5).Infof("Removed instance %s from cache", id) nodeGroupId := cache.nodesToNodeGroups[id] delete(cache.nodesToNodeGroups, id) - delete(cache.instances, id) cache.updateNodeGroupTimestampNoLock(nodeGroupId) } -// SetInstancesCache overwrites all cached instances and node group mappings. -func (cache *IonosCache) SetInstancesCache(nodeGroupInstances map[string][]cloudprovider.Instance) { - cache.mutex.Lock() - defer cache.mutex.Unlock() - - cache.nodesToNodeGroups = map[string]string{} - cache.instances = map[string]cloudprovider.Instance{} - - for id, instances := range nodeGroupInstances { - cache.setInstancesCacheForNodeGroupNoLock(id, instances) - } -} - // SetInstancesCacheForNodeGroup overwrites cached instances and mappings for a node group. func (cache *IonosCache) SetInstancesCacheForNodeGroup(id string, instances []cloudprovider.Instance) { cache.mutex.Lock() @@ -133,7 +98,6 @@ func (cache *IonosCache) setInstancesCacheForNodeGroupNoLock(id string, instance for _, instance := range instances { nodeId := convertToNodeId(instance.Id) cache.nodesToNodeGroups[nodeId] = id - cache.instances[nodeId] = instance } cache.updateNodeGroupTimestampNoLock(id) } @@ -166,18 +130,6 @@ func (cache *IonosCache) GetNodeGroups() []cloudprovider.NodeGroup { return nodeGroups } -// GetInstances returns an unsorted list of all cached instances. -func (cache *IonosCache) GetInstances() []cloudprovider.Instance { - cache.mutex.Lock() - defer cache.mutex.Unlock() - - instances := make([]cloudprovider.Instance, 0, len(cache.nodesToNodeGroups)) - for _, instance := range cache.instances { - instances = append(instances, instance) - } - return instances -} - // GetNodeGroupForNode returns the node group for the given node. // Returns nil if either the mapping or the node group is not cached. func (cache *IonosCache) GetNodeGroupForNode(nodeId string) cloudprovider.NodeGroup { diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/cache_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/cache_test.go index 38a7b6dbfa4a..af6ababf673c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/cache_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/cache_test.go @@ -28,27 +28,6 @@ func newCacheEntry(data cloudprovider.NodeGroup, ts time.Time) nodeGroupCacheEnt return nodeGroupCacheEntry{data: data, ts: ts} } -func TestCache_GetInstancesForNodeGroup(t *testing.T) { - cache := NewIonosCache() - cache.nodesToNodeGroups = map[string]string{ - "node-1": "nodepool-1", - "node-2": "nodepool-2", - "node-3": "nodepool-1", - } - cache.instances = map[string]cloudprovider.Instance{ - "node-1": {Id: convertToInstanceId("node-1")}, - "node-2": {Id: convertToInstanceId("node-2")}, - "node-3": {Id: convertToInstanceId("node-3")}, - } - - expect := []cloudprovider.Instance{ - {Id: convertToInstanceId("node-1")}, - {Id: convertToInstanceId("node-3")}, - } - instances := cache.GetInstancesForNodeGroup("nodepool-1") - require.ElementsMatch(t, expect, instances) -} - func TestCache_AddNodeGroup(t *testing.T) { cache := NewIonosCache() require.Empty(t, cache.GetNodeGroups()) @@ -61,54 +40,27 @@ func TestCache_RemoveInstanceFromCache(t *testing.T) { cache := NewIonosCache() cache.nodeGroups["2"] = newCacheEntry(&nodePool{id: "2"}, firstTime) cache.nodesToNodeGroups["b2"] = "2" - cache.instances["b2"] = newInstance("b2") require.NotNil(t, cache.GetNodeGroupForNode("b2")) - require.NotEmpty(t, cache.GetInstances()) require.True(t, cache.NodeGroupNeedsRefresh("2")) cache.RemoveInstanceFromCache("b2") require.Nil(t, cache.GetNodeGroupForNode("b2")) - require.Empty(t, cache.GetInstances()) require.False(t, cache.NodeGroupNeedsRefresh("2")) } -func TestCache_SetInstancesCache(t *testing.T) { - cache := NewIonosCache() - cache.nodeGroups["2"] = newCacheEntry(&nodePool{id: "2"}, timeNow()) - cache.nodesToNodeGroups["b2"] = "2" - cache.instances["a3"] = newInstance("b2") - nodePoolInstances := map[string][]cloudprovider.Instance{ - "1": {newInstance("a1"), newInstance("a2")}, - "2": {newInstance("b1")}, - } - - require.NotNil(t, cache.GetNodeGroupForNode("b2")) - cache.SetInstancesCache(nodePoolInstances) - - require.Nil(t, cache.GetNodeGroupForNode("b2")) - require.ElementsMatch(t, []cloudprovider.Instance{ - newInstance("a1"), newInstance("a2"), newInstance("b1"), - }, cache.GetInstances()) -} - func TestCache_SetInstancesCacheForNodeGroup(t *testing.T) { cache := NewIonosCache() cache.AddNodeGroup(&nodePool{id: "1"}) cache.AddNodeGroup(&nodePool{id: "2"}) cache.nodesToNodeGroups["a3"] = "1" cache.nodesToNodeGroups["b1"] = "2" - cache.instances["a3"] = newInstance("b2") - cache.instances["b1"] = newInstance("b1") instances := []cloudprovider.Instance{newInstance("a1"), newInstance("a2")} require.NotNil(t, cache.GetNodeGroupForNode("a3")) cache.SetInstancesCacheForNodeGroup("1", instances) require.Nil(t, cache.GetNodeGroupForNode("a3")) - require.ElementsMatch(t, []cloudprovider.Instance{ - newInstance("a1"), newInstance("a2"), newInstance("b1"), - }, cache.GetInstances()) } func TestCache_GetNodeGroupIDs(t *testing.T) { @@ -129,18 +81,6 @@ func TestCache_GetNodeGroups(t *testing.T) { require.ElementsMatch(t, []*nodePool{{id: "1"}, {id: "2"}}, cache.GetNodeGroups()) } -func TestCache_GetInstances(t *testing.T) { - cache := NewIonosCache() - require.Empty(t, cache.GetInstances()) - cache.nodesToNodeGroups["a1"] = "1" - cache.nodesToNodeGroups["a2"] = "1" - cache.instances["a1"] = newInstance("a1") - cache.instances["a2"] = newInstance("a2") - require.ElementsMatch(t, []cloudprovider.Instance{ - newInstance("a1"), newInstance("a2"), - }, cache.GetInstances()) -} - func TestCache_GetNodeGroupForNode(t *testing.T) { cache := NewIonosCache() require.Nil(t, cache.GetNodeGroupForNode("a1")) diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/client.go b/cluster-autoscaler/cloudprovider/ionoscloud/client.go index f7ebc4eccc77..fdacff82065b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/client.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/client.go @@ -19,13 +19,13 @@ package ionoscloud import ( "context" "crypto/tls" + "encoding/json" "fmt" - "io/ioutil" "net/http" + "os" "path/filepath" "time" - "github.com/google/uuid" "k8s.io/apimachinery/pkg/util/wait" ionos "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" "k8s.io/klog/v2" @@ -59,18 +59,16 @@ type APIClient interface { K8sNodepoolsNodesGet(ctx context.Context, k8sClusterId string, nodepoolId string) ionos.ApiK8sNodepoolsNodesGetRequest K8sNodepoolsNodesGetExecute(r ionos.ApiK8sNodepoolsNodesGetRequest) (ionos.KubernetesNodes, *ionos.APIResponse, error) K8sNodepoolsNodesDelete(ctx context.Context, k8sClusterId string, nodepoolId string, nodeId string) ionos.ApiK8sNodepoolsNodesDeleteRequest - K8sNodepoolsNodesDeleteExecute(r ionos.ApiK8sNodepoolsNodesDeleteRequest) (map[string]interface{}, *ionos.APIResponse, error) + K8sNodepoolsNodesDeleteExecute(r ionos.ApiK8sNodepoolsNodesDeleteRequest) (*ionos.APIResponse, error) K8sNodepoolsPut(ctx context.Context, k8sClusterId string, nodepoolId string) ionos.ApiK8sNodepoolsPutRequest - K8sNodepoolsPutExecute(r ionos.ApiK8sNodepoolsPutRequest) (ionos.KubernetesNodePoolForPut, *ionos.APIResponse, error) + K8sNodepoolsPutExecute(r ionos.ApiK8sNodepoolsPutRequest) (ionos.KubernetesNodePool, *ionos.APIResponse, error) } -var apiClientFactory = NewAPIClient - // NewAPIClient creates a new IonosCloud API client. -func NewAPIClient(token, endpoint string, insecure bool) APIClient { - config := ionos.NewConfiguration("", "", token) - if endpoint != "" { - config.Servers[0].URL = endpoint +func NewAPIClient(token, endpoint, userAgent string, insecure bool) APIClient { + config := ionos.NewConfiguration("", "", token, endpoint) + if userAgent != "" { + config.UserAgent = userAgent } if insecure { config.HTTPClient = &http.Client{ @@ -80,80 +78,94 @@ func NewAPIClient(token, endpoint string, insecure bool) APIClient { } } config.Debug = klog.V(6).Enabled() + // Depth > 0 is only important for listing resources. All other autoscaling related requests don't need it + config.SetDepth(0) client := ionos.NewAPIClient(config) return client.KubernetesApi } // AutoscalingClient is a client abstraction used for autoscaling. type AutoscalingClient struct { - client APIClient + clientProvider clusterId string - endpoint string - insecure bool pollTimeout time.Duration pollInterval time.Duration - tokens map[string]string } // NewAutoscalingClient contructs a new autoscaling client. -func NewAutoscalingClient(config *Config) (*AutoscalingClient, error) { +func NewAutoscalingClient(config *Config, userAgent string) (*AutoscalingClient, error) { c := &AutoscalingClient{ - clusterId: config.ClusterId, - endpoint: config.Endpoint, - insecure: config.Insecure, - pollTimeout: config.PollTimeout, - pollInterval: config.PollInterval, - } - if config.Token != "" { - c.client = apiClientFactory(config.Token, config.Endpoint, config.Insecure) - } else if config.TokensPath != "" { - tokens, err := loadTokensFromFilesystem(config.TokensPath) - if err != nil { - return nil, err - } - c.tokens = tokens + clientProvider: newClientProvider(config, userAgent), + clusterId: config.ClusterId, + pollTimeout: config.PollTimeout, + pollInterval: config.PollInterval, } return c, nil } -// loadTokensFromFilesystem loads a mapping of node pool UUIDs to JWT tokens from the given path. -func loadTokensFromFilesystem(path string) (map[string]string, error) { - klog.V(3).Infof("Loading tokens from: %s", path) - filenames, _ := filepath.Glob(filepath.Join(path, "*")) - tokens := make(map[string]string) - for _, filename := range filenames { - name := filepath.Base(filename) - if _, err := uuid.Parse(name); err != nil { - continue - } - data, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err +func newClientProvider(config *Config, userAgent string) clientProvider { + if config.Token != "" { + return defaultClientProvider{ + token: config.Token, + userAgent: userAgent, } - tokens[name] = string(data) } - if len(tokens) == 0 { - return nil, fmt.Errorf("%s did not contain any valid entries", path) + return customClientProvider{ + cloudConfigDir: config.TokensPath, + endpoint: config.Endpoint, + userAgent: userAgent, + insecure: config.Insecure, } - return tokens, nil } -// apiClientFor returns an IonosCloud API client for the given node pool. -// If the cache was not initialized with a client a new one will be created using a cached token. -func (c *AutoscalingClient) apiClientFor(id string) (APIClient, error) { - if c.client != nil { - return c.client, nil +// clientProvider initializes an authenticated Ionos Cloud API client using pre-configured values +type clientProvider interface { + GetClient() (APIClient, error) +} + +type defaultClientProvider struct { + token string + userAgent string +} + +func (p defaultClientProvider) GetClient() (APIClient, error) { + return NewAPIClient(p.token, "", p.userAgent, false), nil +} + +type customClientProvider struct { + cloudConfigDir string + endpoint string + userAgent string + insecure bool +} + +func (p customClientProvider) GetClient() (APIClient, error) { + files, err := filepath.Glob(filepath.Join(p.cloudConfigDir, "[a-zA-Z0-9]*")) + if err != nil { + return nil, err + } + if len(files) == 0 { + return nil, fmt.Errorf("missing cloud config") + } + data, err := os.ReadFile(files[0]) + if err != nil { + return nil, err + } + cloudConfig := struct { + Tokens []string `json:"tokens"` + }{} + if err := json.Unmarshal(data, &cloudConfig); err != nil { + return nil, err } - token, exists := c.tokens[id] - if !exists { - return nil, fmt.Errorf("missing token for node pool %s", id) + if len(cloudConfig.Tokens) == 0 { + return nil, fmt.Errorf("missing tokens for cloud config %s", filepath.Base(files[0])) } - return apiClientFactory(token, c.endpoint, c.insecure), nil + return NewAPIClient(cloudConfig.Tokens[0], p.endpoint, p.userAgent, p.insecure), nil } // GetNodePool gets a node pool. func (c *AutoscalingClient) GetNodePool(id string) (*ionos.KubernetesNodePool, error) { - client, err := c.apiClientFor(id) + client, err := c.GetClient() if err != nil { return nil, err } @@ -165,21 +177,23 @@ func (c *AutoscalingClient) GetNodePool(id string) (*ionos.KubernetesNodePool, e return &nodepool, nil } -func resizeRequestBody(targetSize int) ionos.KubernetesNodePoolPropertiesForPut { - return ionos.KubernetesNodePoolPropertiesForPut{ - NodeCount: pointer.Int32Ptr(int32(targetSize)), +func resizeRequestBody(targetSize int) ionos.KubernetesNodePoolForPut { + return ionos.KubernetesNodePoolForPut{ + Properties: &ionos.KubernetesNodePoolPropertiesForPut{ + NodeCount: pointer.Int32Ptr(int32(targetSize)), + }, } } // ResizeNodePool sets the target size of a node pool and starts the resize process. // The node pool target size cannot be changed until this operation finishes. func (c *AutoscalingClient) ResizeNodePool(id string, targetSize int) error { - client, err := c.apiClientFor(id) + client, err := c.GetClient() if err != nil { return err } req := client.K8sNodepoolsPut(context.Background(), c.clusterId, id) - req = req.KubernetesNodePoolProperties(resizeRequestBody(targetSize)) + req = req.KubernetesNodePool(resizeRequestBody(targetSize)) _, _, err = client.K8sNodepoolsPutExecute(req) return err } @@ -200,7 +214,7 @@ func (c *AutoscalingClient) WaitForNodePoolResize(id string, size int) error { // ListNodes lists nodes. func (c *AutoscalingClient) ListNodes(id string) ([]ionos.KubernetesNode, error) { - client, err := c.apiClientFor(id) + client, err := c.GetClient() if err != nil { return nil, err } @@ -215,11 +229,11 @@ func (c *AutoscalingClient) ListNodes(id string) ([]ionos.KubernetesNode, error) // DeleteNode starts node deletion. func (c *AutoscalingClient) DeleteNode(id, nodeId string) error { - client, err := c.apiClientFor(id) + client, err := c.GetClient() if err != nil { return err } req := client.K8sNodepoolsNodesDelete(context.Background(), c.clusterId, id, nodeId) - _, _, err = client.K8sNodepoolsNodesDeleteExecute(req) + _, err = client.K8sNodepoolsNodesDeleteExecute(req) return err } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go index c6ff5b841e26..5e69584443f9 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go @@ -17,8 +17,6 @@ limitations under the License. package ionoscloud import ( - "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -26,103 +24,27 @@ import ( "github.com/stretchr/testify/require" ) -func TestAPIClientFor(t *testing.T) { - apiClientFactory = func(_, _ string, _ bool) APIClient { return &MockAPIClient{} } - defer func() { apiClientFactory = NewAPIClient }() +func TestCustomClientProvider(t *testing.T) { + tokensPath := t.TempDir() + require.NoError(t, os.WriteFile(filepath.Join(tokensPath, "..ignoreme"), []byte(`{"invalid"}`), 0644)) - cases := []struct { - name string - token string - cachedTokens map[string]string - expectClient APIClient - expectError bool - }{ - { - name: "from cached client", - token: "token", - expectClient: &MockAPIClient{}, - }, - { - name: "from token cache", - cachedTokens: map[string]string{"test": "token"}, - expectClient: &MockAPIClient{}, - }, - { - name: "not in token cache", - cachedTokens: map[string]string{"notfound": "token"}, - expectError: true, - }, - } - - for _, c := range cases { - t.Run(c.name, func(t *testing.T) { - apiClientFactory = func(_, _ string, _ bool) APIClient { return &MockAPIClient{} } - defer func() { apiClientFactory = NewAPIClient }() - - client, _ := NewAutoscalingClient(&Config{ - Token: c.token, - Endpoint: "https://api.cloud.ionos.com/v6", - Insecure: true, - }) - client.tokens = c.cachedTokens - apiClient, err := client.apiClientFor("test") - require.Equalf(t, c.expectError, err != nil, "expected error: %t, got: %v", c.expectError, err) - require.EqualValues(t, c.expectClient, apiClient) - }) - } -} - -func TestLoadTokensFromFilesystem_OK(t *testing.T) { - tempDir, err := ioutil.TempDir("", t.Name()) - require.NoError(t, err) - defer func() { _ = os.RemoveAll(tempDir) }() - - uuid1, uuid2, uuid3 := NewUUID(), NewUUID(), NewUUID() - - input := map[string]string{ - uuid1: "token1", - uuid2: "token2", - uuid3: "token3", - } - expect := map[string]string{ - uuid1: "token1", - uuid2: "token2", - uuid3: "token3", - } + // missing files + provider := customClientProvider{tokensPath, "https://api.ionos.com", "test", true} + _, err := provider.GetClient() + require.Error(t, err) - for name, token := range input { - require.NoError(t, ioutil.WriteFile(filepath.Join(tempDir, name), []byte(token), 0600)) - } - require.NoError(t, ioutil.WriteFile(filepath.Join(tempDir, "..somfile"), []byte("foobar"), 0600)) + require.NoError(t, os.WriteFile(filepath.Join(tokensPath, "a"), []byte(`{"tokens":["token1"]}`), 0644)) + require.NoError(t, os.WriteFile(filepath.Join(tokensPath, "b"), []byte(`{"tokens":["token2"]}`), 0644)) - client, err := NewAutoscalingClient(&Config{TokensPath: tempDir}) + c, err := provider.GetClient() require.NoError(t, err) - require.Equal(t, expect, client.tokens) + require.NotNil(t, c) } -func TestLoadTokensFromFilesystem_ReadError(t *testing.T) { - tempDir, err := ioutil.TempDir("", t.Name()) - require.NoError(t, err) - defer func() { _ = os.RemoveAll(tempDir) }() - - require.NoError(t, os.Mkdir(filepath.Join(tempDir, NewUUID()), 0755)) - client, err := NewAutoscalingClient(&Config{TokensPath: tempDir}) - require.Error(t, err) - require.Nil(t, client) +type fakeClientProvider struct { + client *MockAPIClient } -func TestLoadTokensFromFilesystem_NoValidToken(t *testing.T) { - tempDir, err := ioutil.TempDir("", t.Name()) - require.NoError(t, err) - defer func() { _ = os.RemoveAll(tempDir) }() - - for i := 0; i < 10; i++ { - path := filepath.Join(tempDir, fmt.Sprintf("notauuid%d", i)) - require.NoError(t, ioutil.WriteFile(path, []byte("token"), 0600)) - path = filepath.Join(tempDir, fmt.Sprintf("foo.bar.notauuid%d", i)) - require.NoError(t, ioutil.WriteFile(path, []byte("token"), 0600)) - } - client, err := NewAutoscalingClient(&Config{TokensPath: tempDir}) - require.Error(t, err) - require.Nil(t, client) +func (f fakeClientProvider) GetClient() (APIClient, error) { + return f.client, nil } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/LICENSE b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/LICENSE new file mode 100644 index 000000000000..b9d5d805f754 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/LICENSE @@ -0,0 +1,190 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2021 IONOS + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_.go new file mode 100644 index 000000000000..0b600d562a03 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_.go @@ -0,0 +1,218 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiApiInfoGetRequest struct { + ctx _context.Context + ApiService *DefaultApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiApiInfoGetRequest) Pretty(pretty bool) ApiApiInfoGetRequest { + r.pretty = &pretty + return r +} +func (r ApiApiInfoGetRequest) Depth(depth int32) ApiApiInfoGetRequest { + r.depth = &depth + return r +} +func (r ApiApiInfoGetRequest) XContractNumber(xContractNumber int32) ApiApiInfoGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiApiInfoGetRequest) Filter(key string, value string) ApiApiInfoGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiApiInfoGetRequest) OrderBy(orderBy string) ApiApiInfoGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiApiInfoGetRequest) MaxResults(maxResults int32) ApiApiInfoGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiApiInfoGetRequest) Execute() (Info, *APIResponse, error) { + return r.ApiService.ApiInfoGetExecute(r) +} + +/* + * ApiInfoGet Display API information + * Display API information + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiApiInfoGetRequest + */ +func (a *DefaultApiService) ApiInfoGet(ctx _context.Context) ApiApiInfoGetRequest { + return ApiApiInfoGetRequest{ + ApiService: a, + ctx: ctx, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return Info + */ +func (a *DefaultApiService) ApiInfoGetExecute(r ApiApiInfoGetRequest) (Info, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Info + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ApiInfoGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ApiInfoGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_unit.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_units.go similarity index 62% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_unit.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_units.go index 63098600a977..7f23f0a778b8 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_unit.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_backup_units.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// BackupUnitApiService BackupUnitApi service -type BackupUnitApiService service +// BackupUnitsApiService BackupUnitsApi service +type BackupUnitsApiService service type ApiBackupunitsDeleteRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupunitId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + backupunitId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,46 @@ func (r ApiBackupunitsDeleteRequest) XContractNumber(xContractNumber int32) ApiB return r } -func (r ApiBackupunitsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiBackupunitsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.BackupunitsDeleteExecute(r) } /* - * BackupunitsDelete Delete a Backup Unit - * NOTE: Running through the deletion process will delete: - the backup plans inside the Backup Unit. - all backups associated with the Backup Unit. - the backup user and finally also the unit + * BackupunitsDelete Delete backup units + * Remove the specified backup unit. + +This process will delete: +1) The backup plans inside the backup unit +2) All backups, associated with this backup unit +3) The backup user +4) The backup unit itself * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param backupunitId The unique ID of the backup Unit + * @param backupunitId The unique ID of the backup unit. * @return ApiBackupunitsDeleteRequest - */ -func (a *BackupUnitApiService) BackupunitsDelete(ctx _context.Context, backupunitId string) ApiBackupunitsDeleteRequest { +*/ +func (a *BackupUnitsApiService) BackupunitsDelete(ctx _context.Context, backupunitId string) ApiBackupunitsDeleteRequest { return ApiBackupunitsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, backupunitId: backupunitId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *BackupUnitApiService) BackupunitsDeleteExecute(r ApiBackupunitsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsDeleteExecute(r ApiBackupunitsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/backupunits/{backupunitId}" @@ -95,10 +100,21 @@ func (a *BackupUnitApiService) BackupunitsDeleteExecute(r ApiBackupunitsDeleteRe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +151,55 @@ func (a *BackupUnitApiService) BackupunitsDeleteExecute(r ApiBackupunitsDeleteRe } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiBackupunitsFindByIdRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupunitId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + backupunitId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,16 +221,16 @@ func (r ApiBackupunitsFindByIdRequest) Execute() (BackupUnit, *APIResponse, erro } /* - * BackupunitsFindById Returns the specified backup Unit - * You can retrieve the details of an specific backup unit. + * BackupunitsFindById Retrieve backup units + * Retrieve the properties of the specified backup unit. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param backupunitId The unique ID of the backup unit + * @param backupunitId The unique ID of the backup unit. * @return ApiBackupunitsFindByIdRequest */ -func (a *BackupUnitApiService) BackupunitsFindById(ctx _context.Context, backupunitId string) ApiBackupunitsFindByIdRequest { +func (a *BackupUnitsApiService) BackupunitsFindById(ctx _context.Context, backupunitId string) ApiBackupunitsFindByIdRequest { return ApiBackupunitsFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, backupunitId: backupunitId, } } @@ -230,7 +239,7 @@ func (a *BackupUnitApiService) BackupunitsFindById(ctx _context.Context, backupu * Execute executes the request * @return BackupUnit */ -func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindByIdRequest) (BackupUnit, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindByIdRequest) (BackupUnit, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +249,7 @@ func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindBy localVarReturnValue BackupUnit ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +263,21 @@ func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindBy if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +317,14 @@ func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindBy return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +340,26 @@ func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindBy if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +368,13 @@ func (a *BackupUnitApiService) BackupunitsFindByIdExecute(r ApiBackupunitsFindBy } type ApiBackupunitsGetRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +391,40 @@ func (r ApiBackupunitsGetRequest) XContractNumber(xContractNumber int32) ApiBack return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiBackupunitsGetRequest) Filter(key string, value string) ApiBackupunitsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiBackupunitsGetRequest) OrderBy(orderBy string) ApiBackupunitsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiBackupunitsGetRequest) MaxResults(maxResults int32) ApiBackupunitsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiBackupunitsGetRequest) Execute() (BackupUnits, *APIResponse, error) { return r.ApiService.BackupunitsGetExecute(r) } /* - * BackupunitsGet List Backup Units - * You can retrieve a complete list of backup Units that you have access to. + * BackupunitsGet List backup units + * List all available backup units. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiBackupunitsGetRequest */ -func (a *BackupUnitApiService) BackupunitsGet(ctx _context.Context) ApiBackupunitsGetRequest { +func (a *BackupUnitsApiService) BackupunitsGet(ctx _context.Context) ApiBackupunitsGetRequest { return ApiBackupunitsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -386,7 +432,7 @@ func (a *BackupUnitApiService) BackupunitsGet(ctx _context.Context) ApiBackupuni * Execute executes the request * @return BackupUnits */ -func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) (BackupUnits, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) (BackupUnits, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -396,7 +442,7 @@ func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) localVarReturnValue BackupUnits ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -409,10 +455,34 @@ func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +522,14 @@ func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +545,26 @@ func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,17 +573,17 @@ func (a *BackupUnitApiService) BackupunitsGetExecute(r ApiBackupunitsGetRequest) } type ApiBackupunitsPatchRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupunitId string - backupUnitProperties *BackupUnitProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + backupunitId string + backupUnit *BackupUnitProperties + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiBackupunitsPatchRequest) BackupUnitProperties(backupUnitProperties BackupUnitProperties) ApiBackupunitsPatchRequest { - r.backupUnitProperties = &backupUnitProperties +func (r ApiBackupunitsPatchRequest) BackupUnit(backupUnit BackupUnitProperties) ApiBackupunitsPatchRequest { + r.backupUnit = &backupUnit return r } func (r ApiBackupunitsPatchRequest) Pretty(pretty bool) ApiBackupunitsPatchRequest { @@ -531,16 +604,16 @@ func (r ApiBackupunitsPatchRequest) Execute() (BackupUnit, *APIResponse, error) } /* - * BackupunitsPatch Partially modify a Backup Unit - * You can use update a backup Unit properties + * BackupunitsPatch Partially modify backup units + * Update the properties of the specified backup unit. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param backupunitId The unique ID of the backup unit + * @param backupunitId The unique ID of the backup unit. * @return ApiBackupunitsPatchRequest */ -func (a *BackupUnitApiService) BackupunitsPatch(ctx _context.Context, backupunitId string) ApiBackupunitsPatchRequest { +func (a *BackupUnitsApiService) BackupunitsPatch(ctx _context.Context, backupunitId string) ApiBackupunitsPatchRequest { return ApiBackupunitsPatchRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, backupunitId: backupunitId, } } @@ -549,7 +622,7 @@ func (a *BackupUnitApiService) BackupunitsPatch(ctx _context.Context, backupunit * Execute executes the request * @return BackupUnit */ -func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequest) (BackupUnit, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequest) (BackupUnit, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -559,7 +632,7 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ localVarReturnValue BackupUnit ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -570,16 +643,27 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.backupUnitProperties == nil { - return localVarReturnValue, nil, reportError("backupUnitProperties is required and must be specified") + if r.backupUnit == nil { + return localVarReturnValue, nil, reportError("backupUnit is required and must be specified") } if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -601,7 +685,7 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") } // body params - localVarPostBody = r.backupUnitProperties + localVarPostBody = r.backupUnit if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -621,13 +705,14 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +728,26 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,11 +756,11 @@ func (a *BackupUnitApiService) BackupunitsPatchExecute(r ApiBackupunitsPatchRequ } type ApiBackupunitsPostRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupUnit *BackupUnit - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + backupUnit *BackupUnit + pretty *bool + depth *int32 xContractNumber *int32 } @@ -699,15 +786,15 @@ func (r ApiBackupunitsPostRequest) Execute() (BackupUnit, *APIResponse, error) { } /* - * BackupunitsPost Create a Backup Unit - * Create a Backup Unit. A Backup Unit is considered a resource like a virtual datacenter, IP Block, snapshot, etc. It shall be shareable via groups inside our User Management Feature + * BackupunitsPost Create backup units + * Create a backup unit. Backup units are resources, same as storage volumes or snapshots; they can be shared through groups in User management. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiBackupunitsPostRequest */ -func (a *BackupUnitApiService) BackupunitsPost(ctx _context.Context) ApiBackupunitsPostRequest { +func (a *BackupUnitsApiService) BackupunitsPost(ctx _context.Context) ApiBackupunitsPostRequest { return ApiBackupunitsPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -715,7 +802,7 @@ func (a *BackupUnitApiService) BackupunitsPost(ctx _context.Context) ApiBackupun * Execute executes the request * @return BackupUnit */ -func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostRequest) (BackupUnit, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsPostExecute(r ApiBackupunitsPostRequest) (BackupUnit, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -725,7 +812,7 @@ func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostReques localVarReturnValue BackupUnit ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -741,10 +828,21 @@ func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostReques if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -786,13 +884,14 @@ func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostReques return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsPost", } if err != nil || localVarHTTPResponse == nil { @@ -808,24 +907,26 @@ func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostReques if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -834,12 +935,12 @@ func (a *BackupUnitApiService) BackupunitsPostExecute(r ApiBackupunitsPostReques } type ApiBackupunitsPutRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupunitId string - backupUnit *BackupUnit - pretty *bool - depth *int32 + ctx _context.Context + ApiService *BackupUnitsApiService + backupunitId string + backupUnit *BackupUnit + pretty *bool + depth *int32 xContractNumber *int32 } @@ -865,16 +966,16 @@ func (r ApiBackupunitsPutRequest) Execute() (BackupUnit, *APIResponse, error) { } /* - * BackupunitsPut Modify a Backup Unit - * You can use update a backup Unit properties + * BackupunitsPut Modify backup units + * Modify the properties of the specified backup unit. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param backupunitId The unique ID of the backup unit + * @param backupunitId The unique ID of the backup unit. * @return ApiBackupunitsPutRequest */ -func (a *BackupUnitApiService) BackupunitsPut(ctx _context.Context, backupunitId string) ApiBackupunitsPutRequest { +func (a *BackupUnitsApiService) BackupunitsPut(ctx _context.Context, backupunitId string) ApiBackupunitsPutRequest { return ApiBackupunitsPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, backupunitId: backupunitId, } } @@ -883,7 +984,7 @@ func (a *BackupUnitApiService) BackupunitsPut(ctx _context.Context, backupunitId * Execute executes the request * @return BackupUnit */ -func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) (BackupUnit, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) (BackupUnit, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -893,7 +994,7 @@ func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) localVarReturnValue BackupUnit ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -910,10 +1011,21 @@ func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -955,13 +1067,14 @@ func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsPut", } if err != nil || localVarHTTPResponse == nil { @@ -977,24 +1090,26 @@ func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1003,10 +1118,13 @@ func (a *BackupUnitApiService) BackupunitsPutExecute(r ApiBackupunitsPutRequest) } type ApiBackupunitsSsourlGetRequest struct { - ctx _context.Context - ApiService *BackupUnitApiService - backupunitId string - pretty *bool + ctx _context.Context + ApiService *BackupUnitsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + backupunitId string + pretty *bool xContractNumber *int32 } @@ -1019,22 +1137,42 @@ func (r ApiBackupunitsSsourlGetRequest) XContractNumber(xContractNumber int32) A return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiBackupunitsSsourlGetRequest) Filter(key string, value string) ApiBackupunitsSsourlGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiBackupunitsSsourlGetRequest) OrderBy(orderBy string) ApiBackupunitsSsourlGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiBackupunitsSsourlGetRequest) MaxResults(maxResults int32) ApiBackupunitsSsourlGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiBackupunitsSsourlGetRequest) Execute() (BackupUnitSSO, *APIResponse, error) { return r.ApiService.BackupunitsSsourlGetExecute(r) } /* - * BackupunitsSsourlGet Returns a single signon URL for the specified backup Unit. - * Returns a single signon URL for the specified backup Unit. + * BackupunitsSsourlGet Retrieve BU single sign-on URLs + * Retrieve a single sign-on URL for the specified backup unit. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param backupunitId The unique UUID of the backup unit + * @param backupunitId The unique ID of the backup unit. * @return ApiBackupunitsSsourlGetRequest */ -func (a *BackupUnitApiService) BackupunitsSsourlGet(ctx _context.Context, backupunitId string) ApiBackupunitsSsourlGetRequest { +func (a *BackupUnitsApiService) BackupunitsSsourlGet(ctx _context.Context, backupunitId string) ApiBackupunitsSsourlGetRequest { return ApiBackupunitsSsourlGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, backupunitId: backupunitId, + filters: _neturl.Values{}, } } @@ -1042,7 +1180,7 @@ func (a *BackupUnitApiService) BackupunitsSsourlGet(ctx _context.Context, backup * Execute executes the request * @return BackupUnitSSO */ -func (a *BackupUnitApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsourlGetRequest) (BackupUnitSSO, *APIResponse, error) { +func (a *BackupUnitsApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsourlGetRequest) (BackupUnitSSO, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1052,7 +1190,7 @@ func (a *BackupUnitApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsour localVarReturnValue BackupUnitSSO ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitApiService.BackupunitsSsourlGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackupUnitsApiService.BackupunitsSsourlGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1066,7 +1204,26 @@ func (a *BackupUnitApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsour if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1106,13 +1263,14 @@ func (a *BackupUnitApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsour return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "BackupunitsSsourlGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "BackupunitsSsourlGet", } if err != nil || localVarHTTPResponse == nil { @@ -1128,24 +1286,26 @@ func (a *BackupUnitApiService) BackupunitsSsourlGetExecute(r ApiBackupunitsSsour if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract_resources.go similarity index 51% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract_resources.go index 5d1ad332f4b3..29b31390a035 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_contract_resources.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -22,14 +23,17 @@ var ( _ _context.Context ) -// ContractApiService ContractApi service -type ContractApiService service +// ContractResourcesApiService ContractResourcesApi service +type ContractResourcesApiService service type ApiContractsGetRequest struct { - ctx _context.Context - ApiService *ContractApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ContractResourcesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -46,38 +50,58 @@ func (r ApiContractsGetRequest) XContractNumber(xContractNumber int32) ApiContra return r } -func (r ApiContractsGetRequest) Execute() (Contract, *APIResponse, error) { +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiContractsGetRequest) Filter(key string, value string) ApiContractsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiContractsGetRequest) OrderBy(orderBy string) ApiContractsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiContractsGetRequest) MaxResults(maxResults int32) ApiContractsGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiContractsGetRequest) Execute() (Contracts, *APIResponse, error) { return r.ApiService.ContractsGetExecute(r) } /* - * ContractsGet Retrieve a Contract - * Retrieves the attributes of user's contract. + * ContractsGet Retrieve contracts + * Retrieve the properties of the user's contract. In this version, the resource became a collection. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiContractsGetRequest */ -func (a *ContractApiService) ContractsGet(ctx _context.Context) ApiContractsGetRequest { +func (a *ContractResourcesApiService) ContractsGet(ctx _context.Context) ApiContractsGetRequest { return ApiContractsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } /* * Execute executes the request - * @return Contract + * @return Contracts */ -func (a *ContractApiService) ContractsGetExecute(r ApiContractsGetRequest) (Contract, *APIResponse, error) { +func (a *ContractResourcesApiService) ContractsGetExecute(r ApiContractsGetRequest) (Contracts, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue Contract + localVarReturnValue Contracts ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ContractApiService.ContractsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ContractResourcesApiService.ContractsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -90,10 +114,34 @@ func (a *ContractApiService) ContractsGetExecute(r ApiContractsGetRequest) (Cont if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -133,13 +181,14 @@ func (a *ContractApiService) ContractsGetExecute(r ApiContractsGetRequest) (Cont return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ContractsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ContractsGet", } if err != nil || localVarHTTPResponse == nil { @@ -155,24 +204,26 @@ func (a *ContractApiService) ContractsGetExecute(r ApiContractsGetRequest) (Cont if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_center.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_centers.go similarity index 62% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_center.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_centers.go index 67138e907e25..3c797ae2e881 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_center.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_data_centers.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// DataCenterApiService DataCenterApi service -type DataCenterApiService service +// DataCentersApiService DataCentersApi service +type DataCentersApiService service type ApiDatacentersDeleteRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiDatacentersDeleteRequest) XContractNumber(xContractNumber int32) ApiD return r } -func (r ApiDatacentersDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersDeleteExecute(r) } /* - * DatacentersDelete Delete a Data Center - * Will remove all objects within the datacenter and remove the datacenter object itself, too. This is a highly destructive method which should be used with caution + * DatacentersDelete Delete data centers + * Delete the specified data center and all the elements it contains. This method is destructive and should be used carefully. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersDeleteRequest */ -func (a *DataCenterApiService) DatacentersDelete(ctx _context.Context, datacenterId string) ApiDatacentersDeleteRequest { +func (a *DataCentersApiService) DatacentersDelete(ctx _context.Context, datacenterId string) ApiDatacentersDeleteRequest { return ApiDatacentersDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *DataCenterApiService) DatacentersDeleteExecute(r ApiDatacentersDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersDeleteExecute(r ApiDatacentersDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}" @@ -95,10 +94,21 @@ func (a *DataCenterApiService) DatacentersDeleteExecute(r ApiDatacentersDeleteRe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *DataCenterApiService) DatacentersDeleteExecute(r ApiDatacentersDeleteRe } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersFindByIdRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,16 +215,16 @@ func (r ApiDatacentersFindByIdRequest) Execute() (Datacenter, *APIResponse, erro } /* - * DatacentersFindById Retrieve a Data Center - * You can retrieve a data center by using the resource's ID. This value can be found in the response body when a datacenter is created or when you GET a list of datacenters. + * DatacentersFindById Retrieve data centers + * Retrieve data centers by resource ID. This value is in the response body when the data center is created, and in the list of the data centers, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersFindByIdRequest */ -func (a *DataCenterApiService) DatacentersFindById(ctx _context.Context, datacenterId string) ApiDatacentersFindByIdRequest { +func (a *DataCentersApiService) DatacentersFindById(ctx _context.Context, datacenterId string) ApiDatacentersFindByIdRequest { return ApiDatacentersFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -230,7 +233,7 @@ func (a *DataCenterApiService) DatacentersFindById(ctx _context.Context, datacen * Execute executes the request * @return Datacenter */ -func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindByIdRequest) (Datacenter, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersFindByIdExecute(r ApiDatacentersFindByIdRequest) (Datacenter, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +243,7 @@ func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindBy localVarReturnValue Datacenter ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +257,21 @@ func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindBy if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindBy return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindBy if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,11 +362,16 @@ func (a *DataCenterApiService) DatacentersFindByIdExecute(r ApiDatacentersFindBy } type ApiDatacentersGetRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersGetRequest) Pretty(pretty bool) ApiDatacentersGetRequest { @@ -364,21 +386,49 @@ func (r ApiDatacentersGetRequest) XContractNumber(xContractNumber int32) ApiData r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersGetRequest) Offset(offset int32) ApiDatacentersGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersGetRequest) Limit(limit int32) ApiDatacentersGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersGetRequest) Filter(key string, value string) ApiDatacentersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersGetRequest) OrderBy(orderBy string) ApiDatacentersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersGetRequest) MaxResults(maxResults int32) ApiDatacentersGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersGetRequest) Execute() (Datacenters, *APIResponse, error) { return r.ApiService.DatacentersGetExecute(r) } /* - * DatacentersGet List Data Centers under your account - * You can retrieve a complete list of data centers provisioned under your account + * DatacentersGet List your data centers + * List the data centers for your account. Default limit is the first 100 items; use pagination query parameters for listing more items. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiDatacentersGetRequest */ -func (a *DataCenterApiService) DatacentersGet(ctx _context.Context) ApiDatacentersGetRequest { +func (a *DataCentersApiService) DatacentersGet(ctx _context.Context) ApiDatacentersGetRequest { return ApiDatacentersGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -386,7 +436,7 @@ func (a *DataCenterApiService) DatacentersGet(ctx _context.Context) ApiDatacente * Execute executes the request * @return Datacenters */ -func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) (Datacenters, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) (Datacenters, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -396,7 +446,7 @@ func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) localVarReturnValue Datacenters ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -409,10 +459,50 @@ func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +542,14 @@ func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +565,26 @@ func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,12 +593,12 @@ func (a *DataCenterApiService) DatacentersGetExecute(r ApiDatacentersGetRequest) } type ApiDatacentersPatchRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - datacenterId string - datacenter *DatacenterProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + datacenterId string + datacenter *DatacenterProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -531,16 +624,16 @@ func (r ApiDatacentersPatchRequest) Execute() (Datacenter, *APIResponse, error) } /* - * DatacentersPatch Partially modify a Data Center - * You can use update datacenter to re-name the datacenter or update its description + * DatacentersPatch Partially modify data centers + * Update the properties of the specified data center, rename it, or change the description. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersPatchRequest */ -func (a *DataCenterApiService) DatacentersPatch(ctx _context.Context, datacenterId string) ApiDatacentersPatchRequest { +func (a *DataCentersApiService) DatacentersPatch(ctx _context.Context, datacenterId string) ApiDatacentersPatchRequest { return ApiDatacentersPatchRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -549,7 +642,7 @@ func (a *DataCenterApiService) DatacentersPatch(ctx _context.Context, datacenter * Execute executes the request * @return Datacenter */ -func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequest) (Datacenter, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequest) (Datacenter, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -559,7 +652,7 @@ func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequ localVarReturnValue Datacenter ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -576,10 +669,21 @@ func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -621,13 +725,14 @@ func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +748,26 @@ func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,11 +776,11 @@ func (a *DataCenterApiService) DatacentersPatchExecute(r ApiDatacentersPatchRequ } type ApiDatacentersPostRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - datacenter *Datacenter - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + datacenter *Datacenter + pretty *bool + depth *int32 xContractNumber *int32 } @@ -699,15 +806,17 @@ func (r ApiDatacentersPostRequest) Execute() (Datacenter, *APIResponse, error) { } /* - * DatacentersPost Create a Data Center - * Virtual data centers are the foundation of the platform. They act as logical containers for all other objects you will be creating, e.g. servers. You can provision as many data centers as you want. Datacenters have their own private network and are logically segmented from each other to create isolation. You can use this POST method to create a simple datacenter or to create a datacenter with multiple objects under it such as servers and storage volumes. + * DatacentersPost Create data centers + * Create new data centers, and data centers that already contain elements, such as servers and storage volumes. + +Virtual data centers are the foundation of the platform; they act as logical containers for all other objects you create, such as servers and storage volumes. You can provision as many data centers as needed. Data centers have their own private networks and are logically segmented from each other to create isolation. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiDatacentersPostRequest - */ -func (a *DataCenterApiService) DatacentersPost(ctx _context.Context) ApiDatacentersPostRequest { +*/ +func (a *DataCentersApiService) DatacentersPost(ctx _context.Context) ApiDatacentersPostRequest { return ApiDatacentersPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -715,7 +824,7 @@ func (a *DataCenterApiService) DatacentersPost(ctx _context.Context) ApiDatacent * Execute executes the request * @return Datacenter */ -func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostRequest) (Datacenter, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersPostExecute(r ApiDatacentersPostRequest) (Datacenter, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -725,7 +834,7 @@ func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostReques localVarReturnValue Datacenter ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -741,10 +850,21 @@ func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostReques if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -786,13 +906,14 @@ func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostReques return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersPost", } if err != nil || localVarHTTPResponse == nil { @@ -808,24 +929,26 @@ func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostReques if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -834,12 +957,12 @@ func (a *DataCenterApiService) DatacentersPostExecute(r ApiDatacentersPostReques } type ApiDatacentersPutRequest struct { - ctx _context.Context - ApiService *DataCenterApiService - datacenterId string - datacenter *Datacenter - pretty *bool - depth *int32 + ctx _context.Context + ApiService *DataCentersApiService + datacenterId string + datacenter *Datacenter + pretty *bool + depth *int32 xContractNumber *int32 } @@ -865,16 +988,16 @@ func (r ApiDatacentersPutRequest) Execute() (Datacenter, *APIResponse, error) { } /* - * DatacentersPut Modify a Data Center - * You can use update datacenter to re-name the datacenter or update its description + * DatacentersPut Modify data centers + * Modify the properties of the specified data center, rename it, or change the description. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersPutRequest */ -func (a *DataCenterApiService) DatacentersPut(ctx _context.Context, datacenterId string) ApiDatacentersPutRequest { +func (a *DataCentersApiService) DatacentersPut(ctx _context.Context, datacenterId string) ApiDatacentersPutRequest { return ApiDatacentersPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -883,7 +1006,7 @@ func (a *DataCenterApiService) DatacentersPut(ctx _context.Context, datacenterId * Execute executes the request * @return Datacenter */ -func (a *DataCenterApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) (Datacenter, *APIResponse, error) { +func (a *DataCentersApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) (Datacenter, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -893,7 +1016,7 @@ func (a *DataCenterApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) localVarReturnValue Datacenter ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCenterApiService.DatacentersPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataCentersApiService.DatacentersPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -910,10 +1033,21 @@ func (a *DataCenterApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -955,13 +1089,14 @@ func (a *DataCenterApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersPut", } if err != nil || localVarHTTPResponse == nil { @@ -977,24 +1112,26 @@ func (a *DataCenterApiService) DatacentersPutExecute(r ApiDatacentersPutRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_firewall_rules.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_firewall_rules.go new file mode 100644 index 000000000000..d6989cdef7c0 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_firewall_rules.go @@ -0,0 +1,1210 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// FirewallRulesApiService FirewallRulesApi service +type FirewallRulesApiService service + +type ApiDatacentersServersNicsFirewallrulesDeleteRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + datacenterId string + serverId string + nicId string + firewallruleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesDeleteExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesDelete Delete firewall rules + * Delete the specified firewall rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param firewallruleId The unique ID of the firewall rule. + * @return ApiDatacentersServersNicsFirewallrulesDeleteRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesDelete(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesDeleteRequest { + return ApiDatacentersServersNicsFirewallrulesDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + firewallruleId: firewallruleId, + } +} + +/* + * Execute executes the request + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesDeleteExecute(r ApiDatacentersServersNicsFirewallrulesDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFirewallrulesFindByIdRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + datacenterId string + serverId string + nicId string + firewallruleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Execute() (FirewallRule, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesFindByIdExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesFindById Retrieve firewall rules + * Retrieve the properties of the specified firewall rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param firewallruleId The unique ID of the firewall rule. + * @return ApiDatacentersServersNicsFirewallrulesFindByIdRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesFindById(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { + return ApiDatacentersServersNicsFirewallrulesFindByIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + firewallruleId: firewallruleId, + } +} + +/* + * Execute executes the request + * @return FirewallRule + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesFindByIdExecute(r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) (FirewallRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FirewallRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFirewallrulesGetRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + nicId string + pretty *bool + depth *int32 + xContractNumber *int32 + offset *int32 + limit *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.xContractNumber = &xContractNumber + return r +} +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Offset(offset int32) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Limit(limit int32) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Filter(key string, value string) ApiDatacentersServersNicsFirewallrulesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) OrderBy(orderBy string) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) MaxResults(maxResults int32) ApiDatacentersServersNicsFirewallrulesGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Execute() (FirewallRules, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesGetExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesGet List firewall rules + * List all firewall rules for the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsFirewallrulesGetRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesGet(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFirewallrulesGetRequest { + return ApiDatacentersServersNicsFirewallrulesGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return FirewallRules + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesGetExecute(r ApiDatacentersServersNicsFirewallrulesGetRequest) (FirewallRules, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FirewallRules + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFirewallrulesPatchRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + datacenterId string + serverId string + nicId string + firewallruleId string + firewallrule *FirewallruleProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Firewallrule(firewallrule FirewallruleProperties) ApiDatacentersServersNicsFirewallrulesPatchRequest { + r.firewallrule = &firewallrule + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Execute() (FirewallRule, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesPatchExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesPatch Partially modify firewall rules + * Update the properties of the specified firewall rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param firewallruleId The unique ID of the firewall rule. + * @return ApiDatacentersServersNicsFirewallrulesPatchRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPatch(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesPatchRequest { + return ApiDatacentersServersNicsFirewallrulesPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + firewallruleId: firewallruleId, + } +} + +/* + * Execute executes the request + * @return FirewallRule + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPatchExecute(r ApiDatacentersServersNicsFirewallrulesPatchRequest) (FirewallRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FirewallRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.firewallrule == nil { + return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.firewallrule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFirewallrulesPostRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + datacenterId string + serverId string + nicId string + firewallrule *FirewallRule + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Firewallrule(firewallrule FirewallRule) ApiDatacentersServersNicsFirewallrulesPostRequest { + r.firewallrule = &firewallrule + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Execute() (FirewallRule, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesPostExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesPost Create firewall rules + * Create a firewall rule for the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsFirewallrulesPostRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPost(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFirewallrulesPostRequest { + return ApiDatacentersServersNicsFirewallrulesPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + * @return FirewallRule + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPostExecute(r ApiDatacentersServersNicsFirewallrulesPostRequest) (FirewallRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FirewallRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.firewallrule == nil { + return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.firewallrule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFirewallrulesPutRequest struct { + ctx _context.Context + ApiService *FirewallRulesApiService + datacenterId string + serverId string + nicId string + firewallruleId string + firewallrule *FirewallRule + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Firewallrule(firewallrule FirewallRule) ApiDatacentersServersNicsFirewallrulesPutRequest { + r.firewallrule = &firewallrule + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFirewallrulesPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Execute() (FirewallRule, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFirewallrulesPutExecute(r) +} + +/* + * DatacentersServersNicsFirewallrulesPut Modify firewall rules + * Modify the properties of the specified firewall rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param firewallruleId The unique ID of the firewall rule. + * @return ApiDatacentersServersNicsFirewallrulesPutRequest + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPut(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesPutRequest { + return ApiDatacentersServersNicsFirewallrulesPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + firewallruleId: firewallruleId, + } +} + +/* + * Execute executes the request + * @return FirewallRule + */ +func (a *FirewallRulesApiService) DatacentersServersNicsFirewallrulesPutExecute(r ApiDatacentersServersNicsFirewallrulesPutRequest) (FirewallRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FirewallRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirewallRulesApiService.DatacentersServersNicsFirewallrulesPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.firewallrule == nil { + return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.firewallrule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFirewallrulesPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_flow_logs.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_flow_logs.go new file mode 100644 index 000000000000..e4cf682dc1d6 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_flow_logs.go @@ -0,0 +1,1162 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// FlowLogsApiService FlowLogsApi service +type FlowLogsApiService service + +type ApiDatacentersServersNicsFlowlogsDeleteRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + datacenterId string + serverId string + nicId string + flowlogId string + pretty *bool + depth *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsDeleteRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsDeleteRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsDeleteRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersServersNicsFlowlogsDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsDeleteExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsDelete Delete Flow Logs + * Delete the specified Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param flowlogId The unique ID of the Flow Log. + * @return ApiDatacentersServersNicsFlowlogsDeleteRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsDelete(ctx _context.Context, datacenterId string, serverId string, nicId string, flowlogId string) ApiDatacentersServersNicsFlowlogsDeleteRequest { + return ApiDatacentersServersNicsFlowlogsDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + flowlogId: flowlogId, + } +} + +/* + * Execute executes the request + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsDeleteExecute(r ApiDatacentersServersNicsFlowlogsDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs/{flowlogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowlogId"+"}", _neturl.PathEscape(parameterToString(r.flowlogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFlowlogsFindByIdRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + datacenterId string + serverId string + nicId string + flowlogId string + pretty *bool + depth *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsFindByIdRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsFindByIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsFindByIdRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsFindByIdRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersServersNicsFlowlogsFindByIdRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsFindByIdExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsFindById Retrieve Flow Logs + * Retrieve the properties of the specified Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param flowlogId The unique ID of the Flow Log. + * @return ApiDatacentersServersNicsFlowlogsFindByIdRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsFindById(ctx _context.Context, datacenterId string, serverId string, nicId string, flowlogId string) ApiDatacentersServersNicsFlowlogsFindByIdRequest { + return ApiDatacentersServersNicsFlowlogsFindByIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + flowlogId: flowlogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsFindByIdExecute(r ApiDatacentersServersNicsFlowlogsFindByIdRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs/{flowlogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowlogId"+"}", _neturl.PathEscape(parameterToString(r.flowlogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFlowlogsGetRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + nicId string + pretty *bool + depth *int32 + offset *int32 + limit *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Offset(offset int32) ApiDatacentersServersNicsFlowlogsGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Limit(limit int32) ApiDatacentersServersNicsFlowlogsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Filter(key string, value string) ApiDatacentersServersNicsFlowlogsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersNicsFlowlogsGetRequest) OrderBy(orderBy string) ApiDatacentersServersNicsFlowlogsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersNicsFlowlogsGetRequest) MaxResults(maxResults int32) ApiDatacentersServersNicsFlowlogsGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersServersNicsFlowlogsGetRequest) Execute() (FlowLogs, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsGetExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsGet List Flow Logs + * List all the Flow Logs for the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsFlowlogsGetRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsGet(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFlowlogsGetRequest { + return ApiDatacentersServersNicsFlowlogsGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return FlowLogs + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsGetExecute(r ApiDatacentersServersNicsFlowlogsGetRequest) (FlowLogs, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLogs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFlowlogsPatchRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + datacenterId string + serverId string + nicId string + flowlogId string + flowlog *FlowLogProperties + pretty *bool + depth *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsPatchRequest) Flowlog(flowlog FlowLogProperties) ApiDatacentersServersNicsFlowlogsPatchRequest { + r.flowlog = &flowlog + return r +} +func (r ApiDatacentersServersNicsFlowlogsPatchRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsPatchRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsPatchRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersServersNicsFlowlogsPatchRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsPatchExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsPatch Partially modify Flow Logs + * Update the specified Flow Log record. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param flowlogId The unique ID of the Flow Log. + * @return ApiDatacentersServersNicsFlowlogsPatchRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPatch(ctx _context.Context, datacenterId string, serverId string, nicId string, flowlogId string) ApiDatacentersServersNicsFlowlogsPatchRequest { + return ApiDatacentersServersNicsFlowlogsPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + flowlogId: flowlogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPatchExecute(r ApiDatacentersServersNicsFlowlogsPatchRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs/{flowlogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowlogId"+"}", _neturl.PathEscape(parameterToString(r.flowlogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.flowlog == nil { + return localVarReturnValue, nil, reportError("flowlog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowlog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFlowlogsPostRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + datacenterId string + serverId string + nicId string + flowlog *FlowLog + pretty *bool + depth *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsPostRequest) Flowlog(flowlog FlowLog) ApiDatacentersServersNicsFlowlogsPostRequest { + r.flowlog = &flowlog + return r +} +func (r ApiDatacentersServersNicsFlowlogsPostRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsPostRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsPostRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersServersNicsFlowlogsPostRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsPostExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsPost Create Flow Logs + * Add a new Flow Log for the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsFlowlogsPostRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPost(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFlowlogsPostRequest { + return ApiDatacentersServersNicsFlowlogsPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPostExecute(r ApiDatacentersServersNicsFlowlogsPostRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.flowlog == nil { + return localVarReturnValue, nil, reportError("flowlog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowlog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFlowlogsPutRequest struct { + ctx _context.Context + ApiService *FlowLogsApiService + datacenterId string + serverId string + nicId string + flowlogId string + flowlog *FlowLogPut + pretty *bool + depth *int32 +} + +func (r ApiDatacentersServersNicsFlowlogsPutRequest) Flowlog(flowlog FlowLogPut) ApiDatacentersServersNicsFlowlogsPutRequest { + r.flowlog = &flowlog + return r +} +func (r ApiDatacentersServersNicsFlowlogsPutRequest) Pretty(pretty bool) ApiDatacentersServersNicsFlowlogsPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFlowlogsPutRequest) Depth(depth int32) ApiDatacentersServersNicsFlowlogsPutRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersServersNicsFlowlogsPutRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFlowlogsPutExecute(r) +} + +/* + * DatacentersServersNicsFlowlogsPut Modify Flow Logs + * Modify the specified Flow Log record. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @param flowlogId The unique ID of the Flow Log. + * @return ApiDatacentersServersNicsFlowlogsPutRequest + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPut(ctx _context.Context, datacenterId string, serverId string, nicId string, flowlogId string) ApiDatacentersServersNicsFlowlogsPutRequest { + return ApiDatacentersServersNicsFlowlogsPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + flowlogId: flowlogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *FlowLogsApiService) DatacentersServersNicsFlowlogsPutExecute(r ApiDatacentersServersNicsFlowlogsPutRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowLogsApiService.DatacentersServersNicsFlowlogsPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/flowlogs/{flowlogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowlogId"+"}", _neturl.PathEscape(parameterToString(r.flowlogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.flowlog == nil { + return localVarReturnValue, nil, reportError("flowlog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowlog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFlowlogsPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_image.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_images.go similarity index 64% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_image.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_images.go index 48d6def5d090..1c291fe309d2 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_image.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_images.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// ImageApiService ImageApi service -type ImageApiService service +// ImagesApiService ImagesApi service +type ImagesApiService service type ApiImagesDeleteRequest struct { - ctx _context.Context - ApiService *ImageApiService - imageId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ImagesApiService + imageId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiImagesDeleteRequest) XContractNumber(xContractNumber int32) ApiImages return r } -func (r ApiImagesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiImagesDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.ImagesDeleteExecute(r) } /* - * ImagesDelete Delete an Image - * Deletes the specified image. This operation is permitted on private image only. + * ImagesDelete Delete images + * Delete the specified image; this operation is only supported for private images. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId + * @param imageId The unique ID of the image. * @return ApiImagesDeleteRequest */ -func (a *ImageApiService) ImagesDelete(ctx _context.Context, imageId string) ApiImagesDeleteRequest { +func (a *ImagesApiService) ImagesDelete(ctx _context.Context, imageId string) ApiImagesDeleteRequest { return ApiImagesDeleteRequest{ ApiService: a, - ctx: ctx, - imageId: imageId, + ctx: ctx, + imageId: imageId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ImageApiService) ImagesDeleteExecute(r ApiImagesDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ImagesApiService) ImagesDeleteExecute(r ApiImagesDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImageApiService.ImagesDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ImagesDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/images/{imageId}" @@ -95,10 +94,21 @@ func (a *ImageApiService) ImagesDeleteExecute(r ApiImagesDeleteRequest) (map[str if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *ImageApiService) ImagesDeleteExecute(r ApiImagesDeleteRequest) (map[str } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ImagesDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ImagesDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiImagesFindByIdRequest struct { - ctx _context.Context - ApiService *ImageApiService - imageId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ImagesApiService + imageId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,17 +215,17 @@ func (r ApiImagesFindByIdRequest) Execute() (Image, *APIResponse, error) { } /* - * ImagesFindById Retrieve an Image - * Retrieves the attributes of a given image. + * ImagesFindById Retrieve images + * Retrieve the properties of the specified image. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId + * @param imageId The unique ID of the image. * @return ApiImagesFindByIdRequest */ -func (a *ImageApiService) ImagesFindById(ctx _context.Context, imageId string) ApiImagesFindByIdRequest { +func (a *ImagesApiService) ImagesFindById(ctx _context.Context, imageId string) ApiImagesFindByIdRequest { return ApiImagesFindByIdRequest{ ApiService: a, - ctx: ctx, - imageId: imageId, + ctx: ctx, + imageId: imageId, } } @@ -230,7 +233,7 @@ func (a *ImageApiService) ImagesFindById(ctx _context.Context, imageId string) A * Execute executes the request * @return Image */ -func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Image, *APIResponse, error) { +func (a *ImagesApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Image, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +243,7 @@ func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Ima localVarReturnValue Image ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImageApiService.ImagesFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ImagesFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +257,21 @@ func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Ima if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Ima return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ImagesFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ImagesFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Ima if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +362,13 @@ func (a *ImageApiService) ImagesFindByIdExecute(r ApiImagesFindByIdRequest) (Ima } type ApiImagesGetRequest struct { - ctx _context.Context - ApiService *ImageApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ImagesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +385,40 @@ func (r ApiImagesGetRequest) XContractNumber(xContractNumber int32) ApiImagesGet return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiImagesGetRequest) Filter(key string, value string) ApiImagesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiImagesGetRequest) OrderBy(orderBy string) ApiImagesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiImagesGetRequest) MaxResults(maxResults int32) ApiImagesGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiImagesGetRequest) Execute() (Images, *APIResponse, error) { return r.ApiService.ImagesGetExecute(r) } /* - * ImagesGet List Images - * Retrieve a list of images within the datacenter + * ImagesGet List images + * List all the images within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiImagesGetRequest */ -func (a *ImageApiService) ImagesGet(ctx _context.Context) ApiImagesGetRequest { +func (a *ImagesApiService) ImagesGet(ctx _context.Context) ApiImagesGetRequest { return ApiImagesGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -386,7 +426,7 @@ func (a *ImageApiService) ImagesGet(ctx _context.Context) ApiImagesGetRequest { * Execute executes the request * @return Images */ -func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIResponse, error) { +func (a *ImagesApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -396,7 +436,7 @@ func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIR localVarReturnValue Images ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImageApiService.ImagesGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ImagesGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -409,10 +449,34 @@ func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +516,14 @@ func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIR return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ImagesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ImagesGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +539,26 @@ func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIR if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,12 +567,12 @@ func (a *ImageApiService) ImagesGetExecute(r ApiImagesGetRequest) (Images, *APIR } type ApiImagesPatchRequest struct { - ctx _context.Context - ApiService *ImageApiService - imageId string - image *ImageProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ImagesApiService + imageId string + image *ImageProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -531,17 +598,17 @@ func (r ApiImagesPatchRequest) Execute() (Image, *APIResponse, error) { } /* - * ImagesPatch Partially modify an Image - * You can use update attributes of a resource + * ImagesPatch Partially modify images + * Update the properties of the specified image. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId + * @param imageId The unique ID of the image. * @return ApiImagesPatchRequest */ -func (a *ImageApiService) ImagesPatch(ctx _context.Context, imageId string) ApiImagesPatchRequest { +func (a *ImagesApiService) ImagesPatch(ctx _context.Context, imageId string) ApiImagesPatchRequest { return ApiImagesPatchRequest{ ApiService: a, - ctx: ctx, - imageId: imageId, + ctx: ctx, + imageId: imageId, } } @@ -549,7 +616,7 @@ func (a *ImageApiService) ImagesPatch(ctx _context.Context, imageId string) ApiI * Execute executes the request * @return Image */ -func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *APIResponse, error) { +func (a *ImagesApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -559,7 +626,7 @@ func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *A localVarReturnValue Image ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImageApiService.ImagesPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ImagesPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -576,10 +643,21 @@ func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *A if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -621,13 +699,14 @@ func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *A return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ImagesPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ImagesPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +722,26 @@ func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *A if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,12 +750,12 @@ func (a *ImageApiService) ImagesPatchExecute(r ApiImagesPatchRequest) (Image, *A } type ApiImagesPutRequest struct { - ctx _context.Context - ApiService *ImageApiService - imageId string - image *Image - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ImagesApiService + imageId string + image *Image + pretty *bool + depth *int32 xContractNumber *int32 } @@ -700,17 +781,17 @@ func (r ApiImagesPutRequest) Execute() (Image, *APIResponse, error) { } /* - * ImagesPut Modify an Image - * You can use update attributes of a resource + * ImagesPut Modify images + * Modify the properties of the specified image. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param imageId + * @param imageId The unique ID of the image. * @return ApiImagesPutRequest */ -func (a *ImageApiService) ImagesPut(ctx _context.Context, imageId string) ApiImagesPutRequest { +func (a *ImagesApiService) ImagesPut(ctx _context.Context, imageId string) ApiImagesPutRequest { return ApiImagesPutRequest{ ApiService: a, - ctx: ctx, - imageId: imageId, + ctx: ctx, + imageId: imageId, } } @@ -718,7 +799,7 @@ func (a *ImageApiService) ImagesPut(ctx _context.Context, imageId string) ApiIma * Execute executes the request * @return Image */ -func (a *ImageApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIResponse, error) { +func (a *ImagesApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -728,7 +809,7 @@ func (a *ImageApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIRe localVarReturnValue Image ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImageApiService.ImagesPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImagesApiService.ImagesPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -745,10 +826,21 @@ func (a *ImageApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIRe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -790,13 +882,14 @@ func (a *ImageApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIRe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "ImagesPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "ImagesPut", } if err != nil || localVarHTTPResponse == nil { @@ -812,24 +905,26 @@ func (a *ImageApiService) ImagesPutExecute(r ApiImagesPutRequest) (Image, *APIRe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_ip_blocks.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_ip_blocks.go index 74b49c832541..211cc0b7626a 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_ip_blocks.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_ip_blocks.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -27,11 +28,11 @@ var ( type IPBlocksApiService service type ApiIpblocksDeleteRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - ipblockId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + ipblockId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiIpblocksDeleteRequest) XContractNumber(xContractNumber int32) ApiIpbl return r } -func (r ApiIpblocksDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiIpblocksDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.IpblocksDeleteExecute(r) } /* - * IpblocksDelete Delete IP Block - * Removes the specific IP Block + * IpblocksDelete Delete IP blocks + * Remove the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksDeleteRequest */ func (a *IPBlocksApiService) IpblocksDelete(ctx _context.Context, ipblockId string) ApiIpblocksDeleteRequest { return ApiIpblocksDeleteRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *IPBlocksApiService) IpblocksDeleteExecute(r ApiIpblocksDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *IPBlocksApiService) IpblocksDeleteExecute(r ApiIpblocksDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPBlocksApiService.IpblocksDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ipblocks/{ipblockId}" @@ -95,10 +94,21 @@ func (a *IPBlocksApiService) IpblocksDeleteExecute(r ApiIpblocksDeleteRequest) ( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *IPBlocksApiService) IpblocksDeleteExecute(r ApiIpblocksDeleteRequest) ( } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiIpblocksFindByIdRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - ipblockId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + ipblockId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,17 +215,17 @@ func (r ApiIpblocksFindByIdRequest) Execute() (IpBlock, *APIResponse, error) { } /* - * IpblocksFindById Retrieve an IP Block - * Retrieves the attributes of a given IP Block. + * IpblocksFindById Retrieve IP blocks + * Retrieve the properties of the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksFindByIdRequest */ func (a *IPBlocksApiService) IpblocksFindById(ctx _context.Context, ipblockId string) ApiIpblocksFindByIdRequest { return ApiIpblocksFindByIdRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, } } @@ -254,10 +257,21 @@ func (a *IPBlocksApiService) IpblocksFindByIdExecute(r ApiIpblocksFindByIdReques if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *IPBlocksApiService) IpblocksFindByIdExecute(r ApiIpblocksFindByIdReques return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *IPBlocksApiService) IpblocksFindByIdExecute(r ApiIpblocksFindByIdReques if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,11 +362,16 @@ func (a *IPBlocksApiService) IpblocksFindByIdExecute(r ApiIpblocksFindByIdReques } type ApiIpblocksGetRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiIpblocksGetRequest) Pretty(pretty bool) ApiIpblocksGetRequest { @@ -364,21 +386,49 @@ func (r ApiIpblocksGetRequest) XContractNumber(xContractNumber int32) ApiIpblock r.xContractNumber = &xContractNumber return r } +func (r ApiIpblocksGetRequest) Offset(offset int32) ApiIpblocksGetRequest { + r.offset = &offset + return r +} +func (r ApiIpblocksGetRequest) Limit(limit int32) ApiIpblocksGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiIpblocksGetRequest) Filter(key string, value string) ApiIpblocksGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiIpblocksGetRequest) OrderBy(orderBy string) ApiIpblocksGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiIpblocksGetRequest) MaxResults(maxResults int32) ApiIpblocksGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiIpblocksGetRequest) Execute() (IpBlocks, *APIResponse, error) { return r.ApiService.IpblocksGetExecute(r) } /* - * IpblocksGet List IP Blocks - * Retrieve a list of all reserved IP Blocks + * IpblocksGet List IP blocks + * List all reserved IP blocks. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiIpblocksGetRequest */ func (a *IPBlocksApiService) IpblocksGet(ctx _context.Context) ApiIpblocksGetRequest { return ApiIpblocksGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -409,10 +459,50 @@ func (a *IPBlocksApiService) IpblocksGetExecute(r ApiIpblocksGetRequest) (IpBloc if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(100, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +542,14 @@ func (a *IPBlocksApiService) IpblocksGetExecute(r ApiIpblocksGetRequest) (IpBloc return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +565,26 @@ func (a *IPBlocksApiService) IpblocksGetExecute(r ApiIpblocksGetRequest) (IpBloc if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,12 +593,12 @@ func (a *IPBlocksApiService) IpblocksGetExecute(r ApiIpblocksGetRequest) (IpBloc } type ApiIpblocksPatchRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - ipblockId string - ipblock *IpBlockProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + ipblockId string + ipblock *IpBlockProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -531,17 +624,17 @@ func (r ApiIpblocksPatchRequest) Execute() (IpBlock, *APIResponse, error) { } /* - * IpblocksPatch Partially modify IP Block - * You can use update attributes of a resource + * IpblocksPatch Partially modify IP blocks + * Update the properties of the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksPatchRequest */ func (a *IPBlocksApiService) IpblocksPatch(ctx _context.Context, ipblockId string) ApiIpblocksPatchRequest { return ApiIpblocksPatchRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, } } @@ -576,10 +669,21 @@ func (a *IPBlocksApiService) IpblocksPatchExecute(r ApiIpblocksPatchRequest) (Ip if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -621,13 +725,14 @@ func (a *IPBlocksApiService) IpblocksPatchExecute(r ApiIpblocksPatchRequest) (Ip return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +748,26 @@ func (a *IPBlocksApiService) IpblocksPatchExecute(r ApiIpblocksPatchRequest) (Ip if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,11 +776,11 @@ func (a *IPBlocksApiService) IpblocksPatchExecute(r ApiIpblocksPatchRequest) (Ip } type ApiIpblocksPostRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - ipblock *IpBlock - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + ipblock *IpBlock + pretty *bool + depth *int32 xContractNumber *int32 } @@ -699,15 +806,15 @@ func (r ApiIpblocksPostRequest) Execute() (IpBlock, *APIResponse, error) { } /* - * IpblocksPost Reserve IP Block - * This will reserve a new IP Block + * IpblocksPost Reserve IP blocks + * Reserve a new IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiIpblocksPostRequest */ func (a *IPBlocksApiService) IpblocksPost(ctx _context.Context) ApiIpblocksPostRequest { return ApiIpblocksPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -741,10 +848,21 @@ func (a *IPBlocksApiService) IpblocksPostExecute(r ApiIpblocksPostRequest) (IpBl if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -786,13 +904,14 @@ func (a *IPBlocksApiService) IpblocksPostExecute(r ApiIpblocksPostRequest) (IpBl return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksPost", } if err != nil || localVarHTTPResponse == nil { @@ -808,24 +927,26 @@ func (a *IPBlocksApiService) IpblocksPostExecute(r ApiIpblocksPostRequest) (IpBl if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -834,12 +955,12 @@ func (a *IPBlocksApiService) IpblocksPostExecute(r ApiIpblocksPostRequest) (IpBl } type ApiIpblocksPutRequest struct { - ctx _context.Context - ApiService *IPBlocksApiService - ipblockId string - ipblock *IpBlock - pretty *bool - depth *int32 + ctx _context.Context + ApiService *IPBlocksApiService + ipblockId string + ipblock *IpBlock + pretty *bool + depth *int32 xContractNumber *int32 } @@ -865,17 +986,17 @@ func (r ApiIpblocksPutRequest) Execute() (IpBlock, *APIResponse, error) { } /* - * IpblocksPut Modify IP Block - * You can use update attributes of a resource + * IpblocksPut Modify IP blocks + * Modify the properties of the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksPutRequest */ func (a *IPBlocksApiService) IpblocksPut(ctx _context.Context, ipblockId string) ApiIpblocksPutRequest { return ApiIpblocksPutRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, } } @@ -910,10 +1031,21 @@ func (a *IPBlocksApiService) IpblocksPutExecute(r ApiIpblocksPutRequest) (IpBloc if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -955,13 +1087,14 @@ func (a *IPBlocksApiService) IpblocksPutExecute(r ApiIpblocksPutRequest) (IpBloc return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksPut", } if err != nil || localVarHTTPResponse == nil { @@ -977,24 +1110,26 @@ func (a *IPBlocksApiService) IpblocksPutExecute(r ApiIpblocksPutRequest) (IpBloc if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_kubernetes.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_kubernetes.go index 374ad9dd0df2..3a11673a437e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_kubernetes.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_kubernetes.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -27,11 +28,11 @@ var ( type KubernetesApiService service type ApiK8sDeleteRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiK8sDeleteRequest) XContractNumber(xContractNumber int32) ApiK8sDelete return r } -func (r ApiK8sDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiK8sDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.K8sDeleteExecute(r) } /* - * K8sDelete Delete Kubernetes Cluster - * This will remove a Kubernetes Cluster. + * K8sDelete Delete Kubernetes clusters + * Delete the specified Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster + * @param k8sClusterId The unique ID of the Kubernetes cluster. * @return ApiK8sDeleteRequest */ func (a *KubernetesApiService) K8sDelete(ctx _context.Context, k8sClusterId string) ApiK8sDeleteRequest { return ApiK8sDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *KubernetesApiService) K8sDeleteExecute(r ApiK8sDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *KubernetesApiService) K8sDeleteExecute(r ApiK8sDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/k8s/{k8sClusterId}" @@ -95,10 +94,21 @@ func (a *KubernetesApiService) K8sDeleteExecute(r ApiK8sDeleteRequest) (map[stri if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,93 +145,86 @@ func (a *KubernetesApiService) K8sDeleteExecute(r ApiK8sDeleteRequest) (map[stri } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiK8sFindByClusteridRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - pretty *bool - depth *int32 +type ApiK8sFindByClusterIdRequest struct { + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiK8sFindByClusteridRequest) Pretty(pretty bool) ApiK8sFindByClusteridRequest { +func (r ApiK8sFindByClusterIdRequest) Pretty(pretty bool) ApiK8sFindByClusterIdRequest { r.pretty = &pretty return r } -func (r ApiK8sFindByClusteridRequest) Depth(depth int32) ApiK8sFindByClusteridRequest { +func (r ApiK8sFindByClusterIdRequest) Depth(depth int32) ApiK8sFindByClusterIdRequest { r.depth = &depth return r } -func (r ApiK8sFindByClusteridRequest) XContractNumber(xContractNumber int32) ApiK8sFindByClusteridRequest { +func (r ApiK8sFindByClusterIdRequest) XContractNumber(xContractNumber int32) ApiK8sFindByClusterIdRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiK8sFindByClusteridRequest) Execute() (KubernetesCluster, *APIResponse, error) { - return r.ApiService.K8sFindByClusteridExecute(r) +func (r ApiK8sFindByClusterIdRequest) Execute() (KubernetesCluster, *APIResponse, error) { + return r.ApiService.K8sFindByClusterIdExecute(r) } /* - * K8sFindByClusterid Retrieve Kubernetes Cluster - * This will retrieve a single Kubernetes Cluster. + * K8sFindByClusterId Retrieve Kubernetes clusters + * Retrieve the specified Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @return ApiK8sFindByClusteridRequest + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @return ApiK8sFindByClusterIdRequest */ -func (a *KubernetesApiService) K8sFindByClusterid(ctx _context.Context, k8sClusterId string) ApiK8sFindByClusteridRequest { - return ApiK8sFindByClusteridRequest{ - ApiService: a, - ctx: ctx, +func (a *KubernetesApiService) K8sFindByClusterId(ctx _context.Context, k8sClusterId string) ApiK8sFindByClusterIdRequest { + return ApiK8sFindByClusterIdRequest{ + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, } } @@ -230,7 +233,7 @@ func (a *KubernetesApiService) K8sFindByClusterid(ctx _context.Context, k8sClust * Execute executes the request * @return KubernetesCluster */ -func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusteridRequest) (KubernetesCluster, *APIResponse, error) { +func (a *KubernetesApiService) K8sFindByClusterIdExecute(r ApiK8sFindByClusterIdRequest) (KubernetesCluster, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +243,7 @@ func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusterid localVarReturnValue KubernetesCluster ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sFindByClusterid") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sFindByClusterId") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +257,21 @@ func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusterid if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusterid return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sFindByClusterid", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sFindByClusterId", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusterid if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +362,13 @@ func (a *KubernetesApiService) K8sFindByClusteridExecute(r ApiK8sFindByClusterid } type ApiK8sGetRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +385,40 @@ func (r ApiK8sGetRequest) XContractNumber(xContractNumber int32) ApiK8sGetReques return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sGetRequest) Filter(key string, value string) ApiK8sGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sGetRequest) OrderBy(orderBy string) ApiK8sGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiK8sGetRequest) MaxResults(maxResults int32) ApiK8sGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiK8sGetRequest) Execute() (KubernetesClusters, *APIResponse, error) { return r.ApiService.K8sGetExecute(r) } /* - * K8sGet List Kubernetes Clusters - * You can retrieve a list of all kubernetes clusters associated with a contract + * K8sGet List Kubernetes clusters + * List all available Kubernetes clusters. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiK8sGetRequest */ func (a *KubernetesApiService) K8sGet(ctx _context.Context) ApiK8sGetRequest { return ApiK8sGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -409,10 +449,34 @@ func (a *KubernetesApiService) K8sGetExecute(r ApiK8sGetRequest) (KubernetesClus if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +516,14 @@ func (a *KubernetesApiService) K8sGetExecute(r ApiK8sGetRequest) (KubernetesClus return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +539,26 @@ func (a *KubernetesApiService) K8sGetExecute(r ApiK8sGetRequest) (KubernetesClus if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,11 +567,14 @@ func (a *KubernetesApiService) K8sGetExecute(r ApiK8sGetRequest) (KubernetesClus } type ApiK8sKubeconfigGetRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + k8sClusterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -521,37 +591,57 @@ func (r ApiK8sKubeconfigGetRequest) XContractNumber(xContractNumber int32) ApiK8 return r } -func (r ApiK8sKubeconfigGetRequest) Execute() (KubernetesConfig, *APIResponse, error) { +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sKubeconfigGetRequest) Filter(key string, value string) ApiK8sKubeconfigGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sKubeconfigGetRequest) OrderBy(orderBy string) ApiK8sKubeconfigGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiK8sKubeconfigGetRequest) MaxResults(maxResults int32) ApiK8sKubeconfigGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiK8sKubeconfigGetRequest) Execute() (string, *APIResponse, error) { return r.ApiService.K8sKubeconfigGetExecute(r) } /* - * K8sKubeconfigGet Retrieve Kubernetes Configuration File - * You can retrieve kubernetes configuration file for the kubernetes cluster. + * K8sKubeconfigGet Retrieve Kubernetes configuration files + * Retrieve a configuration file for the specified Kubernetes cluster, in YAML or JSON format as defined in the Accept header; the default Accept header is application/yaml. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster + * @param k8sClusterId The unique ID of the Kubernetes cluster. * @return ApiK8sKubeconfigGetRequest */ func (a *KubernetesApiService) K8sKubeconfigGet(ctx _context.Context, k8sClusterId string) ApiK8sKubeconfigGetRequest { return ApiK8sKubeconfigGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, + filters: _neturl.Values{}, } } /* * Execute executes the request - * @return KubernetesConfig + * @return string */ -func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequest) (KubernetesConfig, *APIResponse, error) { +func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequest) (string, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue KubernetesConfig + localVarReturnValue string ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sKubeconfigGet") @@ -568,10 +658,34 @@ func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -582,7 +696,7 @@ func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequ } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/yaml", "application/x-yaml", "application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -611,13 +725,14 @@ func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sKubeconfigGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sKubeconfigGet", } if err != nil || localVarHTTPResponse == nil { @@ -633,24 +748,26 @@ func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -659,12 +776,12 @@ func (a *KubernetesApiService) K8sKubeconfigGetExecute(r ApiK8sKubeconfigGetRequ } type ApiK8sNodepoolsDeleteRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -681,44 +798,42 @@ func (r ApiK8sNodepoolsDeleteRequest) XContractNumber(xContractNumber int32) Api return r } -func (r ApiK8sNodepoolsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiK8sNodepoolsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.K8sNodepoolsDeleteExecute(r) } /* - * K8sNodepoolsDelete Delete Kubernetes Node Pool - * This will remove a Kubernetes Node Pool. + * K8sNodepoolsDelete Delete Kubernetes node pools + * Delete the specified Kubernetes node pool. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. * @return ApiK8sNodepoolsDeleteRequest */ func (a *KubernetesApiService) K8sNodepoolsDelete(ctx _context.Context, k8sClusterId string, nodepoolId string) ApiK8sNodepoolsDeleteRequest { return ApiK8sNodepoolsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, + nodepoolId: nodepoolId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *KubernetesApiService) K8sNodepoolsDeleteExecute(r ApiK8sNodepoolsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *KubernetesApiService) K8sNodepoolsDeleteExecute(r ApiK8sNodepoolsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sNodepoolsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/k8s/{k8sClusterId}/nodepools/{nodepoolId}" @@ -731,10 +846,21 @@ func (a *KubernetesApiService) K8sNodepoolsDeleteExecute(r ApiK8sNodepoolsDelete if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -771,63 +897,56 @@ func (a *KubernetesApiService) K8sNodepoolsDeleteExecute(r ApiK8sNodepoolsDelete } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiK8sNodepoolsFindByIdRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -849,19 +968,19 @@ func (r ApiK8sNodepoolsFindByIdRequest) Execute() (KubernetesNodePool, *APIRespo } /* - * K8sNodepoolsFindById Retrieve Kubernetes Node Pool - * You can retrieve a single Kubernetes Node Pool. + * K8sNodepoolsFindById Retrieve Kubernetes node pools + * Retrieve the specified Kubernetes node pool. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. * @return ApiK8sNodepoolsFindByIdRequest */ func (a *KubernetesApiService) K8sNodepoolsFindById(ctx _context.Context, k8sClusterId string, nodepoolId string) ApiK8sNodepoolsFindByIdRequest { return ApiK8sNodepoolsFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, + nodepoolId: nodepoolId, } } @@ -894,10 +1013,21 @@ func (a *KubernetesApiService) K8sNodepoolsFindByIdExecute(r ApiK8sNodepoolsFind if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -937,13 +1067,14 @@ func (a *KubernetesApiService) K8sNodepoolsFindByIdExecute(r ApiK8sNodepoolsFind return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -959,24 +1090,26 @@ func (a *KubernetesApiService) K8sNodepoolsFindByIdExecute(r ApiK8sNodepoolsFind if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -985,11 +1118,14 @@ func (a *KubernetesApiService) K8sNodepoolsFindByIdExecute(r ApiK8sNodepoolsFind } type ApiK8sNodepoolsGetRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + k8sClusterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1006,22 +1142,42 @@ func (r ApiK8sNodepoolsGetRequest) XContractNumber(xContractNumber int32) ApiK8s return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sNodepoolsGetRequest) Filter(key string, value string) ApiK8sNodepoolsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sNodepoolsGetRequest) OrderBy(orderBy string) ApiK8sNodepoolsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiK8sNodepoolsGetRequest) MaxResults(maxResults int32) ApiK8sNodepoolsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiK8sNodepoolsGetRequest) Execute() (KubernetesNodePools, *APIResponse, error) { return r.ApiService.K8sNodepoolsGetExecute(r) } /* - * K8sNodepoolsGet List Kubernetes Node Pools - * You can retrieve a list of all kubernetes node pools part of kubernetes cluster + * K8sNodepoolsGet List Kubernetes node pools + * List all Kubernetes node pools, included the specified Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster + * @param k8sClusterId The unique ID of the Kubernetes cluster. * @return ApiK8sNodepoolsGetRequest */ func (a *KubernetesApiService) K8sNodepoolsGet(ctx _context.Context, k8sClusterId string) ApiK8sNodepoolsGetRequest { return ApiK8sNodepoolsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, + filters: _neturl.Values{}, } } @@ -1053,10 +1209,34 @@ func (a *KubernetesApiService) K8sNodepoolsGetExecute(r ApiK8sNodepoolsGetReques if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1096,13 +1276,14 @@ func (a *KubernetesApiService) K8sNodepoolsGetExecute(r ApiK8sNodepoolsGetReques return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsGet", } if err != nil || localVarHTTPResponse == nil { @@ -1118,24 +1299,26 @@ func (a *KubernetesApiService) K8sNodepoolsGetExecute(r ApiK8sNodepoolsGetReques if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1144,13 +1327,13 @@ func (a *KubernetesApiService) K8sNodepoolsGetExecute(r ApiK8sNodepoolsGetReques } type ApiK8sNodepoolsNodesDeleteRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - nodeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + nodeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1167,46 +1350,44 @@ func (r ApiK8sNodepoolsNodesDeleteRequest) XContractNumber(xContractNumber int32 return r } -func (r ApiK8sNodepoolsNodesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiK8sNodepoolsNodesDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.K8sNodepoolsNodesDeleteExecute(r) } /* - * K8sNodepoolsNodesDelete Delete Kubernetes node - * This will remove a Kubernetes node. + * K8sNodepoolsNodesDelete Delete Kubernetes nodes + * Delete the specified Kubernetes node. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool - * @param nodeId The unique ID of the Kubernetes node + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. + * @param nodeId The unique ID of the Kubernetes node. * @return ApiK8sNodepoolsNodesDeleteRequest */ func (a *KubernetesApiService) K8sNodepoolsNodesDelete(ctx _context.Context, k8sClusterId string, nodepoolId string, nodeId string) ApiK8sNodepoolsNodesDeleteRequest { return ApiK8sNodepoolsNodesDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, - nodeId: nodeId, + nodepoolId: nodepoolId, + nodeId: nodeId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *KubernetesApiService) K8sNodepoolsNodesDeleteExecute(r ApiK8sNodepoolsNodesDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *KubernetesApiService) K8sNodepoolsNodesDeleteExecute(r ApiK8sNodepoolsNodesDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sNodepoolsNodesDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/k8s/{k8sClusterId}/nodepools/{nodepoolId}/nodes/{nodeId}" @@ -1220,10 +1401,21 @@ func (a *KubernetesApiService) K8sNodepoolsNodesDeleteExecute(r ApiK8sNodepoolsN if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1260,64 +1452,57 @@ func (a *KubernetesApiService) K8sNodepoolsNodesDeleteExecute(r ApiK8sNodepoolsN } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsNodesDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsNodesDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiK8sNodepoolsNodesFindByIdRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - nodeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + nodeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1339,21 +1524,21 @@ func (r ApiK8sNodepoolsNodesFindByIdRequest) Execute() (KubernetesNode, *APIResp } /* - * K8sNodepoolsNodesFindById Retrieve Kubernetes node - * You can retrieve a single Kubernetes Node. + * K8sNodepoolsNodesFindById Retrieve Kubernetes nodes + * Retrieve the specified Kubernetes node. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool - * @param nodeId The unique ID of the Kubernetes Node. + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. + * @param nodeId The unique ID of the Kubernetes node. * @return ApiK8sNodepoolsNodesFindByIdRequest */ func (a *KubernetesApiService) K8sNodepoolsNodesFindById(ctx _context.Context, k8sClusterId string, nodepoolId string, nodeId string) ApiK8sNodepoolsNodesFindByIdRequest { return ApiK8sNodepoolsNodesFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, - nodeId: nodeId, + nodepoolId: nodepoolId, + nodeId: nodeId, } } @@ -1387,10 +1572,21 @@ func (a *KubernetesApiService) K8sNodepoolsNodesFindByIdExecute(r ApiK8sNodepool if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1430,13 +1626,14 @@ func (a *KubernetesApiService) K8sNodepoolsNodesFindByIdExecute(r ApiK8sNodepool return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsNodesFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsNodesFindById", } if err != nil || localVarHTTPResponse == nil { @@ -1452,24 +1649,26 @@ func (a *KubernetesApiService) K8sNodepoolsNodesFindByIdExecute(r ApiK8sNodepool if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1478,12 +1677,15 @@ func (a *KubernetesApiService) K8sNodepoolsNodesFindByIdExecute(r ApiK8sNodepool } type ApiK8sNodepoolsNodesGetRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + k8sClusterId string + nodepoolId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1500,24 +1702,44 @@ func (r ApiK8sNodepoolsNodesGetRequest) XContractNumber(xContractNumber int32) A return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sNodepoolsNodesGetRequest) Filter(key string, value string) ApiK8sNodepoolsNodesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sNodepoolsNodesGetRequest) OrderBy(orderBy string) ApiK8sNodepoolsNodesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiK8sNodepoolsNodesGetRequest) MaxResults(maxResults int32) ApiK8sNodepoolsNodesGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiK8sNodepoolsNodesGetRequest) Execute() (KubernetesNodes, *APIResponse, error) { return r.ApiService.K8sNodepoolsNodesGetExecute(r) } /* - * K8sNodepoolsNodesGet Retrieve Kubernetes nodes. - * You can retrieve all nodes of Kubernetes Node Pool. + * K8sNodepoolsNodesGet List Kubernetes nodes + * List all the nodes, included in the specified Kubernetes node pool. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. * @return ApiK8sNodepoolsNodesGetRequest */ func (a *KubernetesApiService) K8sNodepoolsNodesGet(ctx _context.Context, k8sClusterId string, nodepoolId string) ApiK8sNodepoolsNodesGetRequest { return ApiK8sNodepoolsNodesGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, + nodepoolId: nodepoolId, + filters: _neturl.Values{}, } } @@ -1550,10 +1772,34 @@ func (a *KubernetesApiService) K8sNodepoolsNodesGetExecute(r ApiK8sNodepoolsNode if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1593,13 +1839,14 @@ func (a *KubernetesApiService) K8sNodepoolsNodesGetExecute(r ApiK8sNodepoolsNode return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsNodesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsNodesGet", } if err != nil || localVarHTTPResponse == nil { @@ -1615,24 +1862,26 @@ func (a *KubernetesApiService) K8sNodepoolsNodesGetExecute(r ApiK8sNodepoolsNode if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1641,13 +1890,13 @@ func (a *KubernetesApiService) K8sNodepoolsNodesGetExecute(r ApiK8sNodepoolsNode } type ApiK8sNodepoolsNodesReplacePostRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - nodeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + nodeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1664,48 +1913,46 @@ func (r ApiK8sNodepoolsNodesReplacePostRequest) XContractNumber(xContractNumber return r } -func (r ApiK8sNodepoolsNodesReplacePostRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiK8sNodepoolsNodesReplacePostRequest) Execute() (*APIResponse, error) { return r.ApiService.K8sNodepoolsNodesReplacePostExecute(r) } /* - * K8sNodepoolsNodesReplacePost Recreate the Kubernetes node - * You can recreate a single Kubernetes Node. + * K8sNodepoolsNodesReplacePost Recreate Kubernetes nodes + * Recreate the specified Kubernetes node. -Managed Kubernetes starts a process which based on the nodepool's template creates & configures a new node, waits for status "ACTIVE", and migrates all the pods from the faulty node, deleting it once empty. While this operation occurs, the nodepool will have an extra billable "ACTIVE" node. +A new node is created and configured by Managed Kubernetes, based on the node pool template. Once the status is "Active", all the pods are migrated from the faulty node, which is then deleted once empty. During this operation, the node pool will have an additional billable "Active" node. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool - * @param nodeId The unique ID of the Kubernetes Node. + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. + * @param nodeId The unique ID of the Kubernetes node. * @return ApiK8sNodepoolsNodesReplacePostRequest - */ +*/ func (a *KubernetesApiService) K8sNodepoolsNodesReplacePost(ctx _context.Context, k8sClusterId string, nodepoolId string, nodeId string) ApiK8sNodepoolsNodesReplacePostRequest { return ApiK8sNodepoolsNodesReplacePostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, - nodeId: nodeId, + nodepoolId: nodepoolId, + nodeId: nodeId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *KubernetesApiService) K8sNodepoolsNodesReplacePostExecute(r ApiK8sNodepoolsNodesReplacePostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *KubernetesApiService) K8sNodepoolsNodesReplacePostExecute(r ApiK8sNodepoolsNodesReplacePostRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sNodepoolsNodesReplacePost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/k8s/{k8sClusterId}/nodepools/{nodepoolId}/nodes/{nodeId}/replace" @@ -1719,10 +1966,21 @@ func (a *KubernetesApiService) K8sNodepoolsNodesReplacePostExecute(r ApiK8sNodep if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1759,67 +2017,60 @@ func (a *KubernetesApiService) K8sNodepoolsNodesReplacePostExecute(r ApiK8sNodep } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsNodesReplacePost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsNodesReplacePost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiK8sNodepoolsPostRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - kubernetesNodePool *KubernetesNodePool - pretty *bool - depth *int32 - xContractNumber *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + kubernetesNodePool *KubernetesNodePoolForPost + pretty *bool + depth *int32 + xContractNumber *int32 } -func (r ApiK8sNodepoolsPostRequest) KubernetesNodePool(kubernetesNodePool KubernetesNodePool) ApiK8sNodepoolsPostRequest { +func (r ApiK8sNodepoolsPostRequest) KubernetesNodePool(kubernetesNodePool KubernetesNodePoolForPost) ApiK8sNodepoolsPostRequest { r.kubernetesNodePool = &kubernetesNodePool return r } @@ -1841,16 +2092,16 @@ func (r ApiK8sNodepoolsPostRequest) Execute() (KubernetesNodePool, *APIResponse, } /* - * K8sNodepoolsPost Create a Kubernetes Node Pool - * This will create a new Kubernetes Node Pool inside a Kubernetes Cluster. + * K8sNodepoolsPost Create Kubernetes node pools + * Create a Kubernetes node pool inside the specified Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster + * @param k8sClusterId The unique ID of the Kubernetes cluster. * @return ApiK8sNodepoolsPostRequest */ func (a *KubernetesApiService) K8sNodepoolsPost(ctx _context.Context, k8sClusterId string) ApiK8sNodepoolsPostRequest { return ApiK8sNodepoolsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, } } @@ -1886,10 +2137,21 @@ func (a *KubernetesApiService) K8sNodepoolsPostExecute(r ApiK8sNodepoolsPostRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1931,13 +2193,14 @@ func (a *KubernetesApiService) K8sNodepoolsPostExecute(r ApiK8sNodepoolsPostRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsPost", } if err != nil || localVarHTTPResponse == nil { @@ -1953,24 +2216,26 @@ func (a *KubernetesApiService) K8sNodepoolsPostExecute(r ApiK8sNodepoolsPostRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1979,18 +2244,18 @@ func (a *KubernetesApiService) K8sNodepoolsPostExecute(r ApiK8sNodepoolsPostRequ } type ApiK8sNodepoolsPutRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - nodepoolId string - kubernetesNodePoolProperties *KubernetesNodePoolPropertiesForPut - pretty *bool - depth *int32 - xContractNumber *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + nodepoolId string + kubernetesNodePool *KubernetesNodePoolForPut + pretty *bool + depth *int32 + xContractNumber *int32 } -func (r ApiK8sNodepoolsPutRequest) KubernetesNodePoolProperties(kubernetesNodePoolProperties KubernetesNodePoolPropertiesForPut) ApiK8sNodepoolsPutRequest { - r.kubernetesNodePoolProperties = &kubernetesNodePoolProperties +func (r ApiK8sNodepoolsPutRequest) KubernetesNodePool(kubernetesNodePool KubernetesNodePoolForPut) ApiK8sNodepoolsPutRequest { + r.kubernetesNodePool = &kubernetesNodePool return r } func (r ApiK8sNodepoolsPutRequest) Pretty(pretty bool) ApiK8sNodepoolsPutRequest { @@ -2006,39 +2271,39 @@ func (r ApiK8sNodepoolsPutRequest) XContractNumber(xContractNumber int32) ApiK8s return r } -func (r ApiK8sNodepoolsPutRequest) Execute() (KubernetesNodePoolForPut, *APIResponse, error) { +func (r ApiK8sNodepoolsPutRequest) Execute() (KubernetesNodePool, *APIResponse, error) { return r.ApiService.K8sNodepoolsPutExecute(r) } /* - * K8sNodepoolsPut Modify Kubernetes Node Pool - * This will modify the Kubernetes Node Pool. + * K8sNodepoolsPut Modify Kubernetes node pools + * Modify the specified Kubernetes node pool. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster - * @param nodepoolId The unique ID of the Kubernetes Node Pool + * @param k8sClusterId The unique ID of the Kubernetes cluster. + * @param nodepoolId The unique ID of the Kubernetes node pool. * @return ApiK8sNodepoolsPutRequest */ func (a *KubernetesApiService) K8sNodepoolsPut(ctx _context.Context, k8sClusterId string, nodepoolId string) ApiK8sNodepoolsPutRequest { return ApiK8sNodepoolsPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, - nodepoolId: nodepoolId, + nodepoolId: nodepoolId, } } /* * Execute executes the request - * @return KubernetesNodePoolForPut + * @return KubernetesNodePool */ -func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutRequest) (KubernetesNodePoolForPut, *APIResponse, error) { +func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutRequest) (KubernetesNodePool, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue KubernetesNodePoolForPut + localVarReturnValue KubernetesNodePool ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sNodepoolsPut") @@ -2053,16 +2318,27 @@ func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutReques localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.kubernetesNodePoolProperties == nil { - return localVarReturnValue, nil, reportError("kubernetesNodePoolProperties is required and must be specified") + if r.kubernetesNodePool == nil { + return localVarReturnValue, nil, reportError("kubernetesNodePool is required and must be specified") } if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2084,7 +2360,7 @@ func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutReques localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") } // body params - localVarPostBody = map[string]interface{}{"properties": r.kubernetesNodePoolProperties} + localVarPostBody = r.kubernetesNodePool if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2104,13 +2380,14 @@ func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutReques return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sNodepoolsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sNodepoolsPut", } if err != nil || localVarHTTPResponse == nil { @@ -2126,24 +2403,26 @@ func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutReques if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2152,15 +2431,15 @@ func (a *KubernetesApiService) K8sNodepoolsPutExecute(r ApiK8sNodepoolsPutReques } type ApiK8sPostRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - kubernetesCluster *KubernetesCluster - pretty *bool - depth *int32 - xContractNumber *int32 + ctx _context.Context + ApiService *KubernetesApiService + kubernetesCluster *KubernetesClusterForPost + pretty *bool + depth *int32 + xContractNumber *int32 } -func (r ApiK8sPostRequest) KubernetesCluster(kubernetesCluster KubernetesCluster) ApiK8sPostRequest { +func (r ApiK8sPostRequest) KubernetesCluster(kubernetesCluster KubernetesClusterForPost) ApiK8sPostRequest { r.kubernetesCluster = &kubernetesCluster return r } @@ -2182,15 +2461,15 @@ func (r ApiK8sPostRequest) Execute() (KubernetesCluster, *APIResponse, error) { } /* - * K8sPost Create Kubernetes Cluster - * This will create a new Kubernetes Cluster. + * K8sPost Create Kubernetes clusters + * Create a Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiK8sPostRequest */ func (a *KubernetesApiService) K8sPost(ctx _context.Context) ApiK8sPostRequest { return ApiK8sPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -2224,10 +2503,21 @@ func (a *KubernetesApiService) K8sPostExecute(r ApiK8sPostRequest) (KubernetesCl if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2269,13 +2559,14 @@ func (a *KubernetesApiService) K8sPostExecute(r ApiK8sPostRequest) (KubernetesCl return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sPost", } if err != nil || localVarHTTPResponse == nil { @@ -2291,24 +2582,26 @@ func (a *KubernetesApiService) K8sPostExecute(r ApiK8sPostRequest) (KubernetesCl if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2317,17 +2610,17 @@ func (a *KubernetesApiService) K8sPostExecute(r ApiK8sPostRequest) (KubernetesCl } type ApiK8sPutRequest struct { - ctx _context.Context - ApiService *KubernetesApiService - k8sClusterId string - kubernetescluster *KubernetesCluster - pretty *bool - depth *int32 - xContractNumber *int32 + ctx _context.Context + ApiService *KubernetesApiService + k8sClusterId string + kubernetesCluster *KubernetesClusterForPut + pretty *bool + depth *int32 + xContractNumber *int32 } -func (r ApiK8sPutRequest) Kubernetescluster(kubernetescluster KubernetesCluster) ApiK8sPutRequest { - r.kubernetescluster = &kubernetescluster +func (r ApiK8sPutRequest) KubernetesCluster(kubernetesCluster KubernetesClusterForPut) ApiK8sPutRequest { + r.kubernetesCluster = &kubernetesCluster return r } func (r ApiK8sPutRequest) Pretty(pretty bool) ApiK8sPutRequest { @@ -2348,16 +2641,16 @@ func (r ApiK8sPutRequest) Execute() (KubernetesCluster, *APIResponse, error) { } /* - * K8sPut Modify Kubernetes Cluster - * This will modify the Kubernetes Cluster. + * K8sPut Modify Kubernetes clusters + * Modify the specified Kubernetes cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param k8sClusterId The unique ID of the Kubernetes Cluster + * @param k8sClusterId The unique ID of the Kubernetes cluster. * @return ApiK8sPutRequest */ func (a *KubernetesApiService) K8sPut(ctx _context.Context, k8sClusterId string) ApiK8sPutRequest { return ApiK8sPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, k8sClusterId: k8sClusterId, } } @@ -2387,16 +2680,27 @@ func (a *KubernetesApiService) K8sPutExecute(r ApiK8sPutRequest) (KubernetesClus localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.kubernetescluster == nil { - return localVarReturnValue, nil, reportError("kubernetescluster is required and must be specified") + if r.kubernetesCluster == nil { + return localVarReturnValue, nil, reportError("kubernetesCluster is required and must be specified") } if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2418,7 +2722,7 @@ func (a *KubernetesApiService) K8sPutExecute(r ApiK8sPutRequest) (KubernetesClus localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") } // body params - localVarPostBody = r.kubernetescluster + localVarPostBody = r.kubernetesCluster if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2438,13 +2742,14 @@ func (a *KubernetesApiService) K8sPutExecute(r ApiK8sPutRequest) (KubernetesClus return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sPut", } if err != nil || localVarHTTPResponse == nil { @@ -2460,24 +2765,26 @@ func (a *KubernetesApiService) K8sPutExecute(r ApiK8sPutRequest) (KubernetesClus if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2485,161 +2792,48 @@ func (a *KubernetesApiService) K8sPutExecute(r ApiK8sPutRequest) (KubernetesClus return localVarReturnValue, localVarAPIResponse, nil } -type ApiK8sVersionsCompatibilitiesGetRequest struct { - ctx _context.Context +type ApiK8sVersionsDefaultGetRequest struct { + ctx _context.Context ApiService *KubernetesApiService - clusterVersion string -} - - -func (r ApiK8sVersionsCompatibilitiesGetRequest) Execute() ([]string, *APIResponse, error) { - return r.ApiService.K8sVersionsCompatibilitiesGetExecute(r) + filters _neturl.Values + orderBy *string + maxResults *int32 } -/* - * K8sVersionsCompatibilitiesGet Retrieves a list of available kubernetes versions for nodepools depending on the given kubernetes version running in the cluster. - * You can retrieve a list of available kubernetes versions for nodepools depending on the given kubernetes version running in the cluster. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param clusterVersion - * @return ApiK8sVersionsCompatibilitiesGetRequest - */ -func (a *KubernetesApiService) K8sVersionsCompatibilitiesGet(ctx _context.Context, clusterVersion string) ApiK8sVersionsCompatibilitiesGetRequest { - return ApiK8sVersionsCompatibilitiesGetRequest{ - ApiService: a, - ctx: ctx, - clusterVersion: clusterVersion, - } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sVersionsDefaultGetRequest) Filter(key string, value string) ApiK8sVersionsDefaultGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r } -/* - * Execute executes the request - * @return []string - */ -func (a *KubernetesApiService) K8sVersionsCompatibilitiesGetExecute(r ApiK8sVersionsCompatibilitiesGetRequest) ([]string, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KubernetesApiService.K8sVersionsCompatibilitiesGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/k8s/versions/{clusterVersion}/compatibilities" - localVarPath = strings.Replace(localVarPath, "{"+"clusterVersion"+"}", _neturl.PathEscape(parameterToString(r.clusterVersion, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sVersionsCompatibilitiesGet", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sVersionsDefaultGetRequest) OrderBy(orderBy string) ApiK8sVersionsDefaultGetRequest { + r.orderBy = &orderBy + return r } -type ApiK8sVersionsDefaultGetRequest struct { - ctx _context.Context - ApiService *KubernetesApiService +// MaxResults query param limits the number of results returned. +func (r ApiK8sVersionsDefaultGetRequest) MaxResults(maxResults int32) ApiK8sVersionsDefaultGetRequest { + r.maxResults = &maxResults + return r } - func (r ApiK8sVersionsDefaultGetRequest) Execute() (string, *APIResponse, error) { return r.ApiService.K8sVersionsDefaultGetExecute(r) } /* - * K8sVersionsDefaultGet Retrieve the current default kubernetes version for clusters and nodepools. - * You can retrieve the current default kubernetes version for clusters and nodepools. + * K8sVersionsDefaultGet Retrieve current default Kubernetes version + * Retrieve current default Kubernetes version for clusters and nodepools. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiK8sVersionsDefaultGetRequest */ func (a *KubernetesApiService) K8sVersionsDefaultGet(ctx _context.Context) ApiK8sVersionsDefaultGetRequest { return ApiK8sVersionsDefaultGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -2668,6 +2862,20 @@ func (a *KubernetesApiService) K8sVersionsDefaultGetExecute(r ApiK8sVersionsDefa localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2704,13 +2912,14 @@ func (a *KubernetesApiService) K8sVersionsDefaultGetExecute(r ApiK8sVersionsDefa return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sVersionsDefaultGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sVersionsDefaultGet", } if err != nil || localVarHTTPResponse == nil { @@ -2726,24 +2935,26 @@ func (a *KubernetesApiService) K8sVersionsDefaultGetExecute(r ApiK8sVersionsDefa if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2752,25 +2963,47 @@ func (a *KubernetesApiService) K8sVersionsDefaultGetExecute(r ApiK8sVersionsDefa } type ApiK8sVersionsGetRequest struct { - ctx _context.Context + ctx _context.Context ApiService *KubernetesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiK8sVersionsGetRequest) Filter(key string, value string) ApiK8sVersionsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiK8sVersionsGetRequest) OrderBy(orderBy string) ApiK8sVersionsGetRequest { + r.orderBy = &orderBy + return r } +// MaxResults query param limits the number of results returned. +func (r ApiK8sVersionsGetRequest) MaxResults(maxResults int32) ApiK8sVersionsGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiK8sVersionsGetRequest) Execute() ([]string, *APIResponse, error) { return r.ApiService.K8sVersionsGetExecute(r) } /* - * K8sVersionsGet Retrieve available Kubernetes versions - * You can retrieve a list of available kubernetes versions + * K8sVersionsGet List Kubernetes versions + * List available Kubernetes versions. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiK8sVersionsGetRequest */ func (a *KubernetesApiService) K8sVersionsGet(ctx _context.Context) ApiK8sVersionsGetRequest { return ApiK8sVersionsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -2799,6 +3032,20 @@ func (a *KubernetesApiService) K8sVersionsGetExecute(r ApiK8sVersionsGetRequest) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2835,13 +3082,14 @@ func (a *KubernetesApiService) K8sVersionsGetExecute(r ApiK8sVersionsGetRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "K8sVersionsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "K8sVersionsGet", } if err != nil || localVarHTTPResponse == nil { @@ -2857,24 +3105,26 @@ func (a *KubernetesApiService) K8sVersionsGetExecute(r ApiK8sVersionsGetRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_label.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_labels.go similarity index 64% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_label.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_labels.go index 4b60017262ff..dac74ba02dac 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_label.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_labels.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,16 +24,16 @@ var ( _ _context.Context ) -// LabelApiService LabelApi service -type LabelApiService service +// LabelsApiService LabelsApi service +type LabelsApiService service type ApiDatacentersLabelsDeleteRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -49,44 +50,42 @@ func (r ApiDatacentersLabelsDeleteRequest) XContractNumber(xContractNumber int32 return r } -func (r ApiDatacentersLabelsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersLabelsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersLabelsDeleteExecute(r) } /* - * DatacentersLabelsDelete Delete a Label from Data Center - * This will remove a label from the data center. + * DatacentersLabelsDelete Delete data center labels + * Delete the specified data center label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Data Center - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param key The label key * @return ApiDatacentersLabelsDeleteRequest */ -func (a *LabelApiService) DatacentersLabelsDelete(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsDeleteRequest { +func (a *LabelsApiService) DatacentersLabelsDelete(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsDeleteRequest { return ApiDatacentersLabelsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - key: key, + key: key, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LabelApiService) DatacentersLabelsDeleteExecute(r ApiDatacentersLabelsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LabelsApiService) DatacentersLabelsDeleteExecute(r ApiDatacentersLabelsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersLabelsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersLabelsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/labels/{key}" @@ -99,10 +98,21 @@ func (a *LabelApiService) DatacentersLabelsDeleteExecute(r ApiDatacentersLabelsD if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -139,63 +149,56 @@ func (a *LabelApiService) DatacentersLabelsDeleteExecute(r ApiDatacentersLabelsD } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLabelsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLabelsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersLabelsFindByKeyRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -217,19 +220,19 @@ func (r ApiDatacentersLabelsFindByKeyRequest) Execute() (LabelResource, *APIResp } /* - * DatacentersLabelsFindByKey Retrieve a Label of Data Center - * This will retrieve the properties of a associated label to a data center. + * DatacentersLabelsFindByKey Retrieve data center labels + * Retrieve the properties of the specified data center label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Data Center - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param key The label key * @return ApiDatacentersLabelsFindByKeyRequest */ -func (a *LabelApiService) DatacentersLabelsFindByKey(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsFindByKeyRequest { +func (a *LabelsApiService) DatacentersLabelsFindByKey(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsFindByKeyRequest { return ApiDatacentersLabelsFindByKeyRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - key: key, + key: key, } } @@ -237,7 +240,7 @@ func (a *LabelApiService) DatacentersLabelsFindByKey(ctx _context.Context, datac * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -247,7 +250,7 @@ func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabe localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersLabelsFindByKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersLabelsFindByKey") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -262,10 +265,21 @@ func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -305,13 +319,14 @@ func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLabelsFindByKey", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLabelsFindByKey", } if err != nil || localVarHTTPResponse == nil { @@ -327,24 +342,26 @@ func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -353,11 +370,14 @@ func (a *LabelApiService) DatacentersLabelsFindByKeyExecute(r ApiDatacentersLabe } type ApiDatacentersLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -374,22 +394,42 @@ func (r ApiDatacentersLabelsGetRequest) XContractNumber(xContractNumber int32) A return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersLabelsGetRequest) Filter(key string, value string) ApiDatacentersLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersLabelsGetRequest) OrderBy(orderBy string) ApiDatacentersLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersLabelsGetRequest) MaxResults(maxResults int32) ApiDatacentersLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiDatacentersLabelsGetRequest) Execute() (LabelResources, *APIResponse, error) { return r.ApiService.DatacentersLabelsGetExecute(r) } /* - * DatacentersLabelsGet List all Data Center Labels - * You can retrieve a list of all labels associated with a data center + * DatacentersLabelsGet List data center labels + * List all the the labels for the specified data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Data Center + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLabelsGetRequest */ -func (a *LabelApiService) DatacentersLabelsGet(ctx _context.Context, datacenterId string) ApiDatacentersLabelsGetRequest { +func (a *LabelsApiService) DatacentersLabelsGet(ctx _context.Context, datacenterId string) ApiDatacentersLabelsGetRequest { return ApiDatacentersLabelsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, + filters: _neturl.Values{}, } } @@ -397,7 +437,7 @@ func (a *LabelApiService) DatacentersLabelsGet(ctx _context.Context, datacenterI * Execute executes the request * @return LabelResources */ -func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetRequest) (LabelResources, *APIResponse, error) { +func (a *LabelsApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetRequest) (LabelResources, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -407,7 +447,7 @@ func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetR localVarReturnValue LabelResources ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersLabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersLabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -421,10 +461,34 @@ func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -464,13 +528,14 @@ func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetR return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -486,24 +551,26 @@ func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetR if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -512,12 +579,12 @@ func (a *LabelApiService) DatacentersLabelsGetExecute(r ApiDatacentersLabelsGetR } type ApiDatacentersLabelsPostRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -543,16 +610,16 @@ func (r ApiDatacentersLabelsPostRequest) Execute() (LabelResource, *APIResponse, } /* - * DatacentersLabelsPost Add a Label to Data Center - * This will add a label to the data center. + * DatacentersLabelsPost Create data center labels + * Add a new label to the specified data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Data Center + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLabelsPostRequest */ -func (a *LabelApiService) DatacentersLabelsPost(ctx _context.Context, datacenterId string) ApiDatacentersLabelsPostRequest { +func (a *LabelsApiService) DatacentersLabelsPost(ctx _context.Context, datacenterId string) ApiDatacentersLabelsPostRequest { return ApiDatacentersLabelsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -561,7 +628,7 @@ func (a *LabelApiService) DatacentersLabelsPost(ctx _context.Context, datacenter * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPostRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPostRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -571,7 +638,7 @@ func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPos localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersLabelsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersLabelsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -588,10 +655,21 @@ func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPos if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -633,13 +711,14 @@ func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPos return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLabelsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLabelsPost", } if err != nil || localVarHTTPResponse == nil { @@ -655,24 +734,26 @@ func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPos if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -681,13 +762,13 @@ func (a *LabelApiService) DatacentersLabelsPostExecute(r ApiDatacentersLabelsPos } type ApiDatacentersLabelsPutRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - key string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + key string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -713,19 +794,19 @@ func (r ApiDatacentersLabelsPutRequest) Execute() (LabelResource, *APIResponse, } /* - * DatacentersLabelsPut Modify a Label of Data Center - * This will modify the value of the label on a data center. + * DatacentersLabelsPut Modify data center labels + * Modify the specified data center label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Data Center - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param key The label key * @return ApiDatacentersLabelsPutRequest */ -func (a *LabelApiService) DatacentersLabelsPut(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsPutRequest { +func (a *LabelsApiService) DatacentersLabelsPut(ctx _context.Context, datacenterId string, key string) ApiDatacentersLabelsPutRequest { return ApiDatacentersLabelsPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - key: key, + key: key, } } @@ -733,7 +814,7 @@ func (a *LabelApiService) DatacentersLabelsPut(ctx _context.Context, datacenterI * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -743,7 +824,7 @@ func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutR localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersLabelsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersLabelsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -761,10 +842,21 @@ func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -806,13 +898,14 @@ func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutR return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLabelsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLabelsPut", } if err != nil || localVarHTTPResponse == nil { @@ -828,24 +921,26 @@ func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutR if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -854,13 +949,13 @@ func (a *LabelApiService) DatacentersLabelsPutExecute(r ApiDatacentersLabelsPutR } type ApiDatacentersServersLabelsDeleteRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - serverId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + serverId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -877,46 +972,44 @@ func (r ApiDatacentersServersLabelsDeleteRequest) XContractNumber(xContractNumbe return r } -func (r ApiDatacentersServersLabelsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersServersLabelsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersServersLabelsDeleteExecute(r) } /* - * DatacentersServersLabelsDelete Delete a Label from Server - * This will remove a label from the server. + * DatacentersServersLabelsDelete Delete server labels + * Delete the specified server label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param key The label key * @return ApiDatacentersServersLabelsDeleteRequest */ -func (a *LabelApiService) DatacentersServersLabelsDelete(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsDeleteRequest { +func (a *LabelsApiService) DatacentersServersLabelsDelete(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsDeleteRequest { return ApiDatacentersServersLabelsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - key: key, + serverId: serverId, + key: key, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LabelApiService) DatacentersServersLabelsDeleteExecute(r ApiDatacentersServersLabelsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LabelsApiService) DatacentersServersLabelsDeleteExecute(r ApiDatacentersServersLabelsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersServersLabelsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersServersLabelsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/labels/{key}" @@ -930,10 +1023,21 @@ func (a *LabelApiService) DatacentersServersLabelsDeleteExecute(r ApiDatacenters if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -970,64 +1074,57 @@ func (a *LabelApiService) DatacentersServersLabelsDeleteExecute(r ApiDatacenters } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersLabelsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersLabelsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersServersLabelsFindByKeyRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - serverId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + serverId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1049,21 +1146,21 @@ func (r ApiDatacentersServersLabelsFindByKeyRequest) Execute() (LabelResource, * } /* - * DatacentersServersLabelsFindByKey Retrieve a Label of Server - * This will retrieve the properties of a associated label to a server. + * DatacentersServersLabelsFindByKey Retrieve server labels + * Retrieve the properties of the specified server label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param key The label key * @return ApiDatacentersServersLabelsFindByKeyRequest */ -func (a *LabelApiService) DatacentersServersLabelsFindByKey(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsFindByKeyRequest { +func (a *LabelsApiService) DatacentersServersLabelsFindByKey(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsFindByKeyRequest { return ApiDatacentersServersLabelsFindByKeyRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - key: key, + serverId: serverId, + key: key, } } @@ -1071,7 +1168,7 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKey(ctx _context.Context * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacentersServersLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacentersServersLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1081,7 +1178,7 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacent localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersServersLabelsFindByKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersServersLabelsFindByKey") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1097,10 +1194,21 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacent if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1140,13 +1248,14 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacent return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersLabelsFindByKey", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersLabelsFindByKey", } if err != nil || localVarHTTPResponse == nil { @@ -1162,24 +1271,26 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacent if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1188,12 +1299,15 @@ func (a *LabelApiService) DatacentersServersLabelsFindByKeyExecute(r ApiDatacent } type ApiDatacentersServersLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1210,24 +1324,44 @@ func (r ApiDatacentersServersLabelsGetRequest) XContractNumber(xContractNumber i return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersLabelsGetRequest) Filter(key string, value string) ApiDatacentersServersLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersLabelsGetRequest) OrderBy(orderBy string) ApiDatacentersServersLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersLabelsGetRequest) MaxResults(maxResults int32) ApiDatacentersServersLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiDatacentersServersLabelsGetRequest) Execute() (LabelResources, *APIResponse, error) { return r.ApiService.DatacentersServersLabelsGetExecute(r) } /* - * DatacentersServersLabelsGet List all Server Labels - * You can retrieve a list of all labels associated with a server + * DatacentersServersLabelsGet List server labels + * List all the the labels for the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersLabelsGetRequest */ -func (a *LabelApiService) DatacentersServersLabelsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersLabelsGetRequest { +func (a *LabelsApiService) DatacentersServersLabelsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersLabelsGetRequest { return ApiDatacentersServersLabelsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, + filters: _neturl.Values{}, } } @@ -1235,7 +1369,7 @@ func (a *LabelApiService) DatacentersServersLabelsGet(ctx _context.Context, data * Execute executes the request * @return LabelResources */ -func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersServersLabelsGetRequest) (LabelResources, *APIResponse, error) { +func (a *LabelsApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersServersLabelsGetRequest) (LabelResources, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1245,7 +1379,7 @@ func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersSer localVarReturnValue LabelResources ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersServersLabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersServersLabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1260,10 +1394,34 @@ func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersSer if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1303,13 +1461,14 @@ func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersSer return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersLabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersLabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -1325,24 +1484,26 @@ func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersSer if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1351,13 +1512,13 @@ func (a *LabelApiService) DatacentersServersLabelsGetExecute(r ApiDatacentersSer } type ApiDatacentersServersLabelsPostRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - serverId string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + serverId string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1383,19 +1544,19 @@ func (r ApiDatacentersServersLabelsPostRequest) Execute() (LabelResource, *APIRe } /* - * DatacentersServersLabelsPost Add a Label to Server - * This will add a label to the server. + * DatacentersServersLabelsPost Create server labels + * Add a new label to the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersLabelsPostRequest */ -func (a *LabelApiService) DatacentersServersLabelsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersLabelsPostRequest { +func (a *LabelsApiService) DatacentersServersLabelsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersLabelsPostRequest { return ApiDatacentersServersLabelsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -1403,7 +1564,7 @@ func (a *LabelApiService) DatacentersServersLabelsPost(ctx _context.Context, dat * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersServersLabelsPostRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersServersLabelsPostRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1413,7 +1574,7 @@ func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersSe localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersServersLabelsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersServersLabelsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1431,10 +1592,21 @@ func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersSe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1476,13 +1648,14 @@ func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersSe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersLabelsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersLabelsPost", } if err != nil || localVarHTTPResponse == nil { @@ -1498,24 +1671,26 @@ func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersSe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1524,14 +1699,14 @@ func (a *LabelApiService) DatacentersServersLabelsPostExecute(r ApiDatacentersSe } type ApiDatacentersServersLabelsPutRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - serverId string - key string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + serverId string + key string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1557,21 +1732,21 @@ func (r ApiDatacentersServersLabelsPutRequest) Execute() (LabelResource, *APIRes } /* - * DatacentersServersLabelsPut Modify a Label of Server - * This will modify the value of the label on a server. + * DatacentersServersLabelsPut Modify server labels + * Modify the specified server label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param key The label key * @return ApiDatacentersServersLabelsPutRequest */ -func (a *LabelApiService) DatacentersServersLabelsPut(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsPutRequest { +func (a *LabelsApiService) DatacentersServersLabelsPut(ctx _context.Context, datacenterId string, serverId string, key string) ApiDatacentersServersLabelsPutRequest { return ApiDatacentersServersLabelsPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - key: key, + serverId: serverId, + key: key, } } @@ -1579,7 +1754,7 @@ func (a *LabelApiService) DatacentersServersLabelsPut(ctx _context.Context, data * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersServersLabelsPutRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersServersLabelsPutRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1589,7 +1764,7 @@ func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersSer localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersServersLabelsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersServersLabelsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1608,10 +1783,21 @@ func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersSer if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1653,13 +1839,14 @@ func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersSer return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersLabelsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersLabelsPut", } if err != nil || localVarHTTPResponse == nil { @@ -1675,24 +1862,26 @@ func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersSer if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1701,13 +1890,13 @@ func (a *LabelApiService) DatacentersServersLabelsPutExecute(r ApiDatacentersSer } type ApiDatacentersVolumesLabelsDeleteRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - volumeId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + volumeId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1724,46 +1913,44 @@ func (r ApiDatacentersVolumesLabelsDeleteRequest) XContractNumber(xContractNumbe return r } -func (r ApiDatacentersVolumesLabelsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersVolumesLabelsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersVolumesLabelsDeleteExecute(r) } /* - * DatacentersVolumesLabelsDelete Delete a Label from Volume - * This will remove a label from the volume. + * DatacentersVolumesLabelsDelete Delete volume labels + * Delete the specified volume label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param volumeId The unique ID of the Volume - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. + * @param key The label key * @return ApiDatacentersVolumesLabelsDeleteRequest */ -func (a *LabelApiService) DatacentersVolumesLabelsDelete(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsDeleteRequest { +func (a *LabelsApiService) DatacentersVolumesLabelsDelete(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsDeleteRequest { return ApiDatacentersVolumesLabelsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, - key: key, + volumeId: volumeId, + key: key, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LabelApiService) DatacentersVolumesLabelsDeleteExecute(r ApiDatacentersVolumesLabelsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LabelsApiService) DatacentersVolumesLabelsDeleteExecute(r ApiDatacentersVolumesLabelsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersVolumesLabelsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersVolumesLabelsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}" @@ -1777,10 +1964,21 @@ func (a *LabelApiService) DatacentersVolumesLabelsDeleteExecute(r ApiDatacenters if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1817,64 +2015,57 @@ func (a *LabelApiService) DatacentersVolumesLabelsDeleteExecute(r ApiDatacenters } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesLabelsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesLabelsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersVolumesLabelsFindByKeyRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - volumeId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + volumeId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1896,21 +2087,21 @@ func (r ApiDatacentersVolumesLabelsFindByKeyRequest) Execute() (LabelResource, * } /* - * DatacentersVolumesLabelsFindByKey Retrieve a Label of Volume - * This will retrieve the properties of a associated label to a volume. + * DatacentersVolumesLabelsFindByKey Retrieve volume labels + * Retrieve the properties of the specified volume label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param volumeId The unique ID of the Volume - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. + * @param key The label key * @return ApiDatacentersVolumesLabelsFindByKeyRequest */ -func (a *LabelApiService) DatacentersVolumesLabelsFindByKey(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsFindByKeyRequest { +func (a *LabelsApiService) DatacentersVolumesLabelsFindByKey(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsFindByKeyRequest { return ApiDatacentersVolumesLabelsFindByKeyRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, - key: key, + volumeId: volumeId, + key: key, } } @@ -1918,7 +2109,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKey(ctx _context.Context * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacentersVolumesLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacentersVolumesLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1928,7 +2119,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacent localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersVolumesLabelsFindByKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersVolumesLabelsFindByKey") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1944,10 +2135,21 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacent if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1987,13 +2189,14 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacent return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesLabelsFindByKey", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesLabelsFindByKey", } if err != nil || localVarHTTPResponse == nil { @@ -2009,24 +2212,26 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacent if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2035,12 +2240,15 @@ func (a *LabelApiService) DatacentersVolumesLabelsFindByKeyExecute(r ApiDatacent } type ApiDatacentersVolumesLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - volumeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + volumeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2057,24 +2265,44 @@ func (r ApiDatacentersVolumesLabelsGetRequest) XContractNumber(xContractNumber i return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersVolumesLabelsGetRequest) Filter(key string, value string) ApiDatacentersVolumesLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersVolumesLabelsGetRequest) OrderBy(orderBy string) ApiDatacentersVolumesLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersVolumesLabelsGetRequest) MaxResults(maxResults int32) ApiDatacentersVolumesLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiDatacentersVolumesLabelsGetRequest) Execute() (LabelResources, *APIResponse, error) { return r.ApiService.DatacentersVolumesLabelsGetExecute(r) } /* - * DatacentersVolumesLabelsGet List all Volume Labels - * You can retrieve a list of all labels associated with a volume + * DatacentersVolumesLabelsGet List volume labels + * List all the the labels for the specified volume. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesLabelsGetRequest */ -func (a *LabelApiService) DatacentersVolumesLabelsGet(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesLabelsGetRequest { +func (a *LabelsApiService) DatacentersVolumesLabelsGet(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesLabelsGetRequest { return ApiDatacentersVolumesLabelsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, + filters: _neturl.Values{}, } } @@ -2082,7 +2310,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsGet(ctx _context.Context, data * Execute executes the request * @return LabelResources */ -func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVolumesLabelsGetRequest) (LabelResources, *APIResponse, error) { +func (a *LabelsApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVolumesLabelsGetRequest) (LabelResources, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -2092,7 +2320,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVol localVarReturnValue LabelResources ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersVolumesLabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersVolumesLabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2107,10 +2335,34 @@ func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVol if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2150,13 +2402,14 @@ func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVol return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesLabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesLabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -2172,24 +2425,26 @@ func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVol if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2198,13 +2453,13 @@ func (a *LabelApiService) DatacentersVolumesLabelsGetExecute(r ApiDatacentersVol } type ApiDatacentersVolumesLabelsPostRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - volumeId string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + volumeId string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2230,19 +2485,19 @@ func (r ApiDatacentersVolumesLabelsPostRequest) Execute() (LabelResource, *APIRe } /* - * DatacentersVolumesLabelsPost Add a Label to Volume - * This will add a label to the volume. + * DatacentersVolumesLabelsPost Create volume labels + * Add a new label to the specified volume. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesLabelsPostRequest */ -func (a *LabelApiService) DatacentersVolumesLabelsPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesLabelsPostRequest { +func (a *LabelsApiService) DatacentersVolumesLabelsPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesLabelsPostRequest { return ApiDatacentersVolumesLabelsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } @@ -2250,7 +2505,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsPost(ctx _context.Context, dat * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVolumesLabelsPostRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVolumesLabelsPostRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -2260,7 +2515,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVo localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersVolumesLabelsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersVolumesLabelsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2278,10 +2533,21 @@ func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVo if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2323,13 +2589,14 @@ func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVo return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesLabelsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesLabelsPost", } if err != nil || localVarHTTPResponse == nil { @@ -2345,24 +2612,26 @@ func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVo if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2371,14 +2640,14 @@ func (a *LabelApiService) DatacentersVolumesLabelsPostExecute(r ApiDatacentersVo } type ApiDatacentersVolumesLabelsPutRequest struct { - ctx _context.Context - ApiService *LabelApiService - datacenterId string - volumeId string - key string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + datacenterId string + volumeId string + key string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2404,21 +2673,21 @@ func (r ApiDatacentersVolumesLabelsPutRequest) Execute() (LabelResource, *APIRes } /* - * DatacentersVolumesLabelsPut Modify a Label of Volume - * This will modify the value of the label on a volume. + * DatacentersVolumesLabelsPut Modify volume labels + * Modify the specified volume label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param volumeId The unique ID of the Volume - * @param key The key of the Label + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. + * @param key The label key * @return ApiDatacentersVolumesLabelsPutRequest */ -func (a *LabelApiService) DatacentersVolumesLabelsPut(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsPutRequest { +func (a *LabelsApiService) DatacentersVolumesLabelsPut(ctx _context.Context, datacenterId string, volumeId string, key string) ApiDatacentersVolumesLabelsPutRequest { return ApiDatacentersVolumesLabelsPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, - key: key, + volumeId: volumeId, + key: key, } } @@ -2426,7 +2695,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsPut(ctx _context.Context, data * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVolumesLabelsPutRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVolumesLabelsPutRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -2436,7 +2705,7 @@ func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVol localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.DatacentersVolumesLabelsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.DatacentersVolumesLabelsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2455,10 +2724,21 @@ func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVol if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2500,13 +2780,14 @@ func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVol return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesLabelsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesLabelsPut", } if err != nil || localVarHTTPResponse == nil { @@ -2522,24 +2803,26 @@ func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVol if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2548,12 +2831,12 @@ func (a *LabelApiService) DatacentersVolumesLabelsPutExecute(r ApiDatacentersVol } type ApiIpblocksLabelsDeleteRequest struct { - ctx _context.Context - ApiService *LabelApiService - ipblockId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + ipblockId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2570,44 +2853,42 @@ func (r ApiIpblocksLabelsDeleteRequest) XContractNumber(xContractNumber int32) A return r } -func (r ApiIpblocksLabelsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiIpblocksLabelsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.IpblocksLabelsDeleteExecute(r) } /* - * IpblocksLabelsDelete Delete a Label from IP Block - * This will remove a label from the Ip Block. + * IpblocksLabelsDelete Delete IP block labels + * Delete the specified IP block label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId The unique ID of the Ip Block - * @param key The key of the Label + * @param ipblockId The unique ID of the IP block. + * @param key The label key * @return ApiIpblocksLabelsDeleteRequest */ -func (a *LabelApiService) IpblocksLabelsDelete(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsDeleteRequest { +func (a *LabelsApiService) IpblocksLabelsDelete(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsDeleteRequest { return ApiIpblocksLabelsDeleteRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, - key: key, + ctx: ctx, + ipblockId: ipblockId, + key: key, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LabelApiService) IpblocksLabelsDeleteExecute(r ApiIpblocksLabelsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LabelsApiService) IpblocksLabelsDeleteExecute(r ApiIpblocksLabelsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.IpblocksLabelsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.IpblocksLabelsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/ipblocks/{ipblockId}/labels/{key}" @@ -2620,10 +2901,21 @@ func (a *LabelApiService) IpblocksLabelsDeleteExecute(r ApiIpblocksLabelsDeleteR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2660,63 +2952,56 @@ func (a *LabelApiService) IpblocksLabelsDeleteExecute(r ApiIpblocksLabelsDeleteR } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksLabelsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksLabelsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiIpblocksLabelsFindByKeyRequest struct { - ctx _context.Context - ApiService *LabelApiService - ipblockId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + ipblockId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2738,19 +3023,19 @@ func (r ApiIpblocksLabelsFindByKeyRequest) Execute() (LabelResource, *APIRespons } /* - * IpblocksLabelsFindByKey Retrieve a Label of IP Block - * This will retrieve the properties of a associated label to a Ip Block. + * IpblocksLabelsFindByKey Retrieve IP block labels + * Retrieve the properties of the specified IP block label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId The unique ID of the Ip Block - * @param key The key of the Label + * @param ipblockId The unique ID of the IP block. + * @param key The label key * @return ApiIpblocksLabelsFindByKeyRequest */ -func (a *LabelApiService) IpblocksLabelsFindByKey(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsFindByKeyRequest { +func (a *LabelsApiService) IpblocksLabelsFindByKey(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsFindByKeyRequest { return ApiIpblocksLabelsFindByKeyRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, - key: key, + ctx: ctx, + ipblockId: ipblockId, + key: key, } } @@ -2758,7 +3043,7 @@ func (a *LabelApiService) IpblocksLabelsFindByKey(ctx _context.Context, ipblockI * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -2768,7 +3053,7 @@ func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFind localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.IpblocksLabelsFindByKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.IpblocksLabelsFindByKey") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2783,10 +3068,21 @@ func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFind if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2826,13 +3122,14 @@ func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFind return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksLabelsFindByKey", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksLabelsFindByKey", } if err != nil || localVarHTTPResponse == nil { @@ -2848,24 +3145,26 @@ func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFind if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2874,11 +3173,14 @@ func (a *LabelApiService) IpblocksLabelsFindByKeyExecute(r ApiIpblocksLabelsFind } type ApiIpblocksLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - ipblockId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + ipblockId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2895,22 +3197,42 @@ func (r ApiIpblocksLabelsGetRequest) XContractNumber(xContractNumber int32) ApiI return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiIpblocksLabelsGetRequest) Filter(key string, value string) ApiIpblocksLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiIpblocksLabelsGetRequest) OrderBy(orderBy string) ApiIpblocksLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiIpblocksLabelsGetRequest) MaxResults(maxResults int32) ApiIpblocksLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiIpblocksLabelsGetRequest) Execute() (LabelResources, *APIResponse, error) { return r.ApiService.IpblocksLabelsGetExecute(r) } /* - * IpblocksLabelsGet List all Ip Block Labels - * You can retrieve a list of all labels associated with a IP Block + * IpblocksLabelsGet List IP block labels + * List all the the labels for the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId The unique ID of the Ip Block + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksLabelsGetRequest */ -func (a *LabelApiService) IpblocksLabelsGet(ctx _context.Context, ipblockId string) ApiIpblocksLabelsGetRequest { +func (a *LabelsApiService) IpblocksLabelsGet(ctx _context.Context, ipblockId string) ApiIpblocksLabelsGetRequest { return ApiIpblocksLabelsGetRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, + filters: _neturl.Values{}, } } @@ -2918,7 +3240,7 @@ func (a *LabelApiService) IpblocksLabelsGet(ctx _context.Context, ipblockId stri * Execute executes the request * @return LabelResources */ -func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest) (LabelResources, *APIResponse, error) { +func (a *LabelsApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest) (LabelResources, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -2928,7 +3250,7 @@ func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest localVarReturnValue LabelResources ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.IpblocksLabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.IpblocksLabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2942,10 +3264,34 @@ func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2985,13 +3331,14 @@ func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksLabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksLabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -3007,24 +3354,26 @@ func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3033,12 +3382,12 @@ func (a *LabelApiService) IpblocksLabelsGetExecute(r ApiIpblocksLabelsGetRequest } type ApiIpblocksLabelsPostRequest struct { - ctx _context.Context - ApiService *LabelApiService - ipblockId string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + ipblockId string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3064,17 +3413,17 @@ func (r ApiIpblocksLabelsPostRequest) Execute() (LabelResource, *APIResponse, er } /* - * IpblocksLabelsPost Add a Label to IP Block - * This will add a label to the Ip Block. + * IpblocksLabelsPost Create IP block labels + * Add a new label to the specified IP block. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId The unique ID of the Ip Block + * @param ipblockId The unique ID of the IP block. * @return ApiIpblocksLabelsPostRequest */ -func (a *LabelApiService) IpblocksLabelsPost(ctx _context.Context, ipblockId string) ApiIpblocksLabelsPostRequest { +func (a *LabelsApiService) IpblocksLabelsPost(ctx _context.Context, ipblockId string) ApiIpblocksLabelsPostRequest { return ApiIpblocksLabelsPostRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, + ctx: ctx, + ipblockId: ipblockId, } } @@ -3082,7 +3431,7 @@ func (a *LabelApiService) IpblocksLabelsPost(ctx _context.Context, ipblockId str * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -3092,7 +3441,7 @@ func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostReque localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.IpblocksLabelsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.IpblocksLabelsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -3109,10 +3458,21 @@ func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostReque if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3154,13 +3514,14 @@ func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostReque return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksLabelsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksLabelsPost", } if err != nil || localVarHTTPResponse == nil { @@ -3176,24 +3537,26 @@ func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostReque if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3202,13 +3565,13 @@ func (a *LabelApiService) IpblocksLabelsPostExecute(r ApiIpblocksLabelsPostReque } type ApiIpblocksLabelsPutRequest struct { - ctx _context.Context - ApiService *LabelApiService - ipblockId string - key string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + ipblockId string + key string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3234,19 +3597,19 @@ func (r ApiIpblocksLabelsPutRequest) Execute() (LabelResource, *APIResponse, err } /* - * IpblocksLabelsPut Modify a Label of IP Block - * This will modify the value of the label on a Ip Block. + * IpblocksLabelsPut Modify IP block labels + * Modify the specified IP block label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param ipblockId The unique ID of the Ip Block - * @param key The key of the Label + * @param ipblockId The unique ID of the IP block. + * @param key The label key * @return ApiIpblocksLabelsPutRequest */ -func (a *LabelApiService) IpblocksLabelsPut(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsPutRequest { +func (a *LabelsApiService) IpblocksLabelsPut(ctx _context.Context, ipblockId string, key string) ApiIpblocksLabelsPutRequest { return ApiIpblocksLabelsPutRequest{ ApiService: a, - ctx: ctx, - ipblockId: ipblockId, - key: key, + ctx: ctx, + ipblockId: ipblockId, + key: key, } } @@ -3254,7 +3617,7 @@ func (a *LabelApiService) IpblocksLabelsPut(ctx _context.Context, ipblockId stri * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -3264,7 +3627,7 @@ func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.IpblocksLabelsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.IpblocksLabelsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -3282,10 +3645,21 @@ func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3327,13 +3701,14 @@ func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "IpblocksLabelsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "IpblocksLabelsPut", } if err != nil || localVarHTTPResponse == nil { @@ -3349,24 +3724,26 @@ func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3374,44 +3751,48 @@ func (a *LabelApiService) IpblocksLabelsPutExecute(r ApiIpblocksLabelsPutRequest return localVarReturnValue, localVarAPIResponse, nil } -type ApiLabelsFindByLabelurnRequest struct { - ctx _context.Context - ApiService *LabelApiService - labelurn string - pretty *bool - depth *int32 +type ApiLabelsFindByUrnRequest struct { + ctx _context.Context + ApiService *LabelsApiService + labelurn string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiLabelsFindByLabelurnRequest) Pretty(pretty bool) ApiLabelsFindByLabelurnRequest { +func (r ApiLabelsFindByUrnRequest) Pretty(pretty bool) ApiLabelsFindByUrnRequest { r.pretty = &pretty return r } -func (r ApiLabelsFindByLabelurnRequest) Depth(depth int32) ApiLabelsFindByLabelurnRequest { +func (r ApiLabelsFindByUrnRequest) Depth(depth int32) ApiLabelsFindByUrnRequest { r.depth = &depth return r } -func (r ApiLabelsFindByLabelurnRequest) XContractNumber(xContractNumber int32) ApiLabelsFindByLabelurnRequest { +func (r ApiLabelsFindByUrnRequest) XContractNumber(xContractNumber int32) ApiLabelsFindByUrnRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiLabelsFindByLabelurnRequest) Execute() (Label, *APIResponse, error) { - return r.ApiService.LabelsFindByLabelurnExecute(r) +func (r ApiLabelsFindByUrnRequest) Execute() (Label, *APIResponse, error) { + return r.ApiService.LabelsFindByUrnExecute(r) } /* - * LabelsFindByLabelurn Returns the label by its URN. - * You can retrieve the details of a specific label using its URN. A URN is for uniqueness of a Label and composed using urn:label::: + * LabelsFindByUrn Retrieve labels by URN + * Retrieve a label by label URN. + +The URN is unique for each label, and consists of: + +urn:label::: * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param labelurn The URN representing the unique ID of the label. A URN is for uniqueness of a Label and composed using urn:label::: - * @return ApiLabelsFindByLabelurnRequest - */ -func (a *LabelApiService) LabelsFindByLabelurn(ctx _context.Context, labelurn string) ApiLabelsFindByLabelurnRequest { - return ApiLabelsFindByLabelurnRequest{ + * @param labelurn The label URN; URN is unique for each label, and consists of: urn:label::: + * @return ApiLabelsFindByUrnRequest +*/ +func (a *LabelsApiService) LabelsFindByUrn(ctx _context.Context, labelurn string) ApiLabelsFindByUrnRequest { + return ApiLabelsFindByUrnRequest{ ApiService: a, - ctx: ctx, - labelurn: labelurn, + ctx: ctx, + labelurn: labelurn, } } @@ -3419,7 +3800,7 @@ func (a *LabelApiService) LabelsFindByLabelurn(ctx _context.Context, labelurn st * Execute executes the request * @return Label */ -func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnRequest) (Label, *APIResponse, error) { +func (a *LabelsApiService) LabelsFindByUrnExecute(r ApiLabelsFindByUrnRequest) (Label, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -3429,7 +3810,7 @@ func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnR localVarReturnValue Label ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.LabelsFindByLabelurn") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.LabelsFindByUrn") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -3443,10 +3824,21 @@ func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3486,13 +3878,14 @@ func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnR return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "LabelsFindByLabelurn", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "LabelsFindByUrn", } if err != nil || localVarHTTPResponse == nil { @@ -3508,24 +3901,26 @@ func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnR if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3534,10 +3929,13 @@ func (a *LabelApiService) LabelsFindByLabelurnExecute(r ApiLabelsFindByLabelurnR } type ApiLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3554,20 +3952,40 @@ func (r ApiLabelsGetRequest) XContractNumber(xContractNumber int32) ApiLabelsGet return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiLabelsGetRequest) Filter(key string, value string) ApiLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiLabelsGetRequest) OrderBy(orderBy string) ApiLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiLabelsGetRequest) MaxResults(maxResults int32) ApiLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiLabelsGetRequest) Execute() (Labels, *APIResponse, error) { return r.ApiService.LabelsGetExecute(r) } /* - * LabelsGet List Labels - * You can retrieve a complete list of labels that you have access to. + * LabelsGet List labels + * List all available labels. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiLabelsGetRequest */ -func (a *LabelApiService) LabelsGet(ctx _context.Context) ApiLabelsGetRequest { +func (a *LabelsApiService) LabelsGet(ctx _context.Context) ApiLabelsGetRequest { return ApiLabelsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -3575,7 +3993,7 @@ func (a *LabelApiService) LabelsGet(ctx _context.Context) ApiLabelsGetRequest { * Execute executes the request * @return Labels */ -func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIResponse, error) { +func (a *LabelsApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -3585,7 +4003,7 @@ func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIR localVarReturnValue Labels ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.LabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.LabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -3598,10 +4016,34 @@ func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3641,13 +4083,14 @@ func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIR return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "LabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "LabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -3663,24 +4106,26 @@ func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIR if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3689,12 +4134,12 @@ func (a *LabelApiService) LabelsGetExecute(r ApiLabelsGetRequest) (Labels, *APIR } type ApiSnapshotsLabelsDeleteRequest struct { - ctx _context.Context - ApiService *LabelApiService - snapshotId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + snapshotId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3711,44 +4156,42 @@ func (r ApiSnapshotsLabelsDeleteRequest) XContractNumber(xContractNumber int32) return r } -func (r ApiSnapshotsLabelsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiSnapshotsLabelsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.SnapshotsLabelsDeleteExecute(r) } /* - * SnapshotsLabelsDelete Delete a Label from Snapshot - * This will remove a label from the snapshot. + * SnapshotsLabelsDelete Delete snapshot labels + * Delete the specified snapshot label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot - * @param key The key of the Label + * @param snapshotId The unique ID of the snapshot. + * @param key The label key * @return ApiSnapshotsLabelsDeleteRequest */ -func (a *LabelApiService) SnapshotsLabelsDelete(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsDeleteRequest { +func (a *LabelsApiService) SnapshotsLabelsDelete(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsDeleteRequest { return ApiSnapshotsLabelsDeleteRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, - key: key, + key: key, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LabelApiService) SnapshotsLabelsDeleteExecute(r ApiSnapshotsLabelsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LabelsApiService) SnapshotsLabelsDeleteExecute(r ApiSnapshotsLabelsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.SnapshotsLabelsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.SnapshotsLabelsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/snapshots/{snapshotId}/labels/{key}" @@ -3761,10 +4204,21 @@ func (a *LabelApiService) SnapshotsLabelsDeleteExecute(r ApiSnapshotsLabelsDelet if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3801,63 +4255,56 @@ func (a *LabelApiService) SnapshotsLabelsDeleteExecute(r ApiSnapshotsLabelsDelet } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsLabelsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsLabelsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiSnapshotsLabelsFindByKeyRequest struct { - ctx _context.Context - ApiService *LabelApiService - snapshotId string - key string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + snapshotId string + key string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3879,19 +4326,19 @@ func (r ApiSnapshotsLabelsFindByKeyRequest) Execute() (LabelResource, *APIRespon } /* - * SnapshotsLabelsFindByKey Retrieve a Label of Snapshot - * This will retrieve the properties of a associated label to a snapshot. + * SnapshotsLabelsFindByKey Retrieve snapshot labels + * Retrieve the properties of the specified snapshot label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot - * @param key The key of the Label + * @param snapshotId The unique ID of the snapshot. + * @param key The label key * @return ApiSnapshotsLabelsFindByKeyRequest */ -func (a *LabelApiService) SnapshotsLabelsFindByKey(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsFindByKeyRequest { +func (a *LabelsApiService) SnapshotsLabelsFindByKey(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsFindByKeyRequest { return ApiSnapshotsLabelsFindByKeyRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, - key: key, + key: key, } } @@ -3899,7 +4346,7 @@ func (a *LabelApiService) SnapshotsLabelsFindByKey(ctx _context.Context, snapsho * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFindByKeyRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -3909,7 +4356,7 @@ func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFi localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.SnapshotsLabelsFindByKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.SnapshotsLabelsFindByKey") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -3924,10 +4371,21 @@ func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFi if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3967,13 +4425,14 @@ func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFi return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsLabelsFindByKey", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsLabelsFindByKey", } if err != nil || localVarHTTPResponse == nil { @@ -3989,24 +4448,26 @@ func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFi if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -4015,11 +4476,14 @@ func (a *LabelApiService) SnapshotsLabelsFindByKeyExecute(r ApiSnapshotsLabelsFi } type ApiSnapshotsLabelsGetRequest struct { - ctx _context.Context - ApiService *LabelApiService - snapshotId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + snapshotId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -4036,22 +4500,42 @@ func (r ApiSnapshotsLabelsGetRequest) XContractNumber(xContractNumber int32) Api return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiSnapshotsLabelsGetRequest) Filter(key string, value string) ApiSnapshotsLabelsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiSnapshotsLabelsGetRequest) OrderBy(orderBy string) ApiSnapshotsLabelsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiSnapshotsLabelsGetRequest) MaxResults(maxResults int32) ApiSnapshotsLabelsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiSnapshotsLabelsGetRequest) Execute() (LabelResources, *APIResponse, error) { return r.ApiService.SnapshotsLabelsGetExecute(r) } /* - * SnapshotsLabelsGet List all Snapshot Labels - * You can retrieve a list of all labels associated with a snapshot + * SnapshotsLabelsGet List snapshot labels + * List all the the labels for the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsLabelsGetRequest */ -func (a *LabelApiService) SnapshotsLabelsGet(ctx _context.Context, snapshotId string) ApiSnapshotsLabelsGetRequest { +func (a *LabelsApiService) SnapshotsLabelsGet(ctx _context.Context, snapshotId string) ApiSnapshotsLabelsGetRequest { return ApiSnapshotsLabelsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, + filters: _neturl.Values{}, } } @@ -4059,7 +4543,7 @@ func (a *LabelApiService) SnapshotsLabelsGet(ctx _context.Context, snapshotId st * Execute executes the request * @return LabelResources */ -func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetRequest) (LabelResources, *APIResponse, error) { +func (a *LabelsApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetRequest) (LabelResources, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -4069,7 +4553,7 @@ func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetReque localVarReturnValue LabelResources ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.SnapshotsLabelsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.SnapshotsLabelsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -4083,10 +4567,34 @@ func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetReque if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4126,13 +4634,14 @@ func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetReque return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsLabelsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsLabelsGet", } if err != nil || localVarHTTPResponse == nil { @@ -4148,24 +4657,26 @@ func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetReque if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -4174,12 +4685,12 @@ func (a *LabelApiService) SnapshotsLabelsGetExecute(r ApiSnapshotsLabelsGetReque } type ApiSnapshotsLabelsPostRequest struct { - ctx _context.Context - ApiService *LabelApiService - snapshotId string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + snapshotId string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -4205,16 +4716,16 @@ func (r ApiSnapshotsLabelsPostRequest) Execute() (LabelResource, *APIResponse, e } /* - * SnapshotsLabelsPost Add a Label to Snapshot - * This will add a label to the snapshot. + * SnapshotsLabelsPost Create snapshot labels + * Add a new label to the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsLabelsPostRequest */ -func (a *LabelApiService) SnapshotsLabelsPost(ctx _context.Context, snapshotId string) ApiSnapshotsLabelsPostRequest { +func (a *LabelsApiService) SnapshotsLabelsPost(ctx _context.Context, snapshotId string) ApiSnapshotsLabelsPostRequest { return ApiSnapshotsLabelsPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, } } @@ -4223,7 +4734,7 @@ func (a *LabelApiService) SnapshotsLabelsPost(ctx _context.Context, snapshotId s * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -4233,7 +4744,7 @@ func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostReq localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.SnapshotsLabelsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.SnapshotsLabelsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -4250,10 +4761,21 @@ func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostReq if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4295,13 +4817,14 @@ func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostReq return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsLabelsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsLabelsPost", } if err != nil || localVarHTTPResponse == nil { @@ -4317,24 +4840,26 @@ func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostReq if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -4343,13 +4868,13 @@ func (a *LabelApiService) SnapshotsLabelsPostExecute(r ApiSnapshotsLabelsPostReq } type ApiSnapshotsLabelsPutRequest struct { - ctx _context.Context - ApiService *LabelApiService - snapshotId string - key string - label *LabelResource - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LabelsApiService + snapshotId string + key string + label *LabelResource + pretty *bool + depth *int32 xContractNumber *int32 } @@ -4375,19 +4900,19 @@ func (r ApiSnapshotsLabelsPutRequest) Execute() (LabelResource, *APIResponse, er } /* - * SnapshotsLabelsPut Modify a Label of Snapshot - * This will modify the value of the label on a snapshot. + * SnapshotsLabelsPut Modify snapshot labels + * Modify the specified snapshot label. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot - * @param key The key of the Label + * @param snapshotId The unique ID of the snapshot. + * @param key The label key * @return ApiSnapshotsLabelsPutRequest */ -func (a *LabelApiService) SnapshotsLabelsPut(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsPutRequest { +func (a *LabelsApiService) SnapshotsLabelsPut(ctx _context.Context, snapshotId string, key string) ApiSnapshotsLabelsPutRequest { return ApiSnapshotsLabelsPutRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, - key: key, + key: key, } } @@ -4395,7 +4920,7 @@ func (a *LabelApiService) SnapshotsLabelsPut(ctx _context.Context, snapshotId st * Execute executes the request * @return LabelResource */ -func (a *LabelApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutRequest) (LabelResource, *APIResponse, error) { +func (a *LabelsApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutRequest) (LabelResource, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -4405,7 +4930,7 @@ func (a *LabelApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutReque localVarReturnValue LabelResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelApiService.SnapshotsLabelsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LabelsApiService.SnapshotsLabelsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -4423,10 +4948,21 @@ func (a *LabelApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutReque if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4468,13 +5004,14 @@ func (a *LabelApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutReque return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsLabelsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsLabelsPut", } if err != nil || localVarHTTPResponse == nil { @@ -4490,24 +5027,26 @@ func (a *LabelApiService) SnapshotsLabelsPutExecute(r ApiSnapshotsLabelsPutReque if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lan.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lans.go similarity index 62% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lan.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lans.go index 98d93bbf9212..b443586c2db6 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lan.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_lans.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,16 +24,16 @@ var ( _ _context.Context ) -// LanApiService LanApi service -type LanApiService service +// LANsApiService LANsApi service +type LANsApiService service type ApiDatacentersLansDeleteRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -49,44 +50,42 @@ func (r ApiDatacentersLansDeleteRequest) XContractNumber(xContractNumber int32) return r } -func (r ApiDatacentersLansDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersLansDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersLansDeleteExecute(r) } /* - * DatacentersLansDelete Delete a Lan. - * Removes the specific Lan + * DatacentersLansDelete Delete LANs + * Delete the specified LAN within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansDeleteRequest */ -func (a *LanApiService) DatacentersLansDelete(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansDeleteRequest { +func (a *LANsApiService) DatacentersLansDelete(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansDeleteRequest { return ApiDatacentersLansDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LanApiService) DatacentersLansDeleteExecute(r ApiDatacentersLansDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansDeleteExecute(r ApiDatacentersLansDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/lans/{lanId}" @@ -99,10 +98,21 @@ func (a *LanApiService) DatacentersLansDeleteExecute(r ApiDatacentersLansDeleteR if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -139,63 +149,56 @@ func (a *LanApiService) DatacentersLansDeleteExecute(r ApiDatacentersLansDeleteR } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersLansFindByIdRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -217,19 +220,19 @@ func (r ApiDatacentersLansFindByIdRequest) Execute() (Lan, *APIResponse, error) } /* - * DatacentersLansFindById Retrieve a Lan - * Retrieves the attributes of a given LAN + * DatacentersLansFindById Retrieve LANs + * Retrieve the properties of the specified LAN within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansFindByIdRequest */ -func (a *LanApiService) DatacentersLansFindById(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansFindByIdRequest { +func (a *LANsApiService) DatacentersLansFindById(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansFindByIdRequest { return ApiDatacentersLansFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, } } @@ -237,7 +240,7 @@ func (a *LanApiService) DatacentersLansFindById(ctx _context.Context, datacenter * Execute executes the request * @return Lan */ -func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindByIdRequest) (Lan, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindByIdRequest) (Lan, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -247,7 +250,7 @@ func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindB localVarReturnValue Lan ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -262,10 +265,21 @@ func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindB if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -305,13 +319,14 @@ func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindB return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansFindById", } if err != nil || localVarHTTPResponse == nil { @@ -327,24 +342,26 @@ func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindB if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -353,12 +370,17 @@ func (a *LanApiService) DatacentersLansFindByIdExecute(r ApiDatacentersLansFindB } type ApiDatacentersLansGetRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersLansGetRequest) Pretty(pretty bool) ApiDatacentersLansGetRequest { @@ -373,23 +395,51 @@ func (r ApiDatacentersLansGetRequest) XContractNumber(xContractNumber int32) Api r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersLansGetRequest) Offset(offset int32) ApiDatacentersLansGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersLansGetRequest) Limit(limit int32) ApiDatacentersLansGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersLansGetRequest) Filter(key string, value string) ApiDatacentersLansGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersLansGetRequest) OrderBy(orderBy string) ApiDatacentersLansGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersLansGetRequest) MaxResults(maxResults int32) ApiDatacentersLansGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersLansGetRequest) Execute() (Lans, *APIResponse, error) { return r.ApiService.DatacentersLansGetExecute(r) } /* - * DatacentersLansGet List Lans - * Retrieve a list of LANs within the datacenter + * DatacentersLansGet List LANs + * List all LANs within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLansGetRequest */ -func (a *LanApiService) DatacentersLansGet(ctx _context.Context, datacenterId string) ApiDatacentersLansGetRequest { +func (a *LANsApiService) DatacentersLansGet(ctx _context.Context, datacenterId string) ApiDatacentersLansGetRequest { return ApiDatacentersLansGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, + filters: _neturl.Values{}, } } @@ -397,7 +447,7 @@ func (a *LanApiService) DatacentersLansGet(ctx _context.Context, datacenterId st * Execute executes the request * @return Lans */ -func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest) (Lans, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest) (Lans, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -407,7 +457,7 @@ func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest localVarReturnValue Lans ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -421,10 +471,50 @@ func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -464,13 +554,14 @@ func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansGet", } if err != nil || localVarHTTPResponse == nil { @@ -486,24 +577,26 @@ func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -512,13 +605,13 @@ func (a *LanApiService) DatacentersLansGetExecute(r ApiDatacentersLansGetRequest } type ApiDatacentersLansNicsFindByIdRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - nicId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + nicId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -540,21 +633,21 @@ func (r ApiDatacentersLansNicsFindByIdRequest) Execute() (Nic, *APIResponse, err } /* - * DatacentersLansNicsFindById Retrieve a nic attached to lan - * This will retrieve the properties of an attached nic. + * DatacentersLansNicsFindById Retrieve attached NICs + * Retrieve the properties of the NIC, attached to the specified LAN. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN - * @param nicId The unique ID of the NIC + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. + * @param nicId The unique ID of the NIC. * @return ApiDatacentersLansNicsFindByIdRequest */ -func (a *LanApiService) DatacentersLansNicsFindById(ctx _context.Context, datacenterId string, lanId string, nicId string) ApiDatacentersLansNicsFindByIdRequest { +func (a *LANsApiService) DatacentersLansNicsFindById(ctx _context.Context, datacenterId string, lanId string, nicId string) ApiDatacentersLansNicsFindByIdRequest { return ApiDatacentersLansNicsFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, - nicId: nicId, + lanId: lanId, + nicId: nicId, } } @@ -562,7 +655,7 @@ func (a *LanApiService) DatacentersLansNicsFindById(ctx _context.Context, datace * Execute executes the request * @return Nic */ -func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansNicsFindByIdRequest) (Nic, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansNicsFindByIdRequest) (Nic, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -572,7 +665,7 @@ func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansN localVarReturnValue Nic ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansNicsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansNicsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -588,10 +681,21 @@ func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansN if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -631,13 +735,14 @@ func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansN return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansNicsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansNicsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -653,24 +758,26 @@ func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansN if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -679,13 +786,18 @@ func (a *LanApiService) DatacentersLansNicsFindByIdExecute(r ApiDatacentersLansN } type ApiDatacentersLansNicsGetRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + lanId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersLansNicsGetRequest) Pretty(pretty bool) ApiDatacentersLansNicsGetRequest { @@ -700,25 +812,53 @@ func (r ApiDatacentersLansNicsGetRequest) XContractNumber(xContractNumber int32) r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersLansNicsGetRequest) Offset(offset int32) ApiDatacentersLansNicsGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersLansNicsGetRequest) Limit(limit int32) ApiDatacentersLansNicsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersLansNicsGetRequest) Filter(key string, value string) ApiDatacentersLansNicsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersLansNicsGetRequest) OrderBy(orderBy string) ApiDatacentersLansNicsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersLansNicsGetRequest) MaxResults(maxResults int32) ApiDatacentersLansNicsGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersLansNicsGetRequest) Execute() (LanNics, *APIResponse, error) { return r.ApiService.DatacentersLansNicsGetExecute(r) } /* - * DatacentersLansNicsGet List Lan Members - * You can retrieve a list of nics attached to a lan + * DatacentersLansNicsGet List LAN members + * List all NICs, attached to the specified LAN. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansNicsGetRequest */ -func (a *LanApiService) DatacentersLansNicsGet(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansNicsGetRequest { +func (a *LANsApiService) DatacentersLansNicsGet(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansNicsGetRequest { return ApiDatacentersLansNicsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, + filters: _neturl.Values{}, } } @@ -726,7 +866,7 @@ func (a *LanApiService) DatacentersLansNicsGet(ctx _context.Context, datacenterI * Execute executes the request * @return LanNics */ -func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGetRequest) (LanNics, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGetRequest) (LanNics, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -736,7 +876,7 @@ func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGe localVarReturnValue LanNics ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansNicsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansNicsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -751,10 +891,50 @@ func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -794,13 +974,14 @@ func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansNicsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansNicsGet", } if err != nil || localVarHTTPResponse == nil { @@ -816,24 +997,26 @@ func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -842,13 +1025,13 @@ func (a *LanApiService) DatacentersLansNicsGetExecute(r ApiDatacentersLansNicsGe } type ApiDatacentersLansNicsPostRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - nic *Nic - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + nic *Nic + pretty *bool + depth *int32 xContractNumber *int32 } @@ -874,19 +1057,19 @@ func (r ApiDatacentersLansNicsPostRequest) Execute() (Nic, *APIResponse, error) } /* - * DatacentersLansNicsPost Attach a nic - * This will attach a pre-existing nic to a lan. + * DatacentersLansNicsPost Attach NICs + * Attach an existing NIC to the specified LAN. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansNicsPostRequest */ -func (a *LanApiService) DatacentersLansNicsPost(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansNicsPostRequest { +func (a *LANsApiService) DatacentersLansNicsPost(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansNicsPostRequest { return ApiDatacentersLansNicsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, } } @@ -894,7 +1077,7 @@ func (a *LanApiService) DatacentersLansNicsPost(ctx _context.Context, datacenter * Execute executes the request * @return Nic */ -func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsPostRequest) (Nic, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsPostRequest) (Nic, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -904,7 +1087,7 @@ func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsP localVarReturnValue Nic ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansNicsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansNicsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -922,10 +1105,21 @@ func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsP if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -967,13 +1161,14 @@ func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsP return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansNicsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansNicsPost", } if err != nil || localVarHTTPResponse == nil { @@ -989,24 +1184,26 @@ func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsP if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1015,13 +1212,13 @@ func (a *LanApiService) DatacentersLansNicsPostExecute(r ApiDatacentersLansNicsP } type ApiDatacentersLansPatchRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - lan *LanProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + lan *LanProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1047,19 +1244,19 @@ func (r ApiDatacentersLansPatchRequest) Execute() (Lan, *APIResponse, error) { } /* - * DatacentersLansPatch Partially modify a Lan - * You can use update attributes of a resource + * DatacentersLansPatch Partially modify LANs + * Update the properties of the specified LAN within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansPatchRequest */ -func (a *LanApiService) DatacentersLansPatch(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansPatchRequest { +func (a *LANsApiService) DatacentersLansPatch(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansPatchRequest { return ApiDatacentersLansPatchRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, } } @@ -1067,7 +1264,7 @@ func (a *LanApiService) DatacentersLansPatch(ctx _context.Context, datacenterId * Execute executes the request * @return Lan */ -func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchRequest) (Lan, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchRequest) (Lan, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -1077,7 +1274,7 @@ func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchReq localVarReturnValue Lan ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1095,10 +1292,21 @@ func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchReq if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1140,13 +1348,14 @@ func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchReq return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansPatch", } if err != nil || localVarHTTPResponse == nil { @@ -1162,24 +1371,26 @@ func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchReq if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1188,12 +1399,12 @@ func (a *LanApiService) DatacentersLansPatchExecute(r ApiDatacentersLansPatchReq } type ApiDatacentersLansPostRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lan *LanPost - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lan *LanPost + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1219,16 +1430,16 @@ func (r ApiDatacentersLansPostRequest) Execute() (LanPost, *APIResponse, error) } /* - * DatacentersLansPost Create a Lan - * Creates a LAN within the datacenter + * DatacentersLansPost Create LANs + * Create a LAN within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLansPostRequest */ -func (a *LanApiService) DatacentersLansPost(ctx _context.Context, datacenterId string) ApiDatacentersLansPostRequest { +func (a *LANsApiService) DatacentersLansPost(ctx _context.Context, datacenterId string) ApiDatacentersLansPostRequest { return ApiDatacentersLansPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -1237,7 +1448,7 @@ func (a *LanApiService) DatacentersLansPost(ctx _context.Context, datacenterId s * Execute executes the request * @return LanPost */ -func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostRequest) (LanPost, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostRequest) (LanPost, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1247,7 +1458,7 @@ func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostReque localVarReturnValue LanPost ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1264,10 +1475,21 @@ func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostReque if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1309,13 +1531,14 @@ func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostReque return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansPost", } if err != nil || localVarHTTPResponse == nil { @@ -1331,24 +1554,26 @@ func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostReque if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1357,13 +1582,13 @@ func (a *LanApiService) DatacentersLansPostExecute(r ApiDatacentersLansPostReque } type ApiDatacentersLansPutRequest struct { - ctx _context.Context - ApiService *LanApiService - datacenterId string - lanId string - lan *Lan - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LANsApiService + datacenterId string + lanId string + lan *Lan + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1389,19 +1614,19 @@ func (r ApiDatacentersLansPutRequest) Execute() (Lan, *APIResponse, error) { } /* - * DatacentersLansPut Modify a Lan - * You can use update attributes of a resource + * DatacentersLansPut Modify LANs + * Modify the properties of the specified LAN within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param lanId The unique ID of the LAN + * @param datacenterId The unique ID of the data center. + * @param lanId The unique ID of the LAN. * @return ApiDatacentersLansPutRequest */ -func (a *LanApiService) DatacentersLansPut(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansPutRequest { +func (a *LANsApiService) DatacentersLansPut(ctx _context.Context, datacenterId string, lanId string) ApiDatacentersLansPutRequest { return ApiDatacentersLansPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - lanId: lanId, + lanId: lanId, } } @@ -1409,7 +1634,7 @@ func (a *LanApiService) DatacentersLansPut(ctx _context.Context, datacenterId st * Execute executes the request * @return Lan */ -func (a *LanApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest) (Lan, *APIResponse, error) { +func (a *LANsApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest) (Lan, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1419,7 +1644,7 @@ func (a *LanApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest localVarReturnValue Lan ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LanApiService.DatacentersLansPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LANsApiService.DatacentersLansPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1437,10 +1662,21 @@ func (a *LanApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1482,13 +1718,14 @@ func (a *LanApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLansPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLansPut", } if err != nil || localVarHTTPResponse == nil { @@ -1504,24 +1741,26 @@ func (a *LanApiService) DatacentersLansPutExecute(r ApiDatacentersLansPutRequest if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancer.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancers.go similarity index 62% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancer.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancers.go index 6a8ca7e50a43..071b148f7903 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancer.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_load_balancers.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,17 +24,17 @@ var ( _ _context.Context ) -// LoadBalancerApiService LoadBalancerApi service -type LoadBalancerApiService service +// LoadBalancersApiService LoadBalancersApi service +type LoadBalancersApiService service type ApiDatacentersLoadbalancersBalancednicsDeleteRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - nicId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + nicId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -50,46 +51,44 @@ func (r ApiDatacentersLoadbalancersBalancednicsDeleteRequest) XContractNumber(xC return r } -func (r ApiDatacentersLoadbalancersBalancednicsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersLoadbalancersBalancednicsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersLoadbalancersBalancednicsDeleteExecute(r) } /* - * DatacentersLoadbalancersBalancednicsDelete Detach a nic from loadbalancer - * This will remove a nic from Load Balancer + * DatacentersLoadbalancersBalancednicsDelete Detach balanced NICs + * Detach the specified NIC from the Load Balancer. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer - * @param nicId The unique ID of the NIC + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. + * @param nicId The unique ID of the NIC. * @return ApiDatacentersLoadbalancersBalancednicsDeleteRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsDelete(ctx _context.Context, datacenterId string, loadbalancerId string, nicId string) ApiDatacentersLoadbalancersBalancednicsDeleteRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsDelete(ctx _context.Context, datacenterId string, loadbalancerId string, nicId string) ApiDatacentersLoadbalancersBalancednicsDeleteRequest { return ApiDatacentersLoadbalancersBalancednicsDeleteRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, - nicId: nicId, + nicId: nicId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsDeleteExecute(r ApiDatacentersLoadbalancersBalancednicsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsDeleteExecute(r ApiDatacentersLoadbalancersBalancednicsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersBalancednicsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersBalancednicsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/loadbalancers/{loadbalancerId}/balancednics/{nicId}" @@ -103,10 +102,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsDeleteExecu if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -143,100 +153,93 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsDeleteExecu } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersBalancednicsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersBalancednicsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiDatacentersLoadbalancersBalancednicsFindByNicRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - nicId string - pretty *bool - depth *int32 +type ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest struct { + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + nicId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiDatacentersLoadbalancersBalancednicsFindByNicRequest) Pretty(pretty bool) ApiDatacentersLoadbalancersBalancednicsFindByNicRequest { +func (r ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest) Pretty(pretty bool) ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest { r.pretty = &pretty return r } -func (r ApiDatacentersLoadbalancersBalancednicsFindByNicRequest) Depth(depth int32) ApiDatacentersLoadbalancersBalancednicsFindByNicRequest { +func (r ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest) Depth(depth int32) ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest { r.depth = &depth return r } -func (r ApiDatacentersLoadbalancersBalancednicsFindByNicRequest) XContractNumber(xContractNumber int32) ApiDatacentersLoadbalancersBalancednicsFindByNicRequest { +func (r ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiDatacentersLoadbalancersBalancednicsFindByNicRequest) Execute() (Nic, *APIResponse, error) { - return r.ApiService.DatacentersLoadbalancersBalancednicsFindByNicExecute(r) +func (r ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest) Execute() (Nic, *APIResponse, error) { + return r.ApiService.DatacentersLoadbalancersBalancednicsFindByNicIdExecute(r) } /* - * DatacentersLoadbalancersBalancednicsFindByNic Retrieve a nic attached to Load Balancer - * This will retrieve the properties of an attached nic. + * DatacentersLoadbalancersBalancednicsFindByNicId Retrieve balanced NICs + * Retrieve the properties of the specified NIC, attached to the Load Balancer. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer - * @param nicId The unique ID of the NIC - * @return ApiDatacentersLoadbalancersBalancednicsFindByNicRequest + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNic(ctx _context.Context, datacenterId string, loadbalancerId string, nicId string) ApiDatacentersLoadbalancersBalancednicsFindByNicRequest { - return ApiDatacentersLoadbalancersBalancednicsFindByNicRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsFindByNicId(ctx _context.Context, datacenterId string, loadbalancerId string, nicId string) ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest { + return ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, - nicId: nicId, + nicId: nicId, } } @@ -244,7 +247,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNic(c * Execute executes the request * @return Nic */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicExecute(r ApiDatacentersLoadbalancersBalancednicsFindByNicRequest) (Nic, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsFindByNicIdExecute(r ApiDatacentersLoadbalancersBalancednicsFindByNicIdRequest) (Nic, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -254,7 +257,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicEx localVarReturnValue Nic ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersBalancednicsFindByNic") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersBalancednicsFindByNicId") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -270,10 +273,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicEx if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -313,13 +327,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicEx return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersBalancednicsFindByNic", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersBalancednicsFindByNicId", } if err != nil || localVarHTTPResponse == nil { @@ -335,24 +350,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicEx if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -361,12 +378,15 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsFindByNicEx } type ApiDatacentersLoadbalancersBalancednicsGetRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + loadbalancerId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -383,24 +403,44 @@ func (r ApiDatacentersLoadbalancersBalancednicsGetRequest) XContractNumber(xCont return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersLoadbalancersBalancednicsGetRequest) Filter(key string, value string) ApiDatacentersLoadbalancersBalancednicsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersLoadbalancersBalancednicsGetRequest) OrderBy(orderBy string) ApiDatacentersLoadbalancersBalancednicsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersLoadbalancersBalancednicsGetRequest) MaxResults(maxResults int32) ApiDatacentersLoadbalancersBalancednicsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiDatacentersLoadbalancersBalancednicsGetRequest) Execute() (BalancedNics, *APIResponse, error) { return r.ApiService.DatacentersLoadbalancersBalancednicsGetExecute(r) } /* - * DatacentersLoadbalancersBalancednicsGet List Load Balancer Members - * You can retrieve a list of nics attached to a Load Balancer + * DatacentersLoadbalancersBalancednicsGet List balanced NICs + * List all NICs, attached to the specified Load Balancer. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersBalancednicsGetRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGet(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersBalancednicsGetRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsGet(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersBalancednicsGetRequest { return ApiDatacentersLoadbalancersBalancednicsGetRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, + filters: _neturl.Values{}, } } @@ -408,7 +448,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGet(ctx _co * Execute executes the request * @return BalancedNics */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute(r ApiDatacentersLoadbalancersBalancednicsGetRequest) (BalancedNics, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsGetExecute(r ApiDatacentersLoadbalancersBalancednicsGetRequest) (BalancedNics, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -418,7 +458,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute( localVarReturnValue BalancedNics ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersBalancednicsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersBalancednicsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -433,10 +473,34 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -476,13 +540,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute( return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersBalancednicsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersBalancednicsGet", } if err != nil || localVarHTTPResponse == nil { @@ -498,24 +563,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute( if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -524,13 +591,13 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsGetExecute( } type ApiDatacentersLoadbalancersBalancednicsPostRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - nic *Nic - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + nic *Nic + pretty *bool + depth *int32 xContractNumber *int32 } @@ -556,18 +623,18 @@ func (r ApiDatacentersLoadbalancersBalancednicsPostRequest) Execute() (Nic, *API } /* - * DatacentersLoadbalancersBalancednicsPost Attach a nic to Load Balancer - * This will attach a pre-existing nic to a Load Balancer. + * DatacentersLoadbalancersBalancednicsPost Attach balanced NICs + * Attach an existing NIC to the specified Load Balancer. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersBalancednicsPostRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPost(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersBalancednicsPostRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsPost(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersBalancednicsPostRequest { return ApiDatacentersLoadbalancersBalancednicsPostRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, } } @@ -576,7 +643,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPost(ctx _c * Execute executes the request * @return Nic */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute(r ApiDatacentersLoadbalancersBalancednicsPostRequest) (Nic, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersBalancednicsPostExecute(r ApiDatacentersLoadbalancersBalancednicsPostRequest) (Nic, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -586,7 +653,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute localVarReturnValue Nic ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersBalancednicsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersBalancednicsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -604,10 +671,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -649,13 +727,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersBalancednicsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersBalancednicsPost", } if err != nil || localVarHTTPResponse == nil { @@ -671,24 +750,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -697,12 +778,12 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersBalancednicsPostExecute } type ApiDatacentersLoadbalancersDeleteRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -719,44 +800,42 @@ func (r ApiDatacentersLoadbalancersDeleteRequest) XContractNumber(xContractNumbe return r } -func (r ApiDatacentersLoadbalancersDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersLoadbalancersDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersLoadbalancersDeleteExecute(r) } /* - * DatacentersLoadbalancersDelete Delete a Loadbalancer. - * Removes the specific Loadbalancer + * DatacentersLoadbalancersDelete Delete Load Balancers + * Remove the specified Load Balancer from the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersDeleteRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersDelete(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersDeleteRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersDelete(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersDeleteRequest { return ApiDatacentersLoadbalancersDeleteRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersDeleteExecute(r ApiDatacentersLoadbalancersDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersDeleteExecute(r ApiDatacentersLoadbalancersDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/loadbalancers/{loadbalancerId}" @@ -769,10 +848,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersDeleteExecute(r ApiData if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -809,63 +899,56 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersDeleteExecute(r ApiData } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersLoadbalancersFindByIdRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -887,18 +970,18 @@ func (r ApiDatacentersLoadbalancersFindByIdRequest) Execute() (Loadbalancer, *AP } /* - * DatacentersLoadbalancersFindById Retrieve a loadbalancer - * Retrieves the attributes of a given Loadbalancer + * DatacentersLoadbalancersFindById Retrieve Load Balancers + * Retrieve the properties of the specified Load Balancer within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersFindByIdRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersFindById(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersFindByIdRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersFindById(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersFindByIdRequest { return ApiDatacentersLoadbalancersFindByIdRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, } } @@ -907,7 +990,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindById(ctx _context.C * Execute executes the request * @return Loadbalancer */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDatacentersLoadbalancersFindByIdRequest) (Loadbalancer, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDatacentersLoadbalancersFindByIdRequest) (Loadbalancer, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -917,7 +1000,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDa localVarReturnValue Loadbalancer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -932,10 +1015,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDa if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -975,13 +1069,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDa return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersFindById", } if err != nil || localVarHTTPResponse == nil { @@ -997,24 +1092,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDa if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1023,12 +1120,17 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersFindByIdExecute(r ApiDa } type ApiDatacentersLoadbalancersGetRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersLoadbalancersGetRequest) Pretty(pretty bool) ApiDatacentersLoadbalancersGetRequest { @@ -1043,6 +1145,33 @@ func (r ApiDatacentersLoadbalancersGetRequest) XContractNumber(xContractNumber i r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersLoadbalancersGetRequest) Offset(offset int32) ApiDatacentersLoadbalancersGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersLoadbalancersGetRequest) Limit(limit int32) ApiDatacentersLoadbalancersGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersLoadbalancersGetRequest) Filter(key string, value string) ApiDatacentersLoadbalancersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersLoadbalancersGetRequest) OrderBy(orderBy string) ApiDatacentersLoadbalancersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersLoadbalancersGetRequest) MaxResults(maxResults int32) ApiDatacentersLoadbalancersGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersLoadbalancersGetRequest) Execute() (Loadbalancers, *APIResponse, error) { return r.ApiService.DatacentersLoadbalancersGetExecute(r) @@ -1050,16 +1179,17 @@ func (r ApiDatacentersLoadbalancersGetRequest) Execute() (Loadbalancers, *APIRes /* * DatacentersLoadbalancersGet List Load Balancers - * Retrieve a list of Load Balancers within the datacenter + * List all the Load Balancers within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLoadbalancersGetRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersGet(ctx _context.Context, datacenterId string) ApiDatacentersLoadbalancersGetRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersGet(ctx _context.Context, datacenterId string) ApiDatacentersLoadbalancersGetRequest { return ApiDatacentersLoadbalancersGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, + filters: _neturl.Values{}, } } @@ -1067,7 +1197,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGet(ctx _context.Contex * Execute executes the request * @return Loadbalancers */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacentersLoadbalancersGetRequest) (Loadbalancers, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersGetExecute(r ApiDatacentersLoadbalancersGetRequest) (Loadbalancers, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1077,7 +1207,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacen localVarReturnValue Loadbalancers ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1091,10 +1221,50 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacen if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1134,13 +1304,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacen return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersGet", } if err != nil || localVarHTTPResponse == nil { @@ -1156,24 +1327,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacen if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1182,13 +1355,13 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersGetExecute(r ApiDatacen } type ApiDatacentersLoadbalancersPatchRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - loadbalancer *LoadbalancerProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + loadbalancer *LoadbalancerProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1214,18 +1387,18 @@ func (r ApiDatacentersLoadbalancersPatchRequest) Execute() (Loadbalancer, *APIRe } /* - * DatacentersLoadbalancersPatch Partially modify a Loadbalancer - * You can use update attributes of a resource + * DatacentersLoadbalancersPatch Partially modify Load Balancers + * Update the properties of the specified Load Balancer within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersPatchRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPatch(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersPatchRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPatch(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersPatchRequest { return ApiDatacentersLoadbalancersPatchRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, } } @@ -1234,7 +1407,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatch(ctx _context.Cont * Execute executes the request * @return Loadbalancer */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatacentersLoadbalancersPatchRequest) (Loadbalancer, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPatchExecute(r ApiDatacentersLoadbalancersPatchRequest) (Loadbalancer, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -1244,7 +1417,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatac localVarReturnValue Loadbalancer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1262,10 +1435,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatac if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1307,13 +1491,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatac return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersPatch", } if err != nil || localVarHTTPResponse == nil { @@ -1329,24 +1514,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatac if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1355,12 +1542,12 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPatchExecute(r ApiDatac } type ApiDatacentersLoadbalancersPostRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancer *Loadbalancer - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancer *Loadbalancer + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1386,16 +1573,16 @@ func (r ApiDatacentersLoadbalancersPostRequest) Execute() (Loadbalancer, *APIRes } /* - * DatacentersLoadbalancersPost Create a Load Balancer - * Creates a Loadbalancer within the datacenter + * DatacentersLoadbalancersPost Create Load Balancers + * Create a Load Balancer within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersLoadbalancersPostRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPost(ctx _context.Context, datacenterId string) ApiDatacentersLoadbalancersPostRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPost(ctx _context.Context, datacenterId string) ApiDatacentersLoadbalancersPostRequest { return ApiDatacentersLoadbalancersPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -1404,7 +1591,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPost(ctx _context.Conte * Execute executes the request * @return Loadbalancer */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatacentersLoadbalancersPostRequest) (Loadbalancer, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPostExecute(r ApiDatacentersLoadbalancersPostRequest) (Loadbalancer, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1414,7 +1601,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatace localVarReturnValue Loadbalancer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1431,10 +1618,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatace if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1476,13 +1674,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatace return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersPost", } if err != nil || localVarHTTPResponse == nil { @@ -1498,24 +1697,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatace if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1524,13 +1725,13 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPostExecute(r ApiDatace } type ApiDatacentersLoadbalancersPutRequest struct { - ctx _context.Context - ApiService *LoadBalancerApiService - datacenterId string - loadbalancerId string - loadbalancer *Loadbalancer - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LoadBalancersApiService + datacenterId string + loadbalancerId string + loadbalancer *Loadbalancer + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1556,18 +1757,18 @@ func (r ApiDatacentersLoadbalancersPutRequest) Execute() (Loadbalancer, *APIResp } /* - * DatacentersLoadbalancersPut Modify a Load Balancer - * You can use update attributes of a resource + * DatacentersLoadbalancersPut Modify Load Balancers + * Modify the properties of the specified Load Balancer within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param loadbalancerId The unique ID of the Load Balancer + * @param datacenterId The unique ID of the data center. + * @param loadbalancerId The unique ID of the Load Balancer. * @return ApiDatacentersLoadbalancersPutRequest */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPut(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersPutRequest { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPut(ctx _context.Context, datacenterId string, loadbalancerId string) ApiDatacentersLoadbalancersPutRequest { return ApiDatacentersLoadbalancersPutRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, loadbalancerId: loadbalancerId, } } @@ -1576,7 +1777,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPut(ctx _context.Contex * Execute executes the request * @return Loadbalancer */ -func (a *LoadBalancerApiService) DatacentersLoadbalancersPutExecute(r ApiDatacentersLoadbalancersPutRequest) (Loadbalancer, *APIResponse, error) { +func (a *LoadBalancersApiService) DatacentersLoadbalancersPutExecute(r ApiDatacentersLoadbalancersPutRequest) (Loadbalancer, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1586,7 +1787,7 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPutExecute(r ApiDatacen localVarReturnValue Loadbalancer ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancerApiService.DatacentersLoadbalancersPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoadBalancersApiService.DatacentersLoadbalancersPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1604,10 +1805,21 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPutExecute(r ApiDatacen if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1649,13 +1861,14 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPutExecute(r ApiDatacen return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersLoadbalancersPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersLoadbalancersPut", } if err != nil || localVarHTTPResponse == nil { @@ -1671,24 +1884,26 @@ func (a *LoadBalancerApiService) DatacentersLoadbalancersPutExecute(r ApiDatacen if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_location.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_locations.go similarity index 56% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_location.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_locations.go index 138ac64c4a68..a1cf93c8a9a3 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_location.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_locations.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,47 +24,47 @@ var ( _ _context.Context ) -// LocationApiService LocationApi service -type LocationApiService service +// LocationsApiService LocationsApi service +type LocationsApiService service -type ApiLocationsFindByRegionRequest struct { - ctx _context.Context - ApiService *LocationApiService - regionId string - pretty *bool - depth *int32 +type ApiLocationsFindByRegionIdRequest struct { + ctx _context.Context + ApiService *LocationsApiService + regionId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiLocationsFindByRegionRequest) Pretty(pretty bool) ApiLocationsFindByRegionRequest { +func (r ApiLocationsFindByRegionIdRequest) Pretty(pretty bool) ApiLocationsFindByRegionIdRequest { r.pretty = &pretty return r } -func (r ApiLocationsFindByRegionRequest) Depth(depth int32) ApiLocationsFindByRegionRequest { +func (r ApiLocationsFindByRegionIdRequest) Depth(depth int32) ApiLocationsFindByRegionIdRequest { r.depth = &depth return r } -func (r ApiLocationsFindByRegionRequest) XContractNumber(xContractNumber int32) ApiLocationsFindByRegionRequest { +func (r ApiLocationsFindByRegionIdRequest) XContractNumber(xContractNumber int32) ApiLocationsFindByRegionIdRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiLocationsFindByRegionRequest) Execute() (Locations, *APIResponse, error) { - return r.ApiService.LocationsFindByRegionExecute(r) +func (r ApiLocationsFindByRegionIdRequest) Execute() (Locations, *APIResponse, error) { + return r.ApiService.LocationsFindByRegionIdExecute(r) } /* - * LocationsFindByRegion List Locations within a region - * Retrieve a list of Locations within a world's region + * LocationsFindByRegionId List locations within regions + * List locations by the region ID. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param regionId - * @return ApiLocationsFindByRegionRequest + * @param regionId The unique ID of the region. + * @return ApiLocationsFindByRegionIdRequest */ -func (a *LocationApiService) LocationsFindByRegion(ctx _context.Context, regionId string) ApiLocationsFindByRegionRequest { - return ApiLocationsFindByRegionRequest{ +func (a *LocationsApiService) LocationsFindByRegionId(ctx _context.Context, regionId string) ApiLocationsFindByRegionIdRequest { + return ApiLocationsFindByRegionIdRequest{ ApiService: a, - ctx: ctx, - regionId: regionId, + ctx: ctx, + regionId: regionId, } } @@ -71,7 +72,7 @@ func (a *LocationApiService) LocationsFindByRegion(ctx _context.Context, regionI * Execute executes the request * @return Locations */ -func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRegionRequest) (Locations, *APIResponse, error) { +func (a *LocationsApiService) LocationsFindByRegionIdExecute(r ApiLocationsFindByRegionIdRequest) (Locations, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -81,7 +82,7 @@ func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRe localVarReturnValue Locations ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationApiService.LocationsFindByRegion") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationsApiService.LocationsFindByRegionId") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -95,10 +96,21 @@ func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -138,13 +150,14 @@ func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "LocationsFindByRegion", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "LocationsFindByRegionId", } if err != nil || localVarHTTPResponse == nil { @@ -160,24 +173,26 @@ func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -185,46 +200,46 @@ func (a *LocationApiService) LocationsFindByRegionExecute(r ApiLocationsFindByRe return localVarReturnValue, localVarAPIResponse, nil } -type ApiLocationsFindByRegionAndIdRequest struct { - ctx _context.Context - ApiService *LocationApiService - regionId string - locationId string - pretty *bool - depth *int32 +type ApiLocationsFindByRegionIdAndIdRequest struct { + ctx _context.Context + ApiService *LocationsApiService + regionId string + locationId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiLocationsFindByRegionAndIdRequest) Pretty(pretty bool) ApiLocationsFindByRegionAndIdRequest { +func (r ApiLocationsFindByRegionIdAndIdRequest) Pretty(pretty bool) ApiLocationsFindByRegionIdAndIdRequest { r.pretty = &pretty return r } -func (r ApiLocationsFindByRegionAndIdRequest) Depth(depth int32) ApiLocationsFindByRegionAndIdRequest { +func (r ApiLocationsFindByRegionIdAndIdRequest) Depth(depth int32) ApiLocationsFindByRegionIdAndIdRequest { r.depth = &depth return r } -func (r ApiLocationsFindByRegionAndIdRequest) XContractNumber(xContractNumber int32) ApiLocationsFindByRegionAndIdRequest { +func (r ApiLocationsFindByRegionIdAndIdRequest) XContractNumber(xContractNumber int32) ApiLocationsFindByRegionIdAndIdRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiLocationsFindByRegionAndIdRequest) Execute() (Location, *APIResponse, error) { - return r.ApiService.LocationsFindByRegionAndIdExecute(r) +func (r ApiLocationsFindByRegionIdAndIdRequest) Execute() (Location, *APIResponse, error) { + return r.ApiService.LocationsFindByRegionIdAndIdExecute(r) } /* - * LocationsFindByRegionAndId Retrieve a Location - * Retrieves the attributes of a given location + * LocationsFindByRegionIdAndId Retrieve specified locations + * Retrieve the properties of the specified location * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param regionId - * @param locationId - * @return ApiLocationsFindByRegionAndIdRequest + * @param regionId The unique ID of the region. + * @param locationId The unique ID of the location. + * @return ApiLocationsFindByRegionIdAndIdRequest */ -func (a *LocationApiService) LocationsFindByRegionAndId(ctx _context.Context, regionId string, locationId string) ApiLocationsFindByRegionAndIdRequest { - return ApiLocationsFindByRegionAndIdRequest{ +func (a *LocationsApiService) LocationsFindByRegionIdAndId(ctx _context.Context, regionId string, locationId string) ApiLocationsFindByRegionIdAndIdRequest { + return ApiLocationsFindByRegionIdAndIdRequest{ ApiService: a, - ctx: ctx, - regionId: regionId, + ctx: ctx, + regionId: regionId, locationId: locationId, } } @@ -233,7 +248,7 @@ func (a *LocationApiService) LocationsFindByRegionAndId(ctx _context.Context, re * Execute executes the request * @return Location */ -func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFindByRegionAndIdRequest) (Location, *APIResponse, error) { +func (a *LocationsApiService) LocationsFindByRegionIdAndIdExecute(r ApiLocationsFindByRegionIdAndIdRequest) (Location, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -243,7 +258,7 @@ func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFin localVarReturnValue Location ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationApiService.LocationsFindByRegionAndId") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationsApiService.LocationsFindByRegionIdAndId") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -258,10 +273,21 @@ func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFin if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -301,13 +327,14 @@ func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFin return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "LocationsFindByRegionAndId", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "LocationsFindByRegionIdAndId", } if err != nil || localVarHTTPResponse == nil { @@ -323,24 +350,26 @@ func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFin if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -349,10 +378,13 @@ func (a *LocationApiService) LocationsFindByRegionAndIdExecute(r ApiLocationsFin } type ApiLocationsGetRequest struct { - ctx _context.Context - ApiService *LocationApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *LocationsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -369,20 +401,40 @@ func (r ApiLocationsGetRequest) XContractNumber(xContractNumber int32) ApiLocati return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiLocationsGetRequest) Filter(key string, value string) ApiLocationsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiLocationsGetRequest) OrderBy(orderBy string) ApiLocationsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiLocationsGetRequest) MaxResults(maxResults int32) ApiLocationsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiLocationsGetRequest) Execute() (Locations, *APIResponse, error) { return r.ApiService.LocationsGetExecute(r) } /* - * LocationsGet List Locations - * Retrieve a list of Locations. This list represents where you can provision your virtual data centers + * LocationsGet List locations + * List the available locations for provisioning your virtual data centers. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiLocationsGetRequest */ -func (a *LocationApiService) LocationsGet(ctx _context.Context) ApiLocationsGetRequest { +func (a *LocationsApiService) LocationsGet(ctx _context.Context) ApiLocationsGetRequest { return ApiLocationsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -390,7 +442,7 @@ func (a *LocationApiService) LocationsGet(ctx _context.Context) ApiLocationsGetR * Execute executes the request * @return Locations */ -func (a *LocationApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Locations, *APIResponse, error) { +func (a *LocationsApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Locations, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -400,7 +452,7 @@ func (a *LocationApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Loca localVarReturnValue Locations ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationApiService.LocationsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LocationsApiService.LocationsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -413,10 +465,34 @@ func (a *LocationApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Loca if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -456,13 +532,14 @@ func (a *LocationApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Loca return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "LocationsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "LocationsGet", } if err != nil || localVarHTTPResponse == nil { @@ -478,24 +555,26 @@ func (a *LocationApiService) LocationsGetExecute(r ApiLocationsGetRequest) (Loca if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nat_gateways.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nat_gateways.go new file mode 100644 index 000000000000..162ebd2b63af --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nat_gateways.go @@ -0,0 +1,3380 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// NATGatewaysApiService NATGatewaysApi service +type NATGatewaysApiService service + +type ApiDatacentersNatgatewaysDeleteRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysDeleteRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysDeleteRequest) Depth(depth int32) ApiDatacentersNatgatewaysDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysDeleteExecute(r) +} + +/* + * DatacentersNatgatewaysDelete Delete NAT Gateways + * Remove the specified NAT Gateway from the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysDeleteRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysDelete(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysDeleteRequest { + return ApiDatacentersNatgatewaysDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysDeleteExecute(r ApiDatacentersNatgatewaysDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFindByNatGatewayIdRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysFindByNatGatewayIdRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFindByNatGatewayIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFindByNatGatewayIdRequest) Depth(depth int32) ApiDatacentersNatgatewaysFindByNatGatewayIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysFindByNatGatewayIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysFindByNatGatewayIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysFindByNatGatewayIdRequest) Execute() (NatGateway, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFindByNatGatewayIdExecute(r) +} + +/* + * DatacentersNatgatewaysFindByNatGatewayId Retrieve NAT Gateways + * Retrieve the properties of the specified NAT Gateway within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysFindByNatGatewayIdRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFindByNatGatewayId(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysFindByNatGatewayIdRequest { + return ApiDatacentersNatgatewaysFindByNatGatewayIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + * @return NatGateway + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFindByNatGatewayIdExecute(r ApiDatacentersNatgatewaysFindByNatGatewayIdRequest) (NatGateway, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGateway + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFindByNatGatewayId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFindByNatGatewayId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsDeleteRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + flowLogId string + pretty *bool + depth *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsDeleteRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsDeleteRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsDeleteRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsDeleteExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsDelete Delete NAT Gateway Flow Logs + * Delete the specified NAT Gateway Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNatgatewaysFlowlogsDeleteRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsDelete(ctx _context.Context, datacenterId string, natGatewayId string, flowLogId string) ApiDatacentersNatgatewaysFlowlogsDeleteRequest { + return ApiDatacentersNatgatewaysFlowlogsDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsDeleteExecute(r ApiDatacentersNatgatewaysFlowlogsDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + flowLogId string + pretty *bool + depth *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsFindByFlowLogIdExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsFindByFlowLogId Retrieve NAT Gateway Flow Logs + * Retrieve the specified NAT Gateway Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsFindByFlowLogId(ctx _context.Context, datacenterId string, natGatewayId string, flowLogId string) ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest { + return ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsFindByFlowLogIdExecute(r ApiDatacentersNatgatewaysFlowlogsFindByFlowLogIdRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsFindByFlowLogId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsFindByFlowLogId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsGetRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + natGatewayId string + pretty *bool + depth *int32 + offset *int32 + limit *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Offset(offset int32) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Limit(limit int32) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Filter(key string, value string) ApiDatacentersNatgatewaysFlowlogsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) OrderBy(orderBy string) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) MaxResults(maxResults int32) ApiDatacentersNatgatewaysFlowlogsGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsGetRequest) Execute() (FlowLogs, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsGetExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsGet List NAT Gateway Flow Logs + * List all the Flow Logs for the specified NAT Gateway. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysFlowlogsGetRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsGet(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysFlowlogsGetRequest { + return ApiDatacentersNatgatewaysFlowlogsGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return FlowLogs + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsGetExecute(r ApiDatacentersNatgatewaysFlowlogsGetRequest) (FlowLogs, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLogs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsPatchRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + flowLogId string + natGatewayFlowLogProperties *FlowLogProperties + pretty *bool + depth *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsPatchRequest) NatGatewayFlowLogProperties(natGatewayFlowLogProperties FlowLogProperties) ApiDatacentersNatgatewaysFlowlogsPatchRequest { + r.natGatewayFlowLogProperties = &natGatewayFlowLogProperties + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPatchRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPatchRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsPatchRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsPatchRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsPatchExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsPatch Partially modify NAT Gateway Flow Logs + * Update the properties of the specified NAT Gateway Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNatgatewaysFlowlogsPatchRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPatch(ctx _context.Context, datacenterId string, natGatewayId string, flowLogId string) ApiDatacentersNatgatewaysFlowlogsPatchRequest { + return ApiDatacentersNatgatewaysFlowlogsPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPatchExecute(r ApiDatacentersNatgatewaysFlowlogsPatchRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayFlowLogProperties == nil { + return localVarReturnValue, nil, reportError("natGatewayFlowLogProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.natGatewayFlowLogProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsPostRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayFlowLog *FlowLog + pretty *bool + depth *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsPostRequest) NatGatewayFlowLog(natGatewayFlowLog FlowLog) ApiDatacentersNatgatewaysFlowlogsPostRequest { + r.natGatewayFlowLog = &natGatewayFlowLog + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPostRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPostRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsPostRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsPostRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsPostExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsPost Create NAT Gateway Flow Logs + * Add a new Flow Log for the specified NAT Gateway. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysFlowlogsPostRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPost(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysFlowlogsPostRequest { + return ApiDatacentersNatgatewaysFlowlogsPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPostExecute(r ApiDatacentersNatgatewaysFlowlogsPostRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayFlowLog == nil { + return localVarReturnValue, nil, reportError("natGatewayFlowLog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.natGatewayFlowLog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysFlowlogsPutRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + flowLogId string + natGatewayFlowLog *FlowLogPut + pretty *bool + depth *int32 +} + +func (r ApiDatacentersNatgatewaysFlowlogsPutRequest) NatGatewayFlowLog(natGatewayFlowLog FlowLogPut) ApiDatacentersNatgatewaysFlowlogsPutRequest { + r.natGatewayFlowLog = &natGatewayFlowLog + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPutRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysFlowlogsPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysFlowlogsPutRequest) Depth(depth int32) ApiDatacentersNatgatewaysFlowlogsPutRequest { + r.depth = &depth + return r +} + +func (r ApiDatacentersNatgatewaysFlowlogsPutRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysFlowlogsPutExecute(r) +} + +/* + * DatacentersNatgatewaysFlowlogsPut Modify NAT Gateway Flow Logs + * Modify the specified NAT Gateway Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNatgatewaysFlowlogsPutRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPut(ctx _context.Context, datacenterId string, natGatewayId string, flowLogId string) ApiDatacentersNatgatewaysFlowlogsPutRequest { + return ApiDatacentersNatgatewaysFlowlogsPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysFlowlogsPutExecute(r ApiDatacentersNatgatewaysFlowlogsPutRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysFlowlogsPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayFlowLog == nil { + return localVarReturnValue, nil, reportError("natGatewayFlowLog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.natGatewayFlowLog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysFlowlogsPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysGetRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysGetRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysGetRequest) Depth(depth int32) ApiDatacentersNatgatewaysGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNatgatewaysGetRequest) Filter(key string, value string) ApiDatacentersNatgatewaysGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNatgatewaysGetRequest) OrderBy(orderBy string) ApiDatacentersNatgatewaysGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNatgatewaysGetRequest) MaxResults(maxResults int32) ApiDatacentersNatgatewaysGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNatgatewaysGetRequest) Execute() (NatGateways, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysGetExecute(r) +} + +/* + * DatacentersNatgatewaysGet List NAT Gateways + * List all NAT Gateways within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @return ApiDatacentersNatgatewaysGetRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysGet(ctx _context.Context, datacenterId string) ApiDatacentersNatgatewaysGetRequest { + return ApiDatacentersNatgatewaysGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return NatGateways + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysGetExecute(r ApiDatacentersNatgatewaysGetRequest) (NatGateways, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGateways + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysPatchRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayProperties *NatGatewayProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysPatchRequest) NatGatewayProperties(natGatewayProperties NatGatewayProperties) ApiDatacentersNatgatewaysPatchRequest { + r.natGatewayProperties = &natGatewayProperties + return r +} +func (r ApiDatacentersNatgatewaysPatchRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysPatchRequest) Depth(depth int32) ApiDatacentersNatgatewaysPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysPatchRequest) Execute() (NatGateway, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysPatchExecute(r) +} + +/* + * DatacentersNatgatewaysPatch Partially modify NAT Gateways + * Update the properties of the specified NAT Gateway within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysPatchRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPatch(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysPatchRequest { + return ApiDatacentersNatgatewaysPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + * @return NatGateway + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPatchExecute(r ApiDatacentersNatgatewaysPatchRequest) (NatGateway, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGateway + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayProperties == nil { + return localVarReturnValue, nil, reportError("natGatewayProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGatewayProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysPostRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGateway *NatGateway + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysPostRequest) NatGateway(natGateway NatGateway) ApiDatacentersNatgatewaysPostRequest { + r.natGateway = &natGateway + return r +} +func (r ApiDatacentersNatgatewaysPostRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysPostRequest) Depth(depth int32) ApiDatacentersNatgatewaysPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysPostRequest) Execute() (NatGateway, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysPostExecute(r) +} + +/* + * DatacentersNatgatewaysPost Create NAT Gateways + * Create a NAT Gateway within the data center. + +This operation is restricted to contract owner, admin, and users with 'createInternetAccess' privileges. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @return ApiDatacentersNatgatewaysPostRequest +*/ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPost(ctx _context.Context, datacenterId string) ApiDatacentersNatgatewaysPostRequest { + return ApiDatacentersNatgatewaysPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + } +} + +/* + * Execute executes the request + * @return NatGateway + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPostExecute(r ApiDatacentersNatgatewaysPostRequest) (NatGateway, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGateway + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGateway == nil { + return localVarReturnValue, nil, reportError("natGateway is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGateway + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysPutRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGateway *NatGatewayPut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysPutRequest) NatGateway(natGateway NatGatewayPut) ApiDatacentersNatgatewaysPutRequest { + r.natGateway = &natGateway + return r +} +func (r ApiDatacentersNatgatewaysPutRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysPutRequest) Depth(depth int32) ApiDatacentersNatgatewaysPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysPutRequest) Execute() (NatGateway, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysPutExecute(r) +} + +/* + * DatacentersNatgatewaysPut Modify NAT Gateways + * Modify the properties of the specified NAT Gateway within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysPutRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPut(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysPutRequest { + return ApiDatacentersNatgatewaysPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + * @return NatGateway + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysPutExecute(r ApiDatacentersNatgatewaysPutRequest) (NatGateway, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGateway + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGateway == nil { + return localVarReturnValue, nil, reportError("natGateway is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGateway + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesDeleteRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayRuleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesDeleteRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesDeleteRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysRulesDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesDeleteExecute(r) +} + +/* + * DatacentersNatgatewaysRulesDelete Delete NAT Gateway rules + * Delete the specified NAT Gateway rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param natGatewayRuleId The unique ID of the NAT Gateway rule. + * @return ApiDatacentersNatgatewaysRulesDeleteRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesDelete(ctx _context.Context, datacenterId string, natGatewayId string, natGatewayRuleId string) ApiDatacentersNatgatewaysRulesDeleteRequest { + return ApiDatacentersNatgatewaysRulesDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + natGatewayRuleId: natGatewayRuleId, + } +} + +/* + * Execute executes the request + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesDeleteExecute(r ApiDatacentersNatgatewaysRulesDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayRuleId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayRuleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest) Execute() (NatGatewayRule, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesFindByNatGatewayRuleIdExecute(r) +} + +/* + * DatacentersNatgatewaysRulesFindByNatGatewayRuleId Retrieve NAT Gateway rules + * Retrieve the properties of the specified NAT Gateway rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param natGatewayRuleId The unique ID of the NAT Gateway rule. + * @return ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesFindByNatGatewayRuleId(ctx _context.Context, datacenterId string, natGatewayId string, natGatewayRuleId string) ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest { + return ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + natGatewayRuleId: natGatewayRuleId, + } +} + +/* + * Execute executes the request + * @return NatGatewayRule + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesFindByNatGatewayRuleIdExecute(r ApiDatacentersNatgatewaysRulesFindByNatGatewayRuleIdRequest) (NatGatewayRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGatewayRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesFindByNatGatewayRuleId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayRuleId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesFindByNatGatewayRuleId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesGetRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + natGatewayId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesGetRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesGetRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNatgatewaysRulesGetRequest) Filter(key string, value string) ApiDatacentersNatgatewaysRulesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNatgatewaysRulesGetRequest) OrderBy(orderBy string) ApiDatacentersNatgatewaysRulesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNatgatewaysRulesGetRequest) MaxResults(maxResults int32) ApiDatacentersNatgatewaysRulesGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNatgatewaysRulesGetRequest) Execute() (NatGatewayRules, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesGetExecute(r) +} + +/* + * DatacentersNatgatewaysRulesGet List NAT Gateway rules + * List all rules for the specified NAT Gateway. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysRulesGetRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesGet(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysRulesGetRequest { + return ApiDatacentersNatgatewaysRulesGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return NatGatewayRules + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesGetExecute(r ApiDatacentersNatgatewaysRulesGetRequest) (NatGatewayRules, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGatewayRules + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesPatchRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayRuleId string + natGatewayRuleProperties *NatGatewayRuleProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesPatchRequest) NatGatewayRuleProperties(natGatewayRuleProperties NatGatewayRuleProperties) ApiDatacentersNatgatewaysRulesPatchRequest { + r.natGatewayRuleProperties = &natGatewayRuleProperties + return r +} +func (r ApiDatacentersNatgatewaysRulesPatchRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesPatchRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysRulesPatchRequest) Execute() (NatGatewayRule, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesPatchExecute(r) +} + +/* + * DatacentersNatgatewaysRulesPatch Partially modify NAT Gateway rules + * Update the properties of the specified NAT Gateway rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param natGatewayRuleId The unique ID of the NAT Gateway rule. + * @return ApiDatacentersNatgatewaysRulesPatchRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPatch(ctx _context.Context, datacenterId string, natGatewayId string, natGatewayRuleId string) ApiDatacentersNatgatewaysRulesPatchRequest { + return ApiDatacentersNatgatewaysRulesPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + natGatewayRuleId: natGatewayRuleId, + } +} + +/* + * Execute executes the request + * @return NatGatewayRule + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPatchExecute(r ApiDatacentersNatgatewaysRulesPatchRequest) (NatGatewayRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGatewayRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayRuleId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayRuleProperties == nil { + return localVarReturnValue, nil, reportError("natGatewayRuleProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGatewayRuleProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesPostRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayRule *NatGatewayRule + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesPostRequest) NatGatewayRule(natGatewayRule NatGatewayRule) ApiDatacentersNatgatewaysRulesPostRequest { + r.natGatewayRule = &natGatewayRule + return r +} +func (r ApiDatacentersNatgatewaysRulesPostRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesPostRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysRulesPostRequest) Execute() (NatGatewayRule, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesPostExecute(r) +} + +/* + * DatacentersNatgatewaysRulesPost Create NAT Gateway rules + * Create a rule for the specified NAT Gateway. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @return ApiDatacentersNatgatewaysRulesPostRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPost(ctx _context.Context, datacenterId string, natGatewayId string) ApiDatacentersNatgatewaysRulesPostRequest { + return ApiDatacentersNatgatewaysRulesPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + } +} + +/* + * Execute executes the request + * @return NatGatewayRule + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPostExecute(r ApiDatacentersNatgatewaysRulesPostRequest) (NatGatewayRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGatewayRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayRule == nil { + return localVarReturnValue, nil, reportError("natGatewayRule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGatewayRule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNatgatewaysRulesPutRequest struct { + ctx _context.Context + ApiService *NATGatewaysApiService + datacenterId string + natGatewayId string + natGatewayRuleId string + natGatewayRule *NatGatewayRulePut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNatgatewaysRulesPutRequest) NatGatewayRule(natGatewayRule NatGatewayRulePut) ApiDatacentersNatgatewaysRulesPutRequest { + r.natGatewayRule = &natGatewayRule + return r +} +func (r ApiDatacentersNatgatewaysRulesPutRequest) Pretty(pretty bool) ApiDatacentersNatgatewaysRulesPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNatgatewaysRulesPutRequest) Depth(depth int32) ApiDatacentersNatgatewaysRulesPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNatgatewaysRulesPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersNatgatewaysRulesPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNatgatewaysRulesPutRequest) Execute() (NatGatewayRule, *APIResponse, error) { + return r.ApiService.DatacentersNatgatewaysRulesPutExecute(r) +} + +/* + * DatacentersNatgatewaysRulesPut Modify NAT Gateway rules + * Modify the specified NAT Gateway rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param natGatewayId The unique ID of the NAT Gateway. + * @param natGatewayRuleId The unique ID of the NAT Gateway rule. + * @return ApiDatacentersNatgatewaysRulesPutRequest + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPut(ctx _context.Context, datacenterId string, natGatewayId string, natGatewayRuleId string) ApiDatacentersNatgatewaysRulesPutRequest { + return ApiDatacentersNatgatewaysRulesPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + natGatewayId: natGatewayId, + natGatewayRuleId: natGatewayRuleId, + } +} + +/* + * Execute executes the request + * @return NatGatewayRule + */ +func (a *NATGatewaysApiService) DatacentersNatgatewaysRulesPutExecute(r ApiDatacentersNatgatewaysRulesPutRequest) (NatGatewayRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NatGatewayRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NATGatewaysApiService.DatacentersNatgatewaysRulesPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"natGatewayRuleId"+"}", _neturl.PathEscape(parameterToString(r.natGatewayRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.natGatewayRule == nil { + return localVarReturnValue, nil, reportError("natGatewayRule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.natGatewayRule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNatgatewaysRulesPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_interfaces.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_interfaces.go new file mode 100644 index 000000000000..df5b0937db06 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_interfaces.go @@ -0,0 +1,1186 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// NetworkInterfacesApiService NetworkInterfacesApi service +type NetworkInterfacesApiService service + +type ApiDatacentersServersNicsDeleteRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + datacenterId string + serverId string + nicId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsDeleteRequest) Pretty(pretty bool) ApiDatacentersServersNicsDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsDeleteRequest) Depth(depth int32) ApiDatacentersServersNicsDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersNicsDeleteExecute(r) +} + +/* + * DatacentersServersNicsDelete Delete NICs + * Remove the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsDeleteRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsDelete(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsDeleteRequest { + return ApiDatacentersServersNicsDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsDeleteExecute(r ApiDatacentersServersNicsDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsFindByIdRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + datacenterId string + serverId string + nicId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsFindByIdRequest) Pretty(pretty bool) ApiDatacentersServersNicsFindByIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsFindByIdRequest) Depth(depth int32) ApiDatacentersServersNicsFindByIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsFindByIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFindByIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsFindByIdRequest) Execute() (Nic, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsFindByIdExecute(r) +} + +/* + * DatacentersServersNicsFindById Retrieve NICs + * Retrieve the properties of the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsFindByIdRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsFindById(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFindByIdRequest { + return ApiDatacentersServersNicsFindByIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + * @return Nic + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsFindByIdExecute(r ApiDatacentersServersNicsFindByIdRequest) (Nic, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Nic + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsGetRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 + xContractNumber *int32 + offset *int32 + limit *int32 +} + +func (r ApiDatacentersServersNicsGetRequest) Pretty(pretty bool) ApiDatacentersServersNicsGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsGetRequest) Depth(depth int32) ApiDatacentersServersNicsGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsGetRequest { + r.xContractNumber = &xContractNumber + return r +} +func (r ApiDatacentersServersNicsGetRequest) Offset(offset int32) ApiDatacentersServersNicsGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersNicsGetRequest) Limit(limit int32) ApiDatacentersServersNicsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersNicsGetRequest) Filter(key string, value string) ApiDatacentersServersNicsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersNicsGetRequest) OrderBy(orderBy string) ApiDatacentersServersNicsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersNicsGetRequest) MaxResults(maxResults int32) ApiDatacentersServersNicsGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersServersNicsGetRequest) Execute() (Nics, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsGetExecute(r) +} + +/* + * DatacentersServersNicsGet List NICs + * List all NICs, attached to the specified server. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersNicsGetRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersNicsGetRequest { + return ApiDatacentersServersNicsGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return Nics + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsGetExecute(r ApiDatacentersServersNicsGetRequest) (Nics, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Nics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsPatchRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + datacenterId string + serverId string + nicId string + nic *NicProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsPatchRequest) Nic(nic NicProperties) ApiDatacentersServersNicsPatchRequest { + r.nic = &nic + return r +} +func (r ApiDatacentersServersNicsPatchRequest) Pretty(pretty bool) ApiDatacentersServersNicsPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsPatchRequest) Depth(depth int32) ApiDatacentersServersNicsPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsPatchRequest) Execute() (Nic, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsPatchExecute(r) +} + +/* + * DatacentersServersNicsPatch Partially modify NICs + * Update the properties of the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsPatchRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPatch(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsPatchRequest { + return ApiDatacentersServersNicsPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + * @return Nic + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPatchExecute(r ApiDatacentersServersNicsPatchRequest) (Nic, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Nic + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.nic == nil { + return localVarReturnValue, nil, reportError("nic is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.nic + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsPostRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + datacenterId string + serverId string + nic *Nic + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsPostRequest) Nic(nic Nic) ApiDatacentersServersNicsPostRequest { + r.nic = &nic + return r +} +func (r ApiDatacentersServersNicsPostRequest) Pretty(pretty bool) ApiDatacentersServersNicsPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsPostRequest) Depth(depth int32) ApiDatacentersServersNicsPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsPostRequest) Execute() (Nic, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsPostExecute(r) +} + +/* + * DatacentersServersNicsPost Create NICs + * Add a NIC to the specified server. The combined total of NICs and attached volumes cannot exceed 24 per server. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersNicsPostRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersNicsPostRequest { + return ApiDatacentersServersNicsPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + } +} + +/* + * Execute executes the request + * @return Nic + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPostExecute(r ApiDatacentersServersNicsPostRequest) (Nic, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Nic + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.nic == nil { + return localVarReturnValue, nil, reportError("nic is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.nic + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersNicsPutRequest struct { + ctx _context.Context + ApiService *NetworkInterfacesApiService + datacenterId string + serverId string + nicId string + nic *NicPut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersNicsPutRequest) Nic(nic NicPut) ApiDatacentersServersNicsPutRequest { + r.nic = &nic + return r +} +func (r ApiDatacentersServersNicsPutRequest) Pretty(pretty bool) ApiDatacentersServersNicsPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersNicsPutRequest) Depth(depth int32) ApiDatacentersServersNicsPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersNicsPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersNicsPutRequest) Execute() (Nic, *APIResponse, error) { + return r.ApiService.DatacentersServersNicsPutExecute(r) +} + +/* + * DatacentersServersNicsPut Modify NICs + * Modify the properties of the specified NIC. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param nicId The unique ID of the NIC. + * @return ApiDatacentersServersNicsPutRequest + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPut(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsPutRequest { + return ApiDatacentersServersNicsPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + nicId: nicId, + } +} + +/* + * Execute executes the request + * @return Nic + */ +func (a *NetworkInterfacesApiService) DatacentersServersNicsPutExecute(r ApiDatacentersServersNicsPutRequest) (Nic, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Nic + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkInterfacesApiService.DatacentersServersNicsPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.nic == nil { + return localVarReturnValue, nil, reportError("nic is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.nic + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersNicsPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_load_balancers.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_load_balancers.go new file mode 100644 index 000000000000..f601f147d48e --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_network_load_balancers.go @@ -0,0 +1,3426 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// NetworkLoadBalancersApiService NetworkLoadBalancersApi service +type NetworkLoadBalancersApiService service + +type ApiDatacentersNetworkloadbalancersDeleteRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersDeleteRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersDeleteRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersDeleteExecute(r) +} + +/* + * DatacentersNetworkloadbalancersDelete Delete Network Load Balancers + * Remove the specified Network Load Balancer from the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersDeleteRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersDelete(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersDeleteRequest { + return ApiDatacentersNetworkloadbalancersDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersDeleteExecute(r ApiDatacentersNetworkloadbalancersDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest) Execute() (NetworkLoadBalancer, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFindByNetworkLoadBalancerId Retrieve Network Load Balancers + * Retrieve the properties of the specified Network Load Balancer within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFindByNetworkLoadBalancerId(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest { + return ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancer + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdExecute(r ApiDatacentersNetworkloadbalancersFindByNetworkLoadBalancerIdRequest) (NetworkLoadBalancer, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFindByNetworkLoadBalancerId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFindByNetworkLoadBalancerId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + flowLogId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsDeleteExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsDelete Delete NLB Flow Logs + * Delete the specified Network Load Balancer Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsDelete(ctx _context.Context, datacenterId string, networkLoadBalancerId string, flowLogId string) ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsDeleteExecute(r ApiDatacentersNetworkloadbalancersFlowlogsDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + flowLogId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsFindByFlowLogId Retrieve NLB Flow Logs + * Retrieve the specified Network Load Balancer Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsFindByFlowLogId(ctx _context.Context, datacenterId string, networkLoadBalancerId string, flowLogId string) ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdExecute(r ApiDatacentersNetworkloadbalancersFlowlogsFindByFlowLogIdRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsFindByFlowLogId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsFindByFlowLogId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsGetRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + networkLoadBalancerId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) Filter(key string, value string) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) OrderBy(orderBy string) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) MaxResults(maxResults int32) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) Execute() (FlowLogs, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsGetExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsGet List NLB Flow Logs + * List all the Flow Logs for the specified Network Load Balancer. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersFlowlogsGetRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsGet(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersFlowlogsGetRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return FlowLogs + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsGetExecute(r ApiDatacentersNetworkloadbalancersFlowlogsGetRequest) (FlowLogs, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLogs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + flowLogId string + networkLoadBalancerFlowLogProperties *FlowLogProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) NetworkLoadBalancerFlowLogProperties(networkLoadBalancerFlowLogProperties FlowLogProperties) ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest { + r.networkLoadBalancerFlowLogProperties = &networkLoadBalancerFlowLogProperties + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsPatchExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsPatch Partially modify NLB Flow Logs + * Update the properties of the specified Network Load Balancer Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPatch(ctx _context.Context, datacenterId string, networkLoadBalancerId string, flowLogId string) ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPatchExecute(r ApiDatacentersNetworkloadbalancersFlowlogsPatchRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerFlowLogProperties == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerFlowLogProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerFlowLogProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsPostRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + networkLoadBalancerFlowLog *FlowLog + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) NetworkLoadBalancerFlowLog(networkLoadBalancerFlowLog FlowLog) ApiDatacentersNetworkloadbalancersFlowlogsPostRequest { + r.networkLoadBalancerFlowLog = &networkLoadBalancerFlowLog + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsPostExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsPost Create NLB Flow Logs + * Add a new Flow Log for the Network Load Balancer. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersFlowlogsPostRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPost(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersFlowlogsPostRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPostExecute(r ApiDatacentersNetworkloadbalancersFlowlogsPostRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerFlowLog == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerFlowLog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerFlowLog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersFlowlogsPutRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + flowLogId string + networkLoadBalancerFlowLog *FlowLogPut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) NetworkLoadBalancerFlowLog(networkLoadBalancerFlowLog FlowLogPut) ApiDatacentersNetworkloadbalancersFlowlogsPutRequest { + r.networkLoadBalancerFlowLog = &networkLoadBalancerFlowLog + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersFlowlogsPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersFlowlogsPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersFlowlogsPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) Execute() (FlowLog, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersFlowlogsPutExecute(r) +} + +/* + * DatacentersNetworkloadbalancersFlowlogsPut Modify NLB Flow Logs + * Modify the specified Network Load Balancer Flow Log. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param flowLogId The unique ID of the Flow Log. + * @return ApiDatacentersNetworkloadbalancersFlowlogsPutRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPut(ctx _context.Context, datacenterId string, networkLoadBalancerId string, flowLogId string) ApiDatacentersNetworkloadbalancersFlowlogsPutRequest { + return ApiDatacentersNetworkloadbalancersFlowlogsPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + flowLogId: flowLogId, + } +} + +/* + * Execute executes the request + * @return FlowLog + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersFlowlogsPutExecute(r ApiDatacentersNetworkloadbalancersFlowlogsPutRequest) (FlowLog, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue FlowLog + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersFlowlogsPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/flowlogs/{flowLogId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flowLogId"+"}", _neturl.PathEscape(parameterToString(r.flowLogId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerFlowLog == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerFlowLog is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerFlowLog + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersFlowlogsPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + forwardingRuleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesDeleteExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesDelete Delete NLB forwarding rules + * Delete the specified Network Load Balancer forwarding rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param forwardingRuleId The unique ID of the forwarding rule. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesDelete(ctx _context.Context, datacenterId string, networkLoadBalancerId string, forwardingRuleId string) ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + forwardingRuleId: forwardingRuleId, + } +} + +/* + * Execute executes the request + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesDeleteExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules/{forwardingRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"forwardingRuleId"+"}", _neturl.PathEscape(parameterToString(r.forwardingRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + forwardingRuleId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest) Execute() (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleId Retrieve NLB forwarding rules + * Retrieve the specified Network Load Balance forwarding rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param forwardingRuleId The unique ID of the forwarding rule. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleId(ctx _context.Context, datacenterId string, networkLoadBalancerId string, forwardingRuleId string) ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + forwardingRuleId: forwardingRuleId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancerForwardingRule + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleIdRequest) (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancerForwardingRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules/{forwardingRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"forwardingRuleId"+"}", _neturl.PathEscape(parameterToString(r.forwardingRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesFindByForwardingRuleId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + networkLoadBalancerId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) Filter(key string, value string) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) OrderBy(orderBy string) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) MaxResults(maxResults int32) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) Execute() (NetworkLoadBalancerForwardingRules, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesGetExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesGet List NLB forwarding rules + * List the forwarding rules for the specified Network Load Balancer. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesGet(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancerForwardingRules + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesGetExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesGetRequest) (NetworkLoadBalancerForwardingRules, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancerForwardingRules + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + forwardingRuleId string + networkLoadBalancerForwardingRuleProperties *NetworkLoadBalancerForwardingRuleProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) NetworkLoadBalancerForwardingRuleProperties(networkLoadBalancerForwardingRuleProperties NetworkLoadBalancerForwardingRuleProperties) ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest { + r.networkLoadBalancerForwardingRuleProperties = &networkLoadBalancerForwardingRuleProperties + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) Execute() (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesPatchExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesPatch Partially modify NLB forwarding rules + * Update the properties of the specified Network Load Balancer forwarding rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param forwardingRuleId The unique ID of the forwarding rule. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPatch(ctx _context.Context, datacenterId string, networkLoadBalancerId string, forwardingRuleId string) ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + forwardingRuleId: forwardingRuleId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancerForwardingRule + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPatchExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesPatchRequest) (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancerForwardingRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules/{forwardingRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"forwardingRuleId"+"}", _neturl.PathEscape(parameterToString(r.forwardingRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerForwardingRuleProperties == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerForwardingRuleProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerForwardingRuleProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + networkLoadBalancerForwardingRule *NetworkLoadBalancerForwardingRule + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) NetworkLoadBalancerForwardingRule(networkLoadBalancerForwardingRule NetworkLoadBalancerForwardingRule) ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest { + r.networkLoadBalancerForwardingRule = &networkLoadBalancerForwardingRule + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) Execute() (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesPostExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesPost Create NLB forwarding rules + * Create a forwarding rule for the specified Network Load Balancer. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPost(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancerForwardingRule + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPostExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesPostRequest) (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancerForwardingRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerForwardingRule == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerForwardingRule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerForwardingRule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + forwardingRuleId string + networkLoadBalancerForwardingRule *NetworkLoadBalancerForwardingRulePut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) NetworkLoadBalancerForwardingRule(networkLoadBalancerForwardingRule NetworkLoadBalancerForwardingRulePut) ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest { + r.networkLoadBalancerForwardingRule = &networkLoadBalancerForwardingRule + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) Execute() (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersForwardingrulesPutExecute(r) +} + +/* + * DatacentersNetworkloadbalancersForwardingrulesPut Modify NLB forwarding rules + * Modify the specified Network Load Balancer forwarding rule. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @param forwardingRuleId The unique ID of the forwarding rule. + * @return ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPut(ctx _context.Context, datacenterId string, networkLoadBalancerId string, forwardingRuleId string) ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest { + return ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + forwardingRuleId: forwardingRuleId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancerForwardingRule + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersForwardingrulesPutExecute(r ApiDatacentersNetworkloadbalancersForwardingrulesPutRequest) (NetworkLoadBalancerForwardingRule, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancerForwardingRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersForwardingrulesPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}/forwardingrules/{forwardingRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"forwardingRuleId"+"}", _neturl.PathEscape(parameterToString(r.forwardingRuleId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerForwardingRule == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerForwardingRule is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerForwardingRule + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersForwardingrulesPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersGetRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 + xContractNumber *int32 + offset *int32 + limit *int32 +} + +func (r ApiDatacentersNetworkloadbalancersGetRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersGetRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersGetRequest { + r.xContractNumber = &xContractNumber + return r +} +func (r ApiDatacentersNetworkloadbalancersGetRequest) Offset(offset int32) ApiDatacentersNetworkloadbalancersGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersNetworkloadbalancersGetRequest) Limit(limit int32) ApiDatacentersNetworkloadbalancersGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersNetworkloadbalancersGetRequest) Filter(key string, value string) ApiDatacentersNetworkloadbalancersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersNetworkloadbalancersGetRequest) OrderBy(orderBy string) ApiDatacentersNetworkloadbalancersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersNetworkloadbalancersGetRequest) MaxResults(maxResults int32) ApiDatacentersNetworkloadbalancersGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersNetworkloadbalancersGetRequest) Execute() (NetworkLoadBalancers, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersGetExecute(r) +} + +/* + * DatacentersNetworkloadbalancersGet List Network Load Balancers + * List all the Network Load Balancers within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @return ApiDatacentersNetworkloadbalancersGetRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersGet(ctx _context.Context, datacenterId string) ApiDatacentersNetworkloadbalancersGetRequest { + return ApiDatacentersNetworkloadbalancersGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancers + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersGetExecute(r ApiDatacentersNetworkloadbalancersGetRequest) (NetworkLoadBalancers, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancers + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersPatchRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + networkLoadBalancerProperties *NetworkLoadBalancerProperties + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersPatchRequest) NetworkLoadBalancerProperties(networkLoadBalancerProperties NetworkLoadBalancerProperties) ApiDatacentersNetworkloadbalancersPatchRequest { + r.networkLoadBalancerProperties = &networkLoadBalancerProperties + return r +} +func (r ApiDatacentersNetworkloadbalancersPatchRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersPatchRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersPatchRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersPatchRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersPatchRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersPatchRequest) Execute() (NetworkLoadBalancer, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersPatchExecute(r) +} + +/* + * DatacentersNetworkloadbalancersPatch Partially modify Network Load Balancers + * Update the properties of the specified Network Load Balancer within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersPatchRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPatch(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersPatchRequest { + return ApiDatacentersNetworkloadbalancersPatchRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancer + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPatchExecute(r ApiDatacentersNetworkloadbalancersPatchRequest) (NetworkLoadBalancer, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancerProperties == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancerProperties is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancerProperties + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersPostRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancer *NetworkLoadBalancer + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersPostRequest) NetworkLoadBalancer(networkLoadBalancer NetworkLoadBalancer) ApiDatacentersNetworkloadbalancersPostRequest { + r.networkLoadBalancer = &networkLoadBalancer + return r +} +func (r ApiDatacentersNetworkloadbalancersPostRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersPostRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersPostRequest) Execute() (NetworkLoadBalancer, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersPostExecute(r) +} + +/* + * DatacentersNetworkloadbalancersPost Create Network Load Balancers + * Create a Network Load Balancer within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @return ApiDatacentersNetworkloadbalancersPostRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPost(ctx _context.Context, datacenterId string) ApiDatacentersNetworkloadbalancersPostRequest { + return ApiDatacentersNetworkloadbalancersPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancer + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPostExecute(r ApiDatacentersNetworkloadbalancersPostRequest) (NetworkLoadBalancer, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancer == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancer is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancer + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersNetworkloadbalancersPutRequest struct { + ctx _context.Context + ApiService *NetworkLoadBalancersApiService + datacenterId string + networkLoadBalancerId string + networkLoadBalancer *NetworkLoadBalancerPut + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersNetworkloadbalancersPutRequest) NetworkLoadBalancer(networkLoadBalancer NetworkLoadBalancerPut) ApiDatacentersNetworkloadbalancersPutRequest { + r.networkLoadBalancer = &networkLoadBalancer + return r +} +func (r ApiDatacentersNetworkloadbalancersPutRequest) Pretty(pretty bool) ApiDatacentersNetworkloadbalancersPutRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersNetworkloadbalancersPutRequest) Depth(depth int32) ApiDatacentersNetworkloadbalancersPutRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersNetworkloadbalancersPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersNetworkloadbalancersPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersNetworkloadbalancersPutRequest) Execute() (NetworkLoadBalancer, *APIResponse, error) { + return r.ApiService.DatacentersNetworkloadbalancersPutExecute(r) +} + +/* + * DatacentersNetworkloadbalancersPut Modify Network Load Balancers + * Modify the properties of the specified Network Load Balancer within the data center. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param networkLoadBalancerId The unique ID of the Network Load Balancer. + * @return ApiDatacentersNetworkloadbalancersPutRequest + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPut(ctx _context.Context, datacenterId string, networkLoadBalancerId string) ApiDatacentersNetworkloadbalancersPutRequest { + return ApiDatacentersNetworkloadbalancersPutRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + networkLoadBalancerId: networkLoadBalancerId, + } +} + +/* + * Execute executes the request + * @return NetworkLoadBalancer + */ +func (a *NetworkLoadBalancersApiService) DatacentersNetworkloadbalancersPutExecute(r ApiDatacentersNetworkloadbalancersPutRequest) (NetworkLoadBalancer, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue NetworkLoadBalancer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NetworkLoadBalancersApiService.DatacentersNetworkloadbalancersPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/networkloadbalancers/{networkLoadBalancerId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkLoadBalancerId"+"}", _neturl.PathEscape(parameterToString(r.networkLoadBalancerId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.networkLoadBalancer == nil { + return localVarReturnValue, nil, reportError("networkLoadBalancer is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.networkLoadBalancer + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersNetworkloadbalancersPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nic.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nic.go deleted file mode 100644 index b82c51cadad1..000000000000 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_nic.go +++ /dev/null @@ -1,2099 +0,0 @@ -/* - * CLOUD API - * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionossdk - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -// NicApiService NicApi service -type NicApiService service - -type ApiDatacentersServersNicsDeleteRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsDeleteRequest) Pretty(pretty bool) ApiDatacentersServersNicsDeleteRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsDeleteRequest) Depth(depth int32) ApiDatacentersServersNicsDeleteRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsDeleteRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsDeleteExecute(r) -} - -/* - * DatacentersServersNicsDelete Delete a Nic - * Deletes the specified NIC. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsDeleteRequest - */ -func (a *NicApiService) DatacentersServersNicsDelete(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsDeleteRequest { - return ApiDatacentersServersNicsDeleteRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return map[string]interface{} - */ -func (a *NicApiService) DatacentersServersNicsDeleteExecute(r ApiDatacentersServersNicsDeleteRequest) (map[string]interface{}, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsDelete") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsDelete", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFindByIdRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFindByIdRequest) Pretty(pretty bool) ApiDatacentersServersNicsFindByIdRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFindByIdRequest) Depth(depth int32) ApiDatacentersServersNicsFindByIdRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFindByIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFindByIdRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFindByIdRequest) Execute() (Nic, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFindByIdExecute(r) -} - -/* - * DatacentersServersNicsFindById Retrieve a Nic - * Retrieves the attributes of a given NIC - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsFindByIdRequest - */ -func (a *NicApiService) DatacentersServersNicsFindById(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFindByIdRequest { - return ApiDatacentersServersNicsFindByIdRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return Nic - */ -func (a *NicApiService) DatacentersServersNicsFindByIdExecute(r ApiDatacentersServersNicsFindByIdRequest) (Nic, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Nic - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFindById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFindById", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesDeleteRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - firewallruleId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesDeleteRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesDeleteRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesDeleteRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesDeleteExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesDelete Delete a Firewall Rule - * Removes the specific Firewall Rule - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @param firewallruleId The unique ID of the Firewall Rule - * @return ApiDatacentersServersNicsFirewallrulesDeleteRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesDelete(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesDeleteRequest { - return ApiDatacentersServersNicsFirewallrulesDeleteRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - firewallruleId: firewallruleId, - } -} - -/* - * Execute executes the request - * @return map[string]interface{} - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesDeleteExecute(r ApiDatacentersServersNicsFirewallrulesDeleteRequest) (map[string]interface{}, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesDelete") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesDelete", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesFindByIdRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - firewallruleId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) Execute() (FirewallRule, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesFindByIdExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesFindById Retrieve a Firewall Rule - * Retrieves the attributes of a given Firewall Rule. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @param firewallruleId The unique ID of the Firewall Rule - * @return ApiDatacentersServersNicsFirewallrulesFindByIdRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesFindById(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesFindByIdRequest { - return ApiDatacentersServersNicsFirewallrulesFindByIdRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - firewallruleId: firewallruleId, - } -} - -/* - * Execute executes the request - * @return FirewallRule - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesFindByIdExecute(r ApiDatacentersServersNicsFirewallrulesFindByIdRequest) (FirewallRule, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FirewallRule - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesFindById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesFindById", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesGetRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesGetRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesGetRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesGetRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesGetRequest) Execute() (FirewallRules, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesGetExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesGet List Firewall Rules - * Retrieves a list of firewall rules associated with a particular NIC - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsFirewallrulesGetRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesGet(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFirewallrulesGetRequest { - return ApiDatacentersServersNicsFirewallrulesGetRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return FirewallRules - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesGetExecute(r ApiDatacentersServersNicsFirewallrulesGetRequest) (FirewallRules, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FirewallRules - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesGet", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesPatchRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - firewallruleId string - firewallrule *FirewallruleProperties - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Firewallrule(firewallrule FirewallruleProperties) ApiDatacentersServersNicsFirewallrulesPatchRequest { - r.firewallrule = &firewallrule - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPatchRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPatchRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPatchRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesPatchRequest) Execute() (FirewallRule, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesPatchExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesPatch Partially modify a Firewall Rule - * You can use update attributes of a resource - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @param firewallruleId The unique ID of the Firewall Rule - * @return ApiDatacentersServersNicsFirewallrulesPatchRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPatch(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesPatchRequest { - return ApiDatacentersServersNicsFirewallrulesPatchRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - firewallruleId: firewallruleId, - } -} - -/* - * Execute executes the request - * @return FirewallRule - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPatchExecute(r ApiDatacentersServersNicsFirewallrulesPatchRequest) (FirewallRule, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FirewallRule - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesPatch") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.firewallrule == nil { - return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.firewallrule - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesPatch", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesPostRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - firewallrule *FirewallRule - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Firewallrule(firewallrule FirewallRule) ApiDatacentersServersNicsFirewallrulesPostRequest { - r.firewallrule = &firewallrule - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPostRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPostRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPostRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesPostRequest) Execute() (FirewallRule, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesPostExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesPost Create a Firewall Rule - * This will add a Firewall Rule to the NIC - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsFirewallrulesPostRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPost(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsFirewallrulesPostRequest { - return ApiDatacentersServersNicsFirewallrulesPostRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return FirewallRule - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPostExecute(r ApiDatacentersServersNicsFirewallrulesPostRequest) (FirewallRule, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FirewallRule - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesPost") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.firewallrule == nil { - return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.firewallrule - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesPost", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsFirewallrulesPutRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - firewallruleId string - firewallrule *FirewallRule - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Firewallrule(firewallrule FirewallRule) ApiDatacentersServersNicsFirewallrulesPutRequest { - r.firewallrule = &firewallrule - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Pretty(pretty bool) ApiDatacentersServersNicsFirewallrulesPutRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Depth(depth int32) ApiDatacentersServersNicsFirewallrulesPutRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsFirewallrulesPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsFirewallrulesPutRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsFirewallrulesPutRequest) Execute() (FirewallRule, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsFirewallrulesPutExecute(r) -} - -/* - * DatacentersServersNicsFirewallrulesPut Modify a Firewall Rule - * You can use update attributes of a resource - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @param firewallruleId The unique ID of the Firewall Rule - * @return ApiDatacentersServersNicsFirewallrulesPutRequest - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPut(ctx _context.Context, datacenterId string, serverId string, nicId string, firewallruleId string) ApiDatacentersServersNicsFirewallrulesPutRequest { - return ApiDatacentersServersNicsFirewallrulesPutRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - firewallruleId: firewallruleId, - } -} - -/* - * Execute executes the request - * @return FirewallRule - */ -func (a *NicApiService) DatacentersServersNicsFirewallrulesPutExecute(r ApiDatacentersServersNicsFirewallrulesPutRequest) (FirewallRule, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue FirewallRule - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsFirewallrulesPut") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"firewallruleId"+"}", _neturl.PathEscape(parameterToString(r.firewallruleId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.firewallrule == nil { - return localVarReturnValue, nil, reportError("firewallrule is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.firewallrule - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsFirewallrulesPut", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsGetRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsGetRequest) Pretty(pretty bool) ApiDatacentersServersNicsGetRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsGetRequest) Depth(depth int32) ApiDatacentersServersNicsGetRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsGetRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsGetRequest) Execute() (Nics, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsGetExecute(r) -} - -/* - * DatacentersServersNicsGet List Nics - * Retrieves a list of NICs. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @return ApiDatacentersServersNicsGetRequest - */ -func (a *NicApiService) DatacentersServersNicsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersNicsGetRequest { - return ApiDatacentersServersNicsGetRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - } -} - -/* - * Execute executes the request - * @return Nics - */ -func (a *NicApiService) DatacentersServersNicsGetExecute(r ApiDatacentersServersNicsGetRequest) (Nics, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Nics - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsGet", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsPatchRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - nic *NicProperties - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsPatchRequest) Nic(nic NicProperties) ApiDatacentersServersNicsPatchRequest { - r.nic = &nic - return r -} -func (r ApiDatacentersServersNicsPatchRequest) Pretty(pretty bool) ApiDatacentersServersNicsPatchRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsPatchRequest) Depth(depth int32) ApiDatacentersServersNicsPatchRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsPatchRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPatchRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsPatchRequest) Execute() (Nic, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsPatchExecute(r) -} - -/* - * DatacentersServersNicsPatch Partially modify a Nic - * You can use update attributes of a Nic - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsPatchRequest - */ -func (a *NicApiService) DatacentersServersNicsPatch(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsPatchRequest { - return ApiDatacentersServersNicsPatchRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return Nic - */ -func (a *NicApiService) DatacentersServersNicsPatchExecute(r ApiDatacentersServersNicsPatchRequest) (Nic, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Nic - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsPatch") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.nic == nil { - return localVarReturnValue, nil, reportError("nic is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.nic - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsPatch", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsPostRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nic *Nic - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsPostRequest) Nic(nic Nic) ApiDatacentersServersNicsPostRequest { - r.nic = &nic - return r -} -func (r ApiDatacentersServersNicsPostRequest) Pretty(pretty bool) ApiDatacentersServersNicsPostRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsPostRequest) Depth(depth int32) ApiDatacentersServersNicsPostRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPostRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsPostRequest) Execute() (Nic, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsPostExecute(r) -} - -/* - * DatacentersServersNicsPost Create a Nic - * Adds a NIC to the target server. Combine count of Nics and volumes attached to the server should not exceed size 24. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @return ApiDatacentersServersNicsPostRequest - */ -func (a *NicApiService) DatacentersServersNicsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersNicsPostRequest { - return ApiDatacentersServersNicsPostRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - } -} - -/* - * Execute executes the request - * @return Nic - */ -func (a *NicApiService) DatacentersServersNicsPostExecute(r ApiDatacentersServersNicsPostRequest) (Nic, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Nic - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsPost") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.nic == nil { - return localVarReturnValue, nil, reportError("nic is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.nic - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsPost", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiDatacentersServersNicsPutRequest struct { - ctx _context.Context - ApiService *NicApiService - datacenterId string - serverId string - nicId string - nic *Nic - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiDatacentersServersNicsPutRequest) Nic(nic Nic) ApiDatacentersServersNicsPutRequest { - r.nic = &nic - return r -} -func (r ApiDatacentersServersNicsPutRequest) Pretty(pretty bool) ApiDatacentersServersNicsPutRequest { - r.pretty = &pretty - return r -} -func (r ApiDatacentersServersNicsPutRequest) Depth(depth int32) ApiDatacentersServersNicsPutRequest { - r.depth = &depth - return r -} -func (r ApiDatacentersServersNicsPutRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersNicsPutRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiDatacentersServersNicsPutRequest) Execute() (Nic, *APIResponse, error) { - return r.ApiService.DatacentersServersNicsPutExecute(r) -} - -/* - * DatacentersServersNicsPut Modify a Nic - * You can use update attributes of a Nic - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @param nicId The unique ID of the NIC - * @return ApiDatacentersServersNicsPutRequest - */ -func (a *NicApiService) DatacentersServersNicsPut(ctx _context.Context, datacenterId string, serverId string, nicId string) ApiDatacentersServersNicsPutRequest { - return ApiDatacentersServersNicsPutRequest{ - ApiService: a, - ctx: ctx, - datacenterId: datacenterId, - serverId: serverId, - nicId: nicId, - } -} - -/* - * Execute executes the request - * @return Nic - */ -func (a *NicApiService) DatacentersServersNicsPutExecute(r ApiDatacentersServersNicsPutRequest) (Nic, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Nic - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NicApiService.DatacentersServersNicsPut") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", _neturl.PathEscape(parameterToString(r.nicId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.nic == nil { - return localVarReturnValue, nil, reportError("nic is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.nic - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersNicsPut", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connect.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connects.go similarity index 63% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connect.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connects.go index bb74acd11509..c65d59fb2b4e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connect.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_private_cross_connects.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// PrivateCrossConnectApiService PrivateCrossConnectApi service -type PrivateCrossConnectApiService service +// PrivateCrossConnectsApiService PrivateCrossConnectsApi service +type PrivateCrossConnectsApiService service type ApiPccsDeleteRequest struct { - ctx _context.Context - ApiService *PrivateCrossConnectApiService - pccId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *PrivateCrossConnectsApiService + pccId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiPccsDeleteRequest) XContractNumber(xContractNumber int32) ApiPccsDele return r } -func (r ApiPccsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiPccsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.PccsDeleteExecute(r) } /* - * PccsDelete Delete a Private Cross-Connect - * Delete a private cross-connect if no datacenters are joined to the given PCC + * PccsDelete Delete private Cross-Connects + * Remove the specified private Cross-Connect (only if not connected to any data centers). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pccId The unique ID of the private cross-connect + * @param pccId The unique ID of the private Cross-Connect. * @return ApiPccsDeleteRequest */ -func (a *PrivateCrossConnectApiService) PccsDelete(ctx _context.Context, pccId string) ApiPccsDeleteRequest { +func (a *PrivateCrossConnectsApiService) PccsDelete(ctx _context.Context, pccId string) ApiPccsDeleteRequest { return ApiPccsDeleteRequest{ ApiService: a, - ctx: ctx, - pccId: pccId, + ctx: ctx, + pccId: pccId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *PrivateCrossConnectApiService) PccsDeleteExecute(r ApiPccsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *PrivateCrossConnectsApiService) PccsDeleteExecute(r ApiPccsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectApiService.PccsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectsApiService.PccsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pccs/{pccId}" @@ -95,10 +94,21 @@ func (a *PrivateCrossConnectApiService) PccsDeleteExecute(r ApiPccsDeleteRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *PrivateCrossConnectApiService) PccsDeleteExecute(r ApiPccsDeleteRequest } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "PccsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "PccsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiPccsFindByIdRequest struct { - ctx _context.Context - ApiService *PrivateCrossConnectApiService - pccId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *PrivateCrossConnectsApiService + pccId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,17 +215,17 @@ func (r ApiPccsFindByIdRequest) Execute() (PrivateCrossConnect, *APIResponse, er } /* - * PccsFindById Retrieve a Private Cross-Connect - * You can retrieve a private cross-connect by using the resource's ID. This value can be found in the response body when a private cross-connect is created or when you GET a list of private cross-connects. + * PccsFindById Retrieve private Cross-Connects + * Retrieve a private Cross-Connect by the resource ID. Cross-Connect ID is in the response body when the private Cross-Connect is created, and in the list of private Cross-Connects, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pccId The unique ID of the private cross-connect + * @param pccId The unique ID of the private Cross-Connect. * @return ApiPccsFindByIdRequest */ -func (a *PrivateCrossConnectApiService) PccsFindById(ctx _context.Context, pccId string) ApiPccsFindByIdRequest { +func (a *PrivateCrossConnectsApiService) PccsFindById(ctx _context.Context, pccId string) ApiPccsFindByIdRequest { return ApiPccsFindByIdRequest{ ApiService: a, - ctx: ctx, - pccId: pccId, + ctx: ctx, + pccId: pccId, } } @@ -230,7 +233,7 @@ func (a *PrivateCrossConnectApiService) PccsFindById(ctx _context.Context, pccId * Execute executes the request * @return PrivateCrossConnect */ -func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdRequest) (PrivateCrossConnect, *APIResponse, error) { +func (a *PrivateCrossConnectsApiService) PccsFindByIdExecute(r ApiPccsFindByIdRequest) (PrivateCrossConnect, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +243,7 @@ func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdReq localVarReturnValue PrivateCrossConnect ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectApiService.PccsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectsApiService.PccsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +257,21 @@ func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdReq if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdReq return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "PccsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "PccsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdReq if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +362,13 @@ func (a *PrivateCrossConnectApiService) PccsFindByIdExecute(r ApiPccsFindByIdReq } type ApiPccsGetRequest struct { - ctx _context.Context - ApiService *PrivateCrossConnectApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *PrivateCrossConnectsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +385,40 @@ func (r ApiPccsGetRequest) XContractNumber(xContractNumber int32) ApiPccsGetRequ return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiPccsGetRequest) Filter(key string, value string) ApiPccsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiPccsGetRequest) OrderBy(orderBy string) ApiPccsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiPccsGetRequest) MaxResults(maxResults int32) ApiPccsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiPccsGetRequest) Execute() (PrivateCrossConnects, *APIResponse, error) { return r.ApiService.PccsGetExecute(r) } /* - * PccsGet List Private Cross-Connects - * You can retrieve a complete list of private cross-connects provisioned under your account + * PccsGet List private Cross-Connects + * List all private Cross-Connects for your account. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiPccsGetRequest */ -func (a *PrivateCrossConnectApiService) PccsGet(ctx _context.Context) ApiPccsGetRequest { +func (a *PrivateCrossConnectsApiService) PccsGet(ctx _context.Context) ApiPccsGetRequest { return ApiPccsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -386,7 +426,7 @@ func (a *PrivateCrossConnectApiService) PccsGet(ctx _context.Context) ApiPccsGet * Execute executes the request * @return PrivateCrossConnects */ -func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (PrivateCrossConnects, *APIResponse, error) { +func (a *PrivateCrossConnectsApiService) PccsGetExecute(r ApiPccsGetRequest) (PrivateCrossConnects, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -396,7 +436,7 @@ func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (Pri localVarReturnValue PrivateCrossConnects ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectApiService.PccsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectsApiService.PccsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -409,10 +449,34 @@ func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (Pri if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +516,14 @@ func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (Pri return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "PccsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "PccsGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +539,26 @@ func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (Pri if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,12 +567,12 @@ func (a *PrivateCrossConnectApiService) PccsGetExecute(r ApiPccsGetRequest) (Pri } type ApiPccsPatchRequest struct { - ctx _context.Context - ApiService *PrivateCrossConnectApiService - pccId string - pcc *PrivateCrossConnectProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *PrivateCrossConnectsApiService + pccId string + pcc *PrivateCrossConnectProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -531,17 +598,17 @@ func (r ApiPccsPatchRequest) Execute() (PrivateCrossConnect, *APIResponse, error } /* - * PccsPatch Partially modify a private cross-connect - * You can use update private cross-connect to re-name or update its description + * PccsPatch Partially modify private Cross-Connects + * Update the properties of the specified private Cross-Connect. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pccId The unique ID of the private cross-connect + * @param pccId The unique ID of the private Cross-Connect. * @return ApiPccsPatchRequest */ -func (a *PrivateCrossConnectApiService) PccsPatch(ctx _context.Context, pccId string) ApiPccsPatchRequest { +func (a *PrivateCrossConnectsApiService) PccsPatch(ctx _context.Context, pccId string) ApiPccsPatchRequest { return ApiPccsPatchRequest{ ApiService: a, - ctx: ctx, - pccId: pccId, + ctx: ctx, + pccId: pccId, } } @@ -549,7 +616,7 @@ func (a *PrivateCrossConnectApiService) PccsPatch(ctx _context.Context, pccId st * Execute executes the request * @return PrivateCrossConnect */ -func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) (PrivateCrossConnect, *APIResponse, error) { +func (a *PrivateCrossConnectsApiService) PccsPatchExecute(r ApiPccsPatchRequest) (PrivateCrossConnect, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -559,7 +626,7 @@ func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) localVarReturnValue PrivateCrossConnect ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectApiService.PccsPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectsApiService.PccsPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -576,10 +643,21 @@ func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -621,13 +699,14 @@ func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "PccsPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "PccsPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +722,26 @@ func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,11 +750,11 @@ func (a *PrivateCrossConnectApiService) PccsPatchExecute(r ApiPccsPatchRequest) } type ApiPccsPostRequest struct { - ctx _context.Context - ApiService *PrivateCrossConnectApiService - pcc *PrivateCrossConnect - pretty *bool - depth *int32 + ctx _context.Context + ApiService *PrivateCrossConnectsApiService + pcc *PrivateCrossConnect + pretty *bool + depth *int32 xContractNumber *int32 } @@ -699,15 +780,15 @@ func (r ApiPccsPostRequest) Execute() (PrivateCrossConnect, *APIResponse, error) } /* - * PccsPost Create a Private Cross-Connect - * You can use this POST method to create a private cross-connect + * PccsPost Create private Cross-Connects + * Create a private Cross-Connect. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiPccsPostRequest */ -func (a *PrivateCrossConnectApiService) PccsPost(ctx _context.Context) ApiPccsPostRequest { +func (a *PrivateCrossConnectsApiService) PccsPost(ctx _context.Context) ApiPccsPostRequest { return ApiPccsPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -715,7 +796,7 @@ func (a *PrivateCrossConnectApiService) PccsPost(ctx _context.Context) ApiPccsPo * Execute executes the request * @return PrivateCrossConnect */ -func (a *PrivateCrossConnectApiService) PccsPostExecute(r ApiPccsPostRequest) (PrivateCrossConnect, *APIResponse, error) { +func (a *PrivateCrossConnectsApiService) PccsPostExecute(r ApiPccsPostRequest) (PrivateCrossConnect, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -725,7 +806,7 @@ func (a *PrivateCrossConnectApiService) PccsPostExecute(r ApiPccsPostRequest) (P localVarReturnValue PrivateCrossConnect ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectApiService.PccsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PrivateCrossConnectsApiService.PccsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -741,10 +822,21 @@ func (a *PrivateCrossConnectApiService) PccsPostExecute(r ApiPccsPostRequest) (P if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -786,13 +878,14 @@ func (a *PrivateCrossConnectApiService) PccsPostExecute(r ApiPccsPostRequest) (P return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "PccsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "PccsPost", } if err != nil || localVarHTTPResponse == nil { @@ -808,24 +901,26 @@ func (a *PrivateCrossConnectApiService) PccsPostExecute(r ApiPccsPostRequest) (P if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_request.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_requests.go similarity index 56% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_request.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_requests.go index f9cab7010ca6..0ae0db6a1224 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_request.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_requests.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// RequestApiService RequestApi service -type RequestApiService service +// RequestsApiService RequestsApi service +type RequestsApiService service type ApiRequestsFindByIdRequest struct { - ctx _context.Context - ApiService *RequestApiService - requestId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *RequestsApiService + requestId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -53,17 +54,17 @@ func (r ApiRequestsFindByIdRequest) Execute() (Request, *APIResponse, error) { } /* - * RequestsFindById Retrieve a Request - * Retrieves the attributes of a given request. + * RequestsFindById Retrieve requests + * Retrieve the properties of the specified request. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requestId + * @param requestId The unique ID of the request. * @return ApiRequestsFindByIdRequest */ -func (a *RequestApiService) RequestsFindById(ctx _context.Context, requestId string) ApiRequestsFindByIdRequest { +func (a *RequestsApiService) RequestsFindById(ctx _context.Context, requestId string) ApiRequestsFindByIdRequest { return ApiRequestsFindByIdRequest{ ApiService: a, - ctx: ctx, - requestId: requestId, + ctx: ctx, + requestId: requestId, } } @@ -71,7 +72,7 @@ func (a *RequestApiService) RequestsFindById(ctx _context.Context, requestId str * Execute executes the request * @return Request */ -func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest) (Request, *APIResponse, error) { +func (a *RequestsApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest) (Request, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -81,7 +82,7 @@ func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest localVarReturnValue Request ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestApiService.RequestsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.RequestsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -95,10 +96,21 @@ func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -138,13 +150,14 @@ func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "RequestsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "RequestsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -160,24 +173,26 @@ func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -186,18 +201,27 @@ func (a *RequestApiService) RequestsFindByIdExecute(r ApiRequestsFindByIdRequest } type ApiRequestsGetRequest struct { - ctx _context.Context - ApiService *RequestApiService - pretty *bool - depth *int32 - xContractNumber *int32 - filterStatus *string - filterCreatedAfter *string + ctx _context.Context + ApiService *RequestsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 + xContractNumber *int32 + filterStatus *string + filterCreatedAfter *string filterCreatedBefore *string - filterUrl *string - filterCreatedDate *string - filterMethod *string - filterBody *string + filterCreatedDate *string + filterCreatedBy *string + filterEtag *string + filterRequestStatus *string + filterMethod *string + filterHeaders *string + filterBody *string + filterUrl *string + offset *int32 + limit *int32 } func (r ApiRequestsGetRequest) Pretty(pretty bool) ApiRequestsGetRequest { @@ -224,37 +248,81 @@ func (r ApiRequestsGetRequest) FilterCreatedBefore(filterCreatedBefore string) A r.filterCreatedBefore = &filterCreatedBefore return r } -func (r ApiRequestsGetRequest) FilterUrl(filterUrl string) ApiRequestsGetRequest { - r.filterUrl = &filterUrl - return r -} func (r ApiRequestsGetRequest) FilterCreatedDate(filterCreatedDate string) ApiRequestsGetRequest { r.filterCreatedDate = &filterCreatedDate return r } +func (r ApiRequestsGetRequest) FilterCreatedBy(filterCreatedBy string) ApiRequestsGetRequest { + r.filterCreatedBy = &filterCreatedBy + return r +} +func (r ApiRequestsGetRequest) FilterEtag(filterEtag string) ApiRequestsGetRequest { + r.filterEtag = &filterEtag + return r +} +func (r ApiRequestsGetRequest) FilterRequestStatus(filterRequestStatus string) ApiRequestsGetRequest { + r.filterRequestStatus = &filterRequestStatus + return r +} func (r ApiRequestsGetRequest) FilterMethod(filterMethod string) ApiRequestsGetRequest { r.filterMethod = &filterMethod return r } +func (r ApiRequestsGetRequest) FilterHeaders(filterHeaders string) ApiRequestsGetRequest { + r.filterHeaders = &filterHeaders + return r +} func (r ApiRequestsGetRequest) FilterBody(filterBody string) ApiRequestsGetRequest { r.filterBody = &filterBody return r } +func (r ApiRequestsGetRequest) FilterUrl(filterUrl string) ApiRequestsGetRequest { + r.filterUrl = &filterUrl + return r +} +func (r ApiRequestsGetRequest) Offset(offset int32) ApiRequestsGetRequest { + r.offset = &offset + return r +} +func (r ApiRequestsGetRequest) Limit(limit int32) ApiRequestsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiRequestsGetRequest) Filter(key string, value string) ApiRequestsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiRequestsGetRequest) OrderBy(orderBy string) ApiRequestsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiRequestsGetRequest) MaxResults(maxResults int32) ApiRequestsGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiRequestsGetRequest) Execute() (Requests, *APIResponse, error) { return r.ApiService.RequestsGetExecute(r) } /* - * RequestsGet List Requests - * Retrieve a list of API requests. + * RequestsGet List requests + * List all API requests. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiRequestsGetRequest */ -func (a *RequestApiService) RequestsGet(ctx _context.Context) ApiRequestsGetRequest { +func (a *RequestsApiService) RequestsGet(ctx _context.Context) ApiRequestsGetRequest { return ApiRequestsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -262,7 +330,7 @@ func (a *RequestApiService) RequestsGet(ctx _context.Context) ApiRequestsGetRequ * Execute executes the request * @return Requests */ -func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Requests, *APIResponse, error) { +func (a *RequestsApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Requests, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -272,7 +340,7 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request localVarReturnValue Requests ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestApiService.RequestsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.RequestsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -285,9 +353,19 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } if r.filterStatus != nil { localVarQueryParams.Add("filter.status", parameterToString(*r.filterStatus, "")) @@ -298,18 +376,60 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request if r.filterCreatedBefore != nil { localVarQueryParams.Add("filter.createdBefore", parameterToString(*r.filterCreatedBefore, "")) } - if r.filterUrl != nil { - localVarQueryParams.Add("filter.url", parameterToString(*r.filterUrl, "")) - } if r.filterCreatedDate != nil { localVarQueryParams.Add("filter.createdDate", parameterToString(*r.filterCreatedDate, "")) } + if r.filterCreatedBy != nil { + localVarQueryParams.Add("filter.createdBy", parameterToString(*r.filterCreatedBy, "")) + } + if r.filterEtag != nil { + localVarQueryParams.Add("filter.etag", parameterToString(*r.filterEtag, "")) + } + if r.filterRequestStatus != nil { + localVarQueryParams.Add("filter.requestStatus", parameterToString(*r.filterRequestStatus, "")) + } if r.filterMethod != nil { localVarQueryParams.Add("filter.method", parameterToString(*r.filterMethod, "")) } + if r.filterHeaders != nil { + localVarQueryParams.Add("filter.headers", parameterToString(*r.filterHeaders, "")) + } if r.filterBody != nil { localVarQueryParams.Add("filter.body", parameterToString(*r.filterBody, "")) } + if r.filterUrl != nil { + localVarQueryParams.Add("filter.url", parameterToString(*r.filterUrl, "")) + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -349,13 +469,14 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "RequestsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "RequestsGet", } if err != nil || localVarHTTPResponse == nil { @@ -371,24 +492,26 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -397,11 +520,14 @@ func (a *RequestApiService) RequestsGetExecute(r ApiRequestsGetRequest) (Request } type ApiRequestsStatusGetRequest struct { - ctx _context.Context - ApiService *RequestApiService - requestId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *RequestsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + requestId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -418,22 +544,42 @@ func (r ApiRequestsStatusGetRequest) XContractNumber(xContractNumber int32) ApiR return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiRequestsStatusGetRequest) Filter(key string, value string) ApiRequestsStatusGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiRequestsStatusGetRequest) OrderBy(orderBy string) ApiRequestsStatusGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiRequestsStatusGetRequest) MaxResults(maxResults int32) ApiRequestsStatusGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiRequestsStatusGetRequest) Execute() (RequestStatus, *APIResponse, error) { return r.ApiService.RequestsStatusGetExecute(r) } /* - * RequestsStatusGet Retrieve Request Status - * Retrieves the status of a given request. + * RequestsStatusGet Retrieve request status + * Retrieve the status of the specified request. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requestId + * @param requestId The unique ID of the request. * @return ApiRequestsStatusGetRequest */ -func (a *RequestApiService) RequestsStatusGet(ctx _context.Context, requestId string) ApiRequestsStatusGetRequest { +func (a *RequestsApiService) RequestsStatusGet(ctx _context.Context, requestId string) ApiRequestsStatusGetRequest { return ApiRequestsStatusGetRequest{ ApiService: a, - ctx: ctx, - requestId: requestId, + ctx: ctx, + requestId: requestId, + filters: _neturl.Values{}, } } @@ -441,7 +587,7 @@ func (a *RequestApiService) RequestsStatusGet(ctx _context.Context, requestId st * Execute executes the request * @return RequestStatus */ -func (a *RequestApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetRequest) (RequestStatus, *APIResponse, error) { +func (a *RequestsApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetRequest) (RequestStatus, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -451,7 +597,7 @@ func (a *RequestApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetReque localVarReturnValue RequestStatus ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestApiService.RequestsStatusGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.RequestsStatusGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -465,10 +611,34 @@ func (a *RequestApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetReque if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -508,13 +678,14 @@ func (a *RequestApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetReque return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "RequestsStatusGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "RequestsStatusGet", } if err != nil || localVarHTTPResponse == nil { @@ -530,24 +701,26 @@ func (a *RequestApiService) RequestsStatusGetExecute(r ApiRequestsStatusGetReque if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_server.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_servers.go similarity index 50% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_server.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_servers.go index 232be2662004..4424101012ac 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_server.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_servers.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,17 +24,17 @@ var ( _ _context.Context ) -// ServerApiService ServerApi service -type ServerApiService service +// ServersApiService ServersApi service +type ServersApiService service type ApiDatacentersServersCdromsDeleteRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - cdromId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + cdromId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -50,46 +51,44 @@ func (r ApiDatacentersServersCdromsDeleteRequest) XContractNumber(xContractNumbe return r } -func (r ApiDatacentersServersCdromsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersServersCdromsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersServersCdromsDeleteExecute(r) } /* - * DatacentersServersCdromsDelete Detach a CD-ROM - * This will detach a CD-ROM from the server + * DatacentersServersCdromsDelete Detach CD-ROMs + * Detach the specified CD-ROM from the server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param cdromId The unique ID of the CD-ROM + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param cdromId The unique ID of the CD-ROM. * @return ApiDatacentersServersCdromsDeleteRequest */ -func (a *ServerApiService) DatacentersServersCdromsDelete(ctx _context.Context, datacenterId string, serverId string, cdromId string) ApiDatacentersServersCdromsDeleteRequest { +func (a *ServersApiService) DatacentersServersCdromsDelete(ctx _context.Context, datacenterId string, serverId string, cdromId string) ApiDatacentersServersCdromsDeleteRequest { return ApiDatacentersServersCdromsDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - cdromId: cdromId, + serverId: serverId, + cdromId: cdromId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersCdromsDeleteExecute(r ApiDatacentersServersCdromsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersCdromsDeleteExecute(r ApiDatacentersServersCdromsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersCdromsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersCdromsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}" @@ -103,10 +102,21 @@ func (a *ServerApiService) DatacentersServersCdromsDeleteExecute(r ApiDatacenter if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -143,64 +153,57 @@ func (a *ServerApiService) DatacentersServersCdromsDeleteExecute(r ApiDatacenter } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersCdromsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersCdromsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersServersCdromsFindByIdRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - cdromId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + cdromId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -222,21 +225,21 @@ func (r ApiDatacentersServersCdromsFindByIdRequest) Execute() (Image, *APIRespon } /* - * DatacentersServersCdromsFindById Retrieve an attached CD-ROM - * You can retrieve a specific CD-ROM attached to the server + * DatacentersServersCdromsFindById Retrieve attached CD-ROMs + * Retrieve the properties of the CD-ROM, attached to the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param cdromId The unique ID of the CD-ROM + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param cdromId The unique ID of the CD-ROM. * @return ApiDatacentersServersCdromsFindByIdRequest */ -func (a *ServerApiService) DatacentersServersCdromsFindById(ctx _context.Context, datacenterId string, serverId string, cdromId string) ApiDatacentersServersCdromsFindByIdRequest { +func (a *ServersApiService) DatacentersServersCdromsFindById(ctx _context.Context, datacenterId string, serverId string, cdromId string) ApiDatacentersServersCdromsFindByIdRequest { return ApiDatacentersServersCdromsFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - cdromId: cdromId, + serverId: serverId, + cdromId: cdromId, } } @@ -244,7 +247,7 @@ func (a *ServerApiService) DatacentersServersCdromsFindById(ctx _context.Context * Execute executes the request * @return Image */ -func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacentersServersCdromsFindByIdRequest) (Image, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacentersServersCdromsFindByIdRequest) (Image, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -254,7 +257,7 @@ func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacent localVarReturnValue Image ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersCdromsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersCdromsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -270,10 +273,21 @@ func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacent if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -313,13 +327,14 @@ func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacent return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersCdromsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersCdromsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -335,24 +350,26 @@ func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacent if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -361,13 +378,18 @@ func (a *ServerApiService) DatacentersServersCdromsFindByIdExecute(r ApiDatacent } type ApiDatacentersServersCdromsGetRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersServersCdromsGetRequest) Pretty(pretty bool) ApiDatacentersServersCdromsGetRequest { @@ -382,25 +404,53 @@ func (r ApiDatacentersServersCdromsGetRequest) XContractNumber(xContractNumber i r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersServersCdromsGetRequest) Offset(offset int32) ApiDatacentersServersCdromsGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersCdromsGetRequest) Limit(limit int32) ApiDatacentersServersCdromsGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersCdromsGetRequest) Filter(key string, value string) ApiDatacentersServersCdromsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersCdromsGetRequest) OrderBy(orderBy string) ApiDatacentersServersCdromsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersCdromsGetRequest) MaxResults(maxResults int32) ApiDatacentersServersCdromsGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersServersCdromsGetRequest) Execute() (Cdroms, *APIResponse, error) { return r.ApiService.DatacentersServersCdromsGetExecute(r) } /* - * DatacentersServersCdromsGet List attached CD-ROMs - * You can retrieve a list of CD-ROMs attached to the server. + * DatacentersServersCdromsGet List attached CD-ROMs + * List all CD-ROMs, attached to the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersCdromsGetRequest */ -func (a *ServerApiService) DatacentersServersCdromsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersCdromsGetRequest { +func (a *ServersApiService) DatacentersServersCdromsGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersCdromsGetRequest { return ApiDatacentersServersCdromsGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, + filters: _neturl.Values{}, } } @@ -408,7 +458,7 @@ func (a *ServerApiService) DatacentersServersCdromsGet(ctx _context.Context, dat * Execute executes the request * @return Cdroms */ -func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersServersCdromsGetRequest) (Cdroms, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersServersCdromsGetRequest) (Cdroms, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -418,7 +468,7 @@ func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersSe localVarReturnValue Cdroms ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersCdromsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersCdromsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -433,10 +483,50 @@ func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersSe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -476,13 +566,14 @@ func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersSe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersCdromsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersCdromsGet", } if err != nil || localVarHTTPResponse == nil { @@ -498,24 +589,26 @@ func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersSe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -524,13 +617,13 @@ func (a *ServerApiService) DatacentersServersCdromsGetExecute(r ApiDatacentersSe } type ApiDatacentersServersCdromsPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - cdrom *Image - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + cdrom *Image + pretty *bool + depth *int32 xContractNumber *int32 } @@ -556,19 +649,19 @@ func (r ApiDatacentersServersCdromsPostRequest) Execute() (Image, *APIResponse, } /* - * DatacentersServersCdromsPost Attach a CD-ROM - * You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server. + * DatacentersServersCdromsPost Attach CD-ROMs + * Attach a CD-ROM to an existing server. Up to two CD-ROMs can be attached to the same server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersCdromsPostRequest */ -func (a *ServerApiService) DatacentersServersCdromsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersCdromsPostRequest { +func (a *ServersApiService) DatacentersServersCdromsPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersCdromsPostRequest { return ApiDatacentersServersCdromsPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -576,7 +669,7 @@ func (a *ServerApiService) DatacentersServersCdromsPost(ctx _context.Context, da * Execute executes the request * @return Image */ -func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersServersCdromsPostRequest) (Image, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersServersCdromsPostRequest) (Image, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -586,7 +679,7 @@ func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersS localVarReturnValue Image ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersCdromsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersCdromsPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -604,10 +697,21 @@ func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersS if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -649,13 +753,14 @@ func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersS return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersCdromsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersCdromsPost", } if err != nil || localVarHTTPResponse == nil { @@ -671,24 +776,26 @@ func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersS if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -697,12 +804,12 @@ func (a *ServerApiService) DatacentersServersCdromsPostExecute(r ApiDatacentersS } type ApiDatacentersServersDeleteRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -719,44 +826,42 @@ func (r ApiDatacentersServersDeleteRequest) XContractNumber(xContractNumber int3 return r } -func (r ApiDatacentersServersDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersServersDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersServersDeleteExecute(r) } /* - * DatacentersServersDelete Delete a Server - * This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action + * DatacentersServersDelete Delete servers + * Delete the specified server in your data center. The attached storage volumes will not be removed — a separate API call must be made for these actions. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersDeleteRequest */ -func (a *ServerApiService) DatacentersServersDelete(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersDeleteRequest { +func (a *ServersApiService) DatacentersServersDelete(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersDeleteRequest { return ApiDatacentersServersDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersDeleteExecute(r ApiDatacentersServersDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersDeleteExecute(r ApiDatacentersServersDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}" @@ -769,10 +874,21 @@ func (a *ServerApiService) DatacentersServersDeleteExecute(r ApiDatacentersServe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -809,63 +925,56 @@ func (a *ServerApiService) DatacentersServersDeleteExecute(r ApiDatacentersServe } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersServersFindByIdRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -887,19 +996,19 @@ func (r ApiDatacentersServersFindByIdRequest) Execute() (Server, *APIResponse, e } /* - * DatacentersServersFindById Retrieve a Server - * Returns information about a server such as its configuration, provisioning status, etc. + * DatacentersServersFindById Retrieve servers by ID + * Retrieve information about the specified server within the data center, such as its configuration, provisioning status, and so on. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersFindByIdRequest */ -func (a *ServerApiService) DatacentersServersFindById(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersFindByIdRequest { +func (a *ServersApiService) DatacentersServersFindById(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersFindByIdRequest { return ApiDatacentersServersFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -907,7 +1016,7 @@ func (a *ServerApiService) DatacentersServersFindById(ctx _context.Context, data * Execute executes the request * @return Server */ -func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersServersFindByIdRequest) (Server, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersFindByIdExecute(r ApiDatacentersServersFindByIdRequest) (Server, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -917,7 +1026,7 @@ func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersSer localVarReturnValue Server ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -932,10 +1041,21 @@ func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersSer if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -975,13 +1095,14 @@ func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersSer return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersFindById", } if err != nil || localVarHTTPResponse == nil { @@ -997,24 +1118,26 @@ func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersSer if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1023,13 +1146,18 @@ func (a *ServerApiService) DatacentersServersFindByIdExecute(r ApiDatacentersSer } type ApiDatacentersServersGetRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - pretty *bool - depth *int32 - upgradeNeeded *bool + ctx _context.Context + ApiService *ServersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 + upgradeNeeded *bool xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersServersGetRequest) Pretty(pretty bool) ApiDatacentersServersGetRequest { @@ -1048,23 +1176,51 @@ func (r ApiDatacentersServersGetRequest) XContractNumber(xContractNumber int32) r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersServersGetRequest) Offset(offset int32) ApiDatacentersServersGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersGetRequest) Limit(limit int32) ApiDatacentersServersGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersGetRequest) Filter(key string, value string) ApiDatacentersServersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersGetRequest) OrderBy(orderBy string) ApiDatacentersServersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersGetRequest) MaxResults(maxResults int32) ApiDatacentersServersGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersServersGetRequest) Execute() (Servers, *APIResponse, error) { return r.ApiService.DatacentersServersGetExecute(r) } /* - * DatacentersServersGet List Servers - * You can retrieve a list of servers within a datacenter + * DatacentersServersGet List servers + * List all servers within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersServersGetRequest */ -func (a *ServerApiService) DatacentersServersGet(ctx _context.Context, datacenterId string) ApiDatacentersServersGetRequest { +func (a *ServersApiService) DatacentersServersGet(ctx _context.Context, datacenterId string) ApiDatacentersServersGetRequest { return ApiDatacentersServersGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, + filters: _neturl.Values{}, } } @@ -1072,7 +1228,7 @@ func (a *ServerApiService) DatacentersServersGet(ctx _context.Context, datacente * Execute executes the request * @return Servers */ -func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersGetRequest) (Servers, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersGetExecute(r ApiDatacentersServersGetRequest) (Servers, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1082,7 +1238,7 @@ func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersG localVarReturnValue Servers ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1096,13 +1252,53 @@ func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersG if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } if r.upgradeNeeded != nil { localVarQueryParams.Add("upgradeNeeded", parameterToString(*r.upgradeNeeded, "")) } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1142,13 +1338,14 @@ func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersG return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersGet", } if err != nil || localVarHTTPResponse == nil { @@ -1164,24 +1361,26 @@ func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersG if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1190,13 +1389,13 @@ func (a *ServerApiService) DatacentersServersGetExecute(r ApiDatacentersServersG } type ApiDatacentersServersPatchRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - server *ServerProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + server *ServerProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1222,19 +1421,19 @@ func (r ApiDatacentersServersPatchRequest) Execute() (Server, *APIResponse, erro } /* - * DatacentersServersPatch Partially modify a Server - * You can use update attributes of a server + * DatacentersServersPatch Partially modify servers + * Update the properties of the specified server within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersPatchRequest */ -func (a *ServerApiService) DatacentersServersPatch(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersPatchRequest { +func (a *ServersApiService) DatacentersServersPatch(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersPatchRequest { return ApiDatacentersServersPatchRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -1242,7 +1441,7 @@ func (a *ServerApiService) DatacentersServersPatch(ctx _context.Context, datacen * Execute executes the request * @return Server */ -func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServersPatchRequest) (Server, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersPatchExecute(r ApiDatacentersServersPatchRequest) (Server, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -1252,7 +1451,7 @@ func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServer localVarReturnValue Server ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1270,10 +1469,21 @@ func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServer if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1315,13 +1525,14 @@ func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServer return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersPatch", } if err != nil || localVarHTTPResponse == nil { @@ -1337,24 +1548,26 @@ func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServer if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1363,12 +1576,12 @@ func (a *ServerApiService) DatacentersServersPatchExecute(r ApiDatacentersServer } type ApiDatacentersServersPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - server *Server - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + server *Server + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1394,16 +1607,16 @@ func (r ApiDatacentersServersPostRequest) Execute() (Server, *APIResponse, error } /* - * DatacentersServersPost Create a Server - * Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN. + * DatacentersServersPost Create servers + * Create a server within the specified data center. You can also use this request to configure the boot volumes and connect to existing LANs at the same time. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersServersPostRequest */ -func (a *ServerApiService) DatacentersServersPost(ctx _context.Context, datacenterId string) ApiDatacentersServersPostRequest { +func (a *ServersApiService) DatacentersServersPost(ctx _context.Context, datacenterId string) ApiDatacentersServersPostRequest { return ApiDatacentersServersPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -1412,7 +1625,7 @@ func (a *ServerApiService) DatacentersServersPost(ctx _context.Context, datacent * Execute executes the request * @return Server */ -func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServersPostRequest) (Server, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersPostExecute(r ApiDatacentersServersPostRequest) (Server, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1422,7 +1635,7 @@ func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServers localVarReturnValue Server ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1439,10 +1652,21 @@ func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServers if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1484,13 +1708,14 @@ func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServers return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersPost", } if err != nil || localVarHTTPResponse == nil { @@ -1506,24 +1731,26 @@ func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServers if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1532,13 +1759,13 @@ func (a *ServerApiService) DatacentersServersPostExecute(r ApiDatacentersServers } type ApiDatacentersServersPutRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - server *Server - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + server *Server + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1564,19 +1791,21 @@ func (r ApiDatacentersServersPutRequest) Execute() (Server, *APIResponse, error) } /* - * DatacentersServersPut Modify a Server - * Allows to modify the attributes of a Server. From v5 onwards 'allowReboot' attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the 'allowReboot' property was required to be set to true which will no longer be the case and the server will be rebooted automatically + * DatacentersServersPut Modify servers + * Modify the properties of the specified server within the data center. + +Starting with v5, the 'allowReboot' attribute is retired; while previously required for changing certain server properties, this behavior is now implicit, and the backend will perform this automatically. For example, in earlier versions, when the CPU family is changed, 'allowReboot' had to be set to 'true'; this is no longer required, the reboot will be performed automatically. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersPutRequest - */ -func (a *ServerApiService) DatacentersServersPut(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersPutRequest { +*/ +func (a *ServersApiService) DatacentersServersPut(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersPutRequest { return ApiDatacentersServersPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -1584,7 +1813,7 @@ func (a *ServerApiService) DatacentersServersPut(ctx _context.Context, datacente * Execute executes the request * @return Server */ -func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersPutRequest) (Server, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersPutExecute(r ApiDatacentersServersPutRequest) (Server, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1594,7 +1823,7 @@ func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersP localVarReturnValue Server ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1612,10 +1841,21 @@ func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersP if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1657,13 +1897,14 @@ func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersP return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersPut", } if err != nil || localVarHTTPResponse == nil { @@ -1679,24 +1920,26 @@ func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersP if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1705,12 +1948,12 @@ func (a *ServerApiService) DatacentersServersPutExecute(r ApiDatacentersServersP } type ApiDatacentersServersRebootPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1727,44 +1970,42 @@ func (r ApiDatacentersServersRebootPostRequest) XContractNumber(xContractNumber return r } -func (r ApiDatacentersServersRebootPostRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersServersRebootPostRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersServersRebootPostExecute(r) } /* - * DatacentersServersRebootPost Reboot a Server - * This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on. + * DatacentersServersRebootPost Reboot servers + * Force a hard reboot of the specified server within the data center. Don't use this method if you wish to reboot gracefully. This is an equivalent of powering down a computer and turning it back on. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersRebootPostRequest */ -func (a *ServerApiService) DatacentersServersRebootPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersRebootPostRequest { +func (a *ServersApiService) DatacentersServersRebootPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersRebootPostRequest { return ApiDatacentersServersRebootPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersRebootPostExecute(r ApiDatacentersServersRebootPostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersRebootPostExecute(r ApiDatacentersServersRebootPostRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersRebootPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersRebootPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/reboot" @@ -1777,10 +2018,21 @@ func (a *ServerApiService) DatacentersServersRebootPostExecute(r ApiDatacentersS if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1817,120 +2069,136 @@ func (a *ServerApiService) DatacentersServersRebootPostExecute(r ApiDatacentersS } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersRebootPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersRebootPost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiDatacentersServersStartPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 +type ApiDatacentersServersRemoteConsoleGetRequest struct { + ctx _context.Context + ApiService *ServersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiDatacentersServersStartPostRequest) Pretty(pretty bool) ApiDatacentersServersStartPostRequest { +func (r ApiDatacentersServersRemoteConsoleGetRequest) Pretty(pretty bool) ApiDatacentersServersRemoteConsoleGetRequest { r.pretty = &pretty return r } -func (r ApiDatacentersServersStartPostRequest) Depth(depth int32) ApiDatacentersServersStartPostRequest { +func (r ApiDatacentersServersRemoteConsoleGetRequest) Depth(depth int32) ApiDatacentersServersRemoteConsoleGetRequest { r.depth = &depth return r } -func (r ApiDatacentersServersStartPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersStartPostRequest { +func (r ApiDatacentersServersRemoteConsoleGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersRemoteConsoleGetRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiDatacentersServersStartPostRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersStartPostExecute(r) +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersRemoteConsoleGetRequest) Filter(key string, value string) ApiDatacentersServersRemoteConsoleGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersRemoteConsoleGetRequest) OrderBy(orderBy string) ApiDatacentersServersRemoteConsoleGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersRemoteConsoleGetRequest) MaxResults(maxResults int32) ApiDatacentersServersRemoteConsoleGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersServersRemoteConsoleGetRequest) Execute() (RemoteConsoleUrl, *APIResponse, error) { + return r.ApiService.DatacentersServersRemoteConsoleGetExecute(r) } /* - * DatacentersServersStartPost Start a Server - * This will start a server. If the server's public IP was deallocated then a new IP will be assigned + * DatacentersServersRemoteConsoleGet Get Remote Console link + * Retrieve a link with a JSON Web Token for accessing the server's Remote Console. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @return ApiDatacentersServersStartPostRequest + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersRemoteConsoleGetRequest */ -func (a *ServerApiService) DatacentersServersStartPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersStartPostRequest { - return ApiDatacentersServersStartPostRequest{ - ApiService: a, - ctx: ctx, +func (a *ServersApiService) DatacentersServersRemoteConsoleGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersRemoteConsoleGetRequest { + return ApiDatacentersServersRemoteConsoleGetRequest{ + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, + filters: _neturl.Values{}, } } /* * Execute executes the request - * @return map[string]interface{} + * @return RemoteConsoleUrl */ -func (a *ServerApiService) DatacentersServersStartPostExecute(r ApiDatacentersServersStartPostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersRemoteConsoleGetExecute(r ApiDatacentersServersRemoteConsoleGetRequest) (RemoteConsoleUrl, *APIResponse, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} + localVarReturnValue RemoteConsoleUrl ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersStartPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersRemoteConsoleGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/start" + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/remoteconsole" localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) @@ -1940,10 +2208,34 @@ func (a *ServerApiService) DatacentersServersStartPostExecute(r ApiDatacentersSe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1983,13 +2275,14 @@ func (a *ServerApiService) DatacentersServersStartPostExecute(r ApiDatacentersSe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersStartPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersRemoteConsoleGet", } if err != nil || localVarHTTPResponse == nil { @@ -2005,24 +2298,26 @@ func (a *ServerApiService) DatacentersServersStartPostExecute(r ApiDatacentersSe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2030,70 +2325,70 @@ func (a *ServerApiService) DatacentersServersStartPostExecute(r ApiDatacentersSe return localVarReturnValue, localVarAPIResponse, nil } -type ApiDatacentersServersStopPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 +type ApiDatacentersServersResumePostRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiDatacentersServersStopPostRequest) Pretty(pretty bool) ApiDatacentersServersStopPostRequest { +func (r ApiDatacentersServersResumePostRequest) Pretty(pretty bool) ApiDatacentersServersResumePostRequest { r.pretty = &pretty return r } -func (r ApiDatacentersServersStopPostRequest) Depth(depth int32) ApiDatacentersServersStopPostRequest { +func (r ApiDatacentersServersResumePostRequest) Depth(depth int32) ApiDatacentersServersResumePostRequest { r.depth = &depth return r } -func (r ApiDatacentersServersStopPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersStopPostRequest { +func (r ApiDatacentersServersResumePostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersResumePostRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiDatacentersServersStopPostRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersStopPostExecute(r) +func (r ApiDatacentersServersResumePostRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersResumePostExecute(r) } /* - * DatacentersServersStopPost Stop a Server - * This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for CoreVPS servers. + * DatacentersServersResumePost Resume Cubes instances + * Resume a suspended Cube instance; no billing event will be generated. + +This operation is only supported for the Cubes. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @return ApiDatacentersServersStopPostRequest - */ -func (a *ServerApiService) DatacentersServersStopPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersStopPostRequest { - return ApiDatacentersServersStopPostRequest{ - ApiService: a, - ctx: ctx, + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersResumePostRequest +*/ +func (a *ServersApiService) DatacentersServersResumePost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersResumePostRequest { + return ApiDatacentersServersResumePostRequest{ + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersStopPostExecute(r ApiDatacentersServersStopPostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersResumePostExecute(r ApiDatacentersServersResumePostRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersStopPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersResumePost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/stop" + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/resume" localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) @@ -2103,10 +2398,21 @@ func (a *ServerApiService) DatacentersServersStopPostExecute(r ApiDatacentersSer if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2143,120 +2449,111 @@ func (a *ServerApiService) DatacentersServersStopPostExecute(r ApiDatacentersSer } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersStopPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersResumePost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiDatacentersServersUpgradePostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 +type ApiDatacentersServersStartPostRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiDatacentersServersUpgradePostRequest) Pretty(pretty bool) ApiDatacentersServersUpgradePostRequest { +func (r ApiDatacentersServersStartPostRequest) Pretty(pretty bool) ApiDatacentersServersStartPostRequest { r.pretty = &pretty return r } -func (r ApiDatacentersServersUpgradePostRequest) Depth(depth int32) ApiDatacentersServersUpgradePostRequest { +func (r ApiDatacentersServersStartPostRequest) Depth(depth int32) ApiDatacentersServersStartPostRequest { r.depth = &depth return r } -func (r ApiDatacentersServersUpgradePostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersUpgradePostRequest { +func (r ApiDatacentersServersStartPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersStartPostRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiDatacentersServersUpgradePostRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersUpgradePostExecute(r) +func (r ApiDatacentersServersStartPostRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersStartPostExecute(r) } /* - * DatacentersServersUpgradePost Upgrade a Server - * This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call '/datacenters/{datacenterId}/servers?upgradeNeeded=true' + * DatacentersServersStartPost Start servers + * Start the specified server within the data center; if the server's public IP address has been deallocated, a new IP address will be assigned. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param serverId The unique ID of the Server - * @return ApiDatacentersServersUpgradePostRequest + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersStartPostRequest */ -func (a *ServerApiService) DatacentersServersUpgradePost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersUpgradePostRequest { - return ApiDatacentersServersUpgradePostRequest{ - ApiService: a, - ctx: ctx, +func (a *ServersApiService) DatacentersServersStartPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersStartPostRequest { + return ApiDatacentersServersStartPostRequest{ + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersUpgradePostExecute(r ApiDatacentersServersUpgradePostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersStartPostExecute(r ApiDatacentersServersStartPostRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersUpgradePost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersStartPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/upgrade" + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/start" localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) @@ -2266,10 +2563,21 @@ func (a *ServerApiService) DatacentersServersUpgradePostExecute(r ApiDatacenters if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2306,126 +2614,115 @@ func (a *ServerApiService) DatacentersServersUpgradePostExecute(r ApiDatacenters } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersUpgradePost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersStartPost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiDatacentersServersVolumesDeleteRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - volumeId string - pretty *bool - depth *int32 +type ApiDatacentersServersStopPostRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiDatacentersServersVolumesDeleteRequest) Pretty(pretty bool) ApiDatacentersServersVolumesDeleteRequest { +func (r ApiDatacentersServersStopPostRequest) Pretty(pretty bool) ApiDatacentersServersStopPostRequest { r.pretty = &pretty return r } -func (r ApiDatacentersServersVolumesDeleteRequest) Depth(depth int32) ApiDatacentersServersVolumesDeleteRequest { +func (r ApiDatacentersServersStopPostRequest) Depth(depth int32) ApiDatacentersServersStopPostRequest { r.depth = &depth return r } -func (r ApiDatacentersServersVolumesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersVolumesDeleteRequest { +func (r ApiDatacentersServersStopPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersStopPostRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiDatacentersServersVolumesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.DatacentersServersVolumesDeleteExecute(r) +func (r ApiDatacentersServersStopPostRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersStopPostExecute(r) } /* - * DatacentersServersVolumesDelete Detach a volume - * This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion + * DatacentersServersStopPost Stop VMs + * Stop the specified server within the data center: the VM will be forcefully shut down, the billing will cease, and any allocated public IPs will be deallocated. + +This operation is not supported for the Cubes. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param volumeId The unique ID of the Volume - * @return ApiDatacentersServersVolumesDeleteRequest - */ -func (a *ServerApiService) DatacentersServersVolumesDelete(ctx _context.Context, datacenterId string, serverId string, volumeId string) ApiDatacentersServersVolumesDeleteRequest { - return ApiDatacentersServersVolumesDeleteRequest{ - ApiService: a, - ctx: ctx, + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersStopPostRequest +*/ +func (a *ServersApiService) DatacentersServersStopPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersStopPostRequest { + return ApiDatacentersServersStopPostRequest{ + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - volumeId: volumeId, + serverId: serverId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *ServerApiService) DatacentersServersVolumesDeleteExecute(r ApiDatacentersServersVolumesDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersStopPostExecute(r ApiDatacentersServersStopPostRequest) (*APIResponse, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersVolumesDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersStopPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}" + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/stop" localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2433,10 +2730,568 @@ func (a *ServerApiService) DatacentersServersVolumesDeleteExecute(r ApiDatacente if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersStopPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersSuspendPostRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersSuspendPostRequest) Pretty(pretty bool) ApiDatacentersServersSuspendPostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersSuspendPostRequest) Depth(depth int32) ApiDatacentersServersSuspendPostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersSuspendPostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersSuspendPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersSuspendPostRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersSuspendPostExecute(r) +} + +/* + * DatacentersServersSuspendPost Suspend Cubes instances + * Suspend the specified Cubes instance within the data center. The instance will not be deleted, and allocated resources will continue to be billed. + +This operation is only supported for the Cubes. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersSuspendPostRequest +*/ +func (a *ServersApiService) DatacentersServersSuspendPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersSuspendPostRequest { + return ApiDatacentersServersSuspendPostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + } +} + +/* + * Execute executes the request + */ +func (a *ServersApiService) DatacentersServersSuspendPostExecute(r ApiDatacentersServersSuspendPostRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersSuspendPost") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/suspend" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersSuspendPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersTokenGetRequest struct { + ctx _context.Context + ApiService *ServersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersTokenGetRequest) Pretty(pretty bool) ApiDatacentersServersTokenGetRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersTokenGetRequest) Depth(depth int32) ApiDatacentersServersTokenGetRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersTokenGetRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersTokenGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersTokenGetRequest) Filter(key string, value string) ApiDatacentersServersTokenGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersTokenGetRequest) OrderBy(orderBy string) ApiDatacentersServersTokenGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersTokenGetRequest) MaxResults(maxResults int32) ApiDatacentersServersTokenGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiDatacentersServersTokenGetRequest) Execute() (Token, *APIResponse, error) { + return r.ApiService.DatacentersServersTokenGetExecute(r) +} + +/* + * DatacentersServersTokenGet Get JASON Web Token + * Retrieve a JSON Web Token from the server for use in login operations (such as accessing the server's console). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersTokenGetRequest + */ +func (a *ServersApiService) DatacentersServersTokenGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersTokenGetRequest { + return ApiDatacentersServersTokenGetRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return Token + */ +func (a *ServersApiService) DatacentersServersTokenGetExecute(r ApiDatacentersServersTokenGetRequest) (Token, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersTokenGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/token" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersTokenGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiDatacentersServersUpgradePostRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersUpgradePostRequest) Pretty(pretty bool) ApiDatacentersServersUpgradePostRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersUpgradePostRequest) Depth(depth int32) ApiDatacentersServersUpgradePostRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersUpgradePostRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersUpgradePostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersUpgradePostRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersUpgradePostExecute(r) +} + +/* + * DatacentersServersUpgradePost Upgrade servers + * Upgrade the server version, if needed. To determine if an upgrade is available, execute the following call: + +'/datacenters/{datacenterId}/servers?upgradeNeeded=true' + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @return ApiDatacentersServersUpgradePostRequest +*/ +func (a *ServersApiService) DatacentersServersUpgradePost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersUpgradePostRequest { + return ApiDatacentersServersUpgradePostRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + } +} + +/* + * Execute executes the request + */ +func (a *ServersApiService) DatacentersServersUpgradePostExecute(r ApiDatacentersServersUpgradePostRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersUpgradePost") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/upgrade" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2473,64 +3328,226 @@ func (a *ServerApiService) DatacentersServersVolumesDeleteExecute(r ApiDatacente } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersVolumesDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersUpgradePost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiDatacentersServersVolumesDeleteRequest struct { + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + volumeId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiDatacentersServersVolumesDeleteRequest) Pretty(pretty bool) ApiDatacentersServersVolumesDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiDatacentersServersVolumesDeleteRequest) Depth(depth int32) ApiDatacentersServersVolumesDeleteRequest { + r.depth = &depth + return r +} +func (r ApiDatacentersServersVolumesDeleteRequest) XContractNumber(xContractNumber int32) ApiDatacentersServersVolumesDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiDatacentersServersVolumesDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.DatacentersServersVolumesDeleteExecute(r) +} + +/* + * DatacentersServersVolumesDelete Detach volumes + * Detach the specified volume from the server without deleting it from the data center. A separate request must be made to perform the deletion. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param volumeId The unique ID of the volume. + * @return ApiDatacentersServersVolumesDeleteRequest + */ +func (a *ServersApiService) DatacentersServersVolumesDelete(ctx _context.Context, datacenterId string, serverId string, volumeId string) ApiDatacentersServersVolumesDeleteRequest { + return ApiDatacentersServersVolumesDeleteRequest{ + ApiService: a, + ctx: ctx, + datacenterId: datacenterId, + serverId: serverId, + volumeId: volumeId, + } +} + +/* + * Execute executes the request + */ +func (a *ServersApiService) DatacentersServersVolumesDeleteExecute(r ApiDatacentersServersVolumesDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersVolumesDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"datacenterId"+"}", _neturl.PathEscape(parameterToString(r.datacenterId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", _neturl.PathEscape(parameterToString(r.serverId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", _neturl.PathEscape(parameterToString(r.volumeId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersVolumesDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersServersVolumesFindByIdRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - volumeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + volumeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2552,21 +3569,21 @@ func (r ApiDatacentersServersVolumesFindByIdRequest) Execute() (Volume, *APIResp } /* - * DatacentersServersVolumesFindById Retrieve an attached volume - * This will retrieve the properties of an attached volume. + * DatacentersServersVolumesFindById Retrieve attached volumes + * Retrieve the properties of the volume, attached to the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersServersVolumesFindByIdRequest */ -func (a *ServerApiService) DatacentersServersVolumesFindById(ctx _context.Context, datacenterId string, serverId string, volumeId string) ApiDatacentersServersVolumesFindByIdRequest { +func (a *ServersApiService) DatacentersServersVolumesFindById(ctx _context.Context, datacenterId string, serverId string, volumeId string) ApiDatacentersServersVolumesFindByIdRequest { return ApiDatacentersServersVolumesFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, - volumeId: volumeId, + serverId: serverId, + volumeId: volumeId, } } @@ -2574,7 +3591,7 @@ func (a *ServerApiService) DatacentersServersVolumesFindById(ctx _context.Contex * Execute executes the request * @return Volume */ -func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacentersServersVolumesFindByIdRequest) (Volume, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacentersServersVolumesFindByIdRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -2584,7 +3601,7 @@ func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacen localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersVolumesFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersVolumesFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2600,10 +3617,21 @@ func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacen if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2643,13 +3671,14 @@ func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacen return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersVolumesFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersVolumesFindById", } if err != nil || localVarHTTPResponse == nil { @@ -2665,24 +3694,26 @@ func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacen if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2691,13 +3722,18 @@ func (a *ServerApiService) DatacentersServersVolumesFindByIdExecute(r ApiDatacen } type ApiDatacentersServersVolumesGetRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + serverId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersServersVolumesGetRequest) Pretty(pretty bool) ApiDatacentersServersVolumesGetRequest { @@ -2712,25 +3748,53 @@ func (r ApiDatacentersServersVolumesGetRequest) XContractNumber(xContractNumber r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersServersVolumesGetRequest) Offset(offset int32) ApiDatacentersServersVolumesGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersServersVolumesGetRequest) Limit(limit int32) ApiDatacentersServersVolumesGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersServersVolumesGetRequest) Filter(key string, value string) ApiDatacentersServersVolumesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersServersVolumesGetRequest) OrderBy(orderBy string) ApiDatacentersServersVolumesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersServersVolumesGetRequest) MaxResults(maxResults int32) ApiDatacentersServersVolumesGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersServersVolumesGetRequest) Execute() (AttachedVolumes, *APIResponse, error) { return r.ApiService.DatacentersServersVolumesGetExecute(r) } /* - * DatacentersServersVolumesGet List Attached Volumes - * You can retrieve a list of volumes attached to the server + * DatacentersServersVolumesGet List attached volumes + * List all volumes, attached to the specified server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersVolumesGetRequest */ -func (a *ServerApiService) DatacentersServersVolumesGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersVolumesGetRequest { +func (a *ServersApiService) DatacentersServersVolumesGet(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersVolumesGetRequest { return ApiDatacentersServersVolumesGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, + filters: _neturl.Values{}, } } @@ -2738,7 +3802,7 @@ func (a *ServerApiService) DatacentersServersVolumesGet(ctx _context.Context, da * Execute executes the request * @return AttachedVolumes */ -func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersServersVolumesGetRequest) (AttachedVolumes, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersServersVolumesGetRequest) (AttachedVolumes, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -2748,7 +3812,7 @@ func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersS localVarReturnValue AttachedVolumes ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersVolumesGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersVolumesGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2763,10 +3827,50 @@ func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersS if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2787,18 +3891,33 @@ func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersS if r.xContractNumber != nil { localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersVolumesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersVolumesGet", } if err != nil || localVarHTTPResponse == nil { @@ -2814,24 +3933,26 @@ func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersS if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2840,13 +3961,13 @@ func (a *ServerApiService) DatacentersServersVolumesGetExecute(r ApiDatacentersS } type ApiDatacentersServersVolumesPostRequest struct { - ctx _context.Context - ApiService *ServerApiService - datacenterId string - serverId string - volume *Volume - pretty *bool - depth *int32 + ctx _context.Context + ApiService *ServersApiService + datacenterId string + serverId string + volume *Volume + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2872,19 +3993,23 @@ func (r ApiDatacentersServersVolumesPostRequest) Execute() (Volume, *APIResponse } /* - * DatacentersServersVolumesPost Attach a volume - * This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics and volumes attached to the server should not exceed size 24. + * DatacentersServersVolumesPost Attach volumes + * Attach an existing storage volume to the specified server. + +A volume scan also be created and attached in one step by providing the new volume description as payload. + +The combined total of attached volumes and NICs cannot exceed 24 per server. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the Datacenter - * @param serverId The unique ID of the Server + * @param datacenterId The unique ID of the data center. + * @param serverId The unique ID of the server. * @return ApiDatacentersServersVolumesPostRequest - */ -func (a *ServerApiService) DatacentersServersVolumesPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersVolumesPostRequest { +*/ +func (a *ServersApiService) DatacentersServersVolumesPost(ctx _context.Context, datacenterId string, serverId string) ApiDatacentersServersVolumesPostRequest { return ApiDatacentersServersVolumesPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - serverId: serverId, + serverId: serverId, } } @@ -2892,7 +4017,7 @@ func (a *ServerApiService) DatacentersServersVolumesPost(ctx _context.Context, d * Execute executes the request * @return Volume */ -func (a *ServerApiService) DatacentersServersVolumesPostExecute(r ApiDatacentersServersVolumesPostRequest) (Volume, *APIResponse, error) { +func (a *ServersApiService) DatacentersServersVolumesPostExecute(r ApiDatacentersServersVolumesPostRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -2902,7 +4027,7 @@ func (a *ServerApiService) DatacentersServersVolumesPostExecute(r ApiDatacenters localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServerApiService.DatacentersServersVolumesPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServersApiService.DatacentersServersVolumesPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -2920,10 +4045,21 @@ func (a *ServerApiService) DatacentersServersVolumesPostExecute(r ApiDatacenters if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2946,18 +4082,33 @@ func (a *ServerApiService) DatacentersServersVolumesPostExecute(r ApiDatacenters } // body params localVarPostBody = r.volume + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersServersVolumesPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersServersVolumesPost", } if err != nil || localVarHTTPResponse == nil { @@ -2973,24 +4124,26 @@ func (a *ServerApiService) DatacentersServersVolumesPostExecute(r ApiDatacenters if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshot.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshots.go similarity index 64% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshot.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshots.go index de54e17f14eb..57bf0744ecee 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshot.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_snapshots.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,15 +24,15 @@ var ( _ _context.Context ) -// SnapshotApiService SnapshotApi service -type SnapshotApiService service +// SnapshotsApiService SnapshotsApi service +type SnapshotsApiService service type ApiSnapshotsDeleteRequest struct { - ctx _context.Context - ApiService *SnapshotApiService - snapshotId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *SnapshotsApiService + snapshotId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiSnapshotsDeleteRequest) XContractNumber(xContractNumber int32) ApiSna return r } -func (r ApiSnapshotsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiSnapshotsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.SnapshotsDeleteExecute(r) } /* - * SnapshotsDelete Delete a Snapshot - * Deletes the specified Snapshot. + * SnapshotsDelete Delete snapshots + * Deletes the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsDeleteRequest */ -func (a *SnapshotApiService) SnapshotsDelete(ctx _context.Context, snapshotId string) ApiSnapshotsDeleteRequest { +func (a *SnapshotsApiService) SnapshotsDelete(ctx _context.Context, snapshotId string) ApiSnapshotsDeleteRequest { return ApiSnapshotsDeleteRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *SnapshotApiService) SnapshotsDeleteExecute(r ApiSnapshotsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *SnapshotsApiService) SnapshotsDeleteExecute(r ApiSnapshotsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotApiService.SnapshotsDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.SnapshotsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/snapshots/{snapshotId}" @@ -95,10 +94,21 @@ func (a *SnapshotApiService) SnapshotsDeleteExecute(r ApiSnapshotsDeleteRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *SnapshotApiService) SnapshotsDeleteExecute(r ApiSnapshotsDeleteRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiSnapshotsFindByIdRequest struct { - ctx _context.Context - ApiService *SnapshotApiService - snapshotId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *SnapshotsApiService + snapshotId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,16 +215,16 @@ func (r ApiSnapshotsFindByIdRequest) Execute() (Snapshot, *APIResponse, error) { } /* - * SnapshotsFindById Retrieve a Snapshot by its uuid. - * Retrieves the attributes of a given Snapshot. + * SnapshotsFindById Retrieve snapshots by ID + * Retrieve the properties of the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsFindByIdRequest */ -func (a *SnapshotApiService) SnapshotsFindById(ctx _context.Context, snapshotId string) ApiSnapshotsFindByIdRequest { +func (a *SnapshotsApiService) SnapshotsFindById(ctx _context.Context, snapshotId string) ApiSnapshotsFindByIdRequest { return ApiSnapshotsFindByIdRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, } } @@ -230,7 +233,7 @@ func (a *SnapshotApiService) SnapshotsFindById(ctx _context.Context, snapshotId * Execute executes the request * @return Snapshot */ -func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequest) (Snapshot, *APIResponse, error) { +func (a *SnapshotsApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequest) (Snapshot, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -240,7 +243,7 @@ func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequ localVarReturnValue Snapshot ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotApiService.SnapshotsFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.SnapshotsFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -254,10 +257,21 @@ func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +362,13 @@ func (a *SnapshotApiService) SnapshotsFindByIdExecute(r ApiSnapshotsFindByIdRequ } type ApiSnapshotsGetRequest struct { - ctx _context.Context - ApiService *SnapshotApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *SnapshotsApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +385,40 @@ func (r ApiSnapshotsGetRequest) XContractNumber(xContractNumber int32) ApiSnapsh return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiSnapshotsGetRequest) Filter(key string, value string) ApiSnapshotsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiSnapshotsGetRequest) OrderBy(orderBy string) ApiSnapshotsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiSnapshotsGetRequest) MaxResults(maxResults int32) ApiSnapshotsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiSnapshotsGetRequest) Execute() (Snapshots, *APIResponse, error) { return r.ApiService.SnapshotsGetExecute(r) } /* - * SnapshotsGet List Snapshots - * Retrieve a list of available snapshots. + * SnapshotsGet List snapshots + * List all available snapshots. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiSnapshotsGetRequest */ -func (a *SnapshotApiService) SnapshotsGet(ctx _context.Context) ApiSnapshotsGetRequest { +func (a *SnapshotsApiService) SnapshotsGet(ctx _context.Context) ApiSnapshotsGetRequest { return ApiSnapshotsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -386,7 +426,7 @@ func (a *SnapshotApiService) SnapshotsGet(ctx _context.Context) ApiSnapshotsGetR * Execute executes the request * @return Snapshots */ -func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snapshots, *APIResponse, error) { +func (a *SnapshotsApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snapshots, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -396,7 +436,7 @@ func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snap localVarReturnValue Snapshots ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotApiService.SnapshotsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.SnapshotsGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -409,10 +449,34 @@ func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snap if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +516,14 @@ func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snap return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +539,26 @@ func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snap if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,12 +567,12 @@ func (a *SnapshotApiService) SnapshotsGetExecute(r ApiSnapshotsGetRequest) (Snap } type ApiSnapshotsPatchRequest struct { - ctx _context.Context - ApiService *SnapshotApiService - snapshotId string - snapshot *SnapshotProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *SnapshotsApiService + snapshotId string + snapshot *SnapshotProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -531,16 +598,16 @@ func (r ApiSnapshotsPatchRequest) Execute() (Snapshot, *APIResponse, error) { } /* - * SnapshotsPatch Partially modify a Snapshot - * You can use this method to update attributes of a Snapshot. + * SnapshotsPatch Partially modify snapshots + * Update the properties of the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsPatchRequest */ -func (a *SnapshotApiService) SnapshotsPatch(ctx _context.Context, snapshotId string) ApiSnapshotsPatchRequest { +func (a *SnapshotsApiService) SnapshotsPatch(ctx _context.Context, snapshotId string) ApiSnapshotsPatchRequest { return ApiSnapshotsPatchRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, } } @@ -549,7 +616,7 @@ func (a *SnapshotApiService) SnapshotsPatch(ctx _context.Context, snapshotId str * Execute executes the request * @return Snapshot */ -func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) (Snapshot, *APIResponse, error) { +func (a *SnapshotsApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) (Snapshot, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -559,7 +626,7 @@ func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) ( localVarReturnValue Snapshot ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotApiService.SnapshotsPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.SnapshotsPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -576,10 +643,21 @@ func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) ( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -621,13 +699,14 @@ func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) ( return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsPatch", } if err != nil || localVarHTTPResponse == nil { @@ -643,24 +722,26 @@ func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) ( if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -669,12 +750,12 @@ func (a *SnapshotApiService) SnapshotsPatchExecute(r ApiSnapshotsPatchRequest) ( } type ApiSnapshotsPutRequest struct { - ctx _context.Context - ApiService *SnapshotApiService - snapshotId string - snapshot *Snapshot - pretty *bool - depth *int32 + ctx _context.Context + ApiService *SnapshotsApiService + snapshotId string + snapshot *Snapshot + pretty *bool + depth *int32 xContractNumber *int32 } @@ -700,16 +781,16 @@ func (r ApiSnapshotsPutRequest) Execute() (Snapshot, *APIResponse, error) { } /* - * SnapshotsPut Modify a Snapshot - * You can use update attributes of a resource + * SnapshotsPut Modify snapshots + * Modify the properties of the specified snapshot. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param snapshotId The unique ID of the Snapshot + * @param snapshotId The unique ID of the snapshot. * @return ApiSnapshotsPutRequest */ -func (a *SnapshotApiService) SnapshotsPut(ctx _context.Context, snapshotId string) ApiSnapshotsPutRequest { +func (a *SnapshotsApiService) SnapshotsPut(ctx _context.Context, snapshotId string) ApiSnapshotsPutRequest { return ApiSnapshotsPutRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, snapshotId: snapshotId, } } @@ -718,7 +799,7 @@ func (a *SnapshotApiService) SnapshotsPut(ctx _context.Context, snapshotId strin * Execute executes the request * @return Snapshot */ -func (a *SnapshotApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snapshot, *APIResponse, error) { +func (a *SnapshotsApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snapshot, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -728,7 +809,7 @@ func (a *SnapshotApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snap localVarReturnValue Snapshot ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotApiService.SnapshotsPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SnapshotsApiService.SnapshotsPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -745,10 +826,21 @@ func (a *SnapshotApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snap if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -790,13 +882,14 @@ func (a *SnapshotApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snap return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "SnapshotsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "SnapshotsPut", } if err != nil || localVarHTTPResponse == nil { @@ -812,24 +905,26 @@ func (a *SnapshotApiService) SnapshotsPutExecute(r ApiSnapshotsPutRequest) (Snap if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_templates.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_templates.go new file mode 100644 index 000000000000..eb3b3c15926a --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_templates.go @@ -0,0 +1,368 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// TemplatesApiService TemplatesApi service +type TemplatesApiService service + +type ApiTemplatesFindByIdRequest struct { + ctx _context.Context + ApiService *TemplatesApiService + templateId string + depth *int32 +} + +func (r ApiTemplatesFindByIdRequest) Depth(depth int32) ApiTemplatesFindByIdRequest { + r.depth = &depth + return r +} + +func (r ApiTemplatesFindByIdRequest) Execute() (Template, *APIResponse, error) { + return r.ApiService.TemplatesFindByIdExecute(r) +} + +/* + * TemplatesFindById Retrieve Cubes Templates + * Retrieve the properties of the specified Cubes Template. + +This operation is only supported for the Cubes. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param templateId The unique Template ID. + * @return ApiTemplatesFindByIdRequest +*/ +func (a *TemplatesApiService) TemplatesFindById(ctx _context.Context, templateId string) ApiTemplatesFindByIdRequest { + return ApiTemplatesFindByIdRequest{ + ApiService: a, + ctx: ctx, + templateId: templateId, + } +} + +/* + * Execute executes the request + * @return Template + */ +func (a *TemplatesApiService) TemplatesFindByIdExecute(r ApiTemplatesFindByIdRequest) (Template, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Template + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TemplatesApiService.TemplatesFindById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/templates/{templateId}" + localVarPath = strings.Replace(localVarPath, "{"+"templateId"+"}", _neturl.PathEscape(parameterToString(r.templateId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "TemplatesFindById", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiTemplatesGetRequest struct { + ctx _context.Context + ApiService *TemplatesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + depth *int32 +} + +func (r ApiTemplatesGetRequest) Depth(depth int32) ApiTemplatesGetRequest { + r.depth = &depth + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiTemplatesGetRequest) Filter(key string, value string) ApiTemplatesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiTemplatesGetRequest) OrderBy(orderBy string) ApiTemplatesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiTemplatesGetRequest) MaxResults(maxResults int32) ApiTemplatesGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiTemplatesGetRequest) Execute() (Templates, *APIResponse, error) { + return r.ApiService.TemplatesGetExecute(r) +} + +/* + * TemplatesGet List Cubes Templates + * List all of the available Cubes Templates. + +This operation is only supported for the Cubes. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTemplatesGetRequest +*/ +func (a *TemplatesApiService) TemplatesGet(ctx _context.Context) ApiTemplatesGetRequest { + return ApiTemplatesGetRequest{ + ApiService: a, + ctx: ctx, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return Templates + */ +func (a *TemplatesApiService) TemplatesGetExecute(r ApiTemplatesGetRequest) (Templates, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Templates + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TemplatesApiService.TemplatesGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "TemplatesGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_management.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_management.go index 0d8fd27bfbdf..fcf1f28ff60c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_management.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_management.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -27,11 +28,11 @@ var ( type UserManagementApiService service type ApiUmGroupsDeleteRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -48,42 +49,40 @@ func (r ApiUmGroupsDeleteRequest) XContractNumber(xContractNumber int32) ApiUmGr return r } -func (r ApiUmGroupsDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiUmGroupsDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.UmGroupsDeleteExecute(r) } /* - * UmGroupsDelete Delete a Group - * Delete a group + * UmGroupsDelete Delete groups + * Remove the specified group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId The unique ID of the group + * @param groupId The unique ID of the group. * @return ApiUmGroupsDeleteRequest */ func (a *UserManagementApiService) UmGroupsDelete(ctx _context.Context, groupId string) ApiUmGroupsDeleteRequest { return ApiUmGroupsDeleteRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *UserManagementApiService) UmGroupsDeleteExecute(r ApiUmGroupsDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *UserManagementApiService) UmGroupsDeleteExecute(r ApiUmGroupsDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmGroupsDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/um/groups/{groupId}" @@ -95,10 +94,21 @@ func (a *UserManagementApiService) UmGroupsDeleteExecute(r ApiUmGroupsDeleteRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,62 +145,55 @@ func (a *UserManagementApiService) UmGroupsDeleteExecute(r ApiUmGroupsDeleteRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiUmGroupsFindByIdRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -212,17 +215,17 @@ func (r ApiUmGroupsFindByIdRequest) Execute() (Group, *APIResponse, error) { } /* - * UmGroupsFindById Retrieve a Group - * You can retrieve a group by using the group ID. This value can be found in the response body when a group is created or when you GET a list of groups. + * UmGroupsFindById Retrieve groups + * Retrieve a group by the group ID. This value is in the response body when the group is created, and in the list of the groups, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId The unique ID of the group + * @param groupId The unique ID of the group. * @return ApiUmGroupsFindByIdRequest */ func (a *UserManagementApiService) UmGroupsFindById(ctx _context.Context, groupId string) ApiUmGroupsFindByIdRequest { return ApiUmGroupsFindByIdRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, } } @@ -254,10 +257,21 @@ func (a *UserManagementApiService) UmGroupsFindByIdExecute(r ApiUmGroupsFindById if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,13 +311,14 @@ func (a *UserManagementApiService) UmGroupsFindByIdExecute(r ApiUmGroupsFindById return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsFindById", } if err != nil || localVarHTTPResponse == nil { @@ -319,24 +334,26 @@ func (a *UserManagementApiService) UmGroupsFindByIdExecute(r ApiUmGroupsFindById if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -345,10 +362,13 @@ func (a *UserManagementApiService) UmGroupsFindByIdExecute(r ApiUmGroupsFindById } type ApiUmGroupsGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -365,20 +385,40 @@ func (r ApiUmGroupsGetRequest) XContractNumber(xContractNumber int32) ApiUmGroup return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmGroupsGetRequest) Filter(key string, value string) ApiUmGroupsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmGroupsGetRequest) OrderBy(orderBy string) ApiUmGroupsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmGroupsGetRequest) MaxResults(maxResults int32) ApiUmGroupsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmGroupsGetRequest) Execute() (Groups, *APIResponse, error) { return r.ApiService.UmGroupsGetExecute(r) } /* - * UmGroupsGet List All Groups. - * You can retrieve a complete list of all groups that you have access to + * UmGroupsGet List all groups + * List all the available user groups. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUmGroupsGetRequest */ func (a *UserManagementApiService) UmGroupsGet(ctx _context.Context) ApiUmGroupsGetRequest { return ApiUmGroupsGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -409,10 +449,34 @@ func (a *UserManagementApiService) UmGroupsGetExecute(r ApiUmGroupsGetRequest) ( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -452,13 +516,14 @@ func (a *UserManagementApiService) UmGroupsGetExecute(r ApiUmGroupsGetRequest) ( return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsGet", } if err != nil || localVarHTTPResponse == nil { @@ -474,24 +539,26 @@ func (a *UserManagementApiService) UmGroupsGetExecute(r ApiUmGroupsGetRequest) ( if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -500,11 +567,11 @@ func (a *UserManagementApiService) UmGroupsGetExecute(r ApiUmGroupsGetRequest) ( } type ApiUmGroupsPostRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - group *Group - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + group *Group + pretty *bool + depth *int32 xContractNumber *int32 } @@ -530,15 +597,15 @@ func (r ApiUmGroupsPostRequest) Execute() (Group, *APIResponse, error) { } /* - * UmGroupsPost Create a Group - * You can use this POST method to create a group + * UmGroupsPost Create groups + * Create a group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUmGroupsPostRequest */ func (a *UserManagementApiService) UmGroupsPost(ctx _context.Context) ApiUmGroupsPostRequest { return ApiUmGroupsPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -572,10 +639,21 @@ func (a *UserManagementApiService) UmGroupsPostExecute(r ApiUmGroupsPostRequest) if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -617,13 +695,14 @@ func (a *UserManagementApiService) UmGroupsPostExecute(r ApiUmGroupsPostRequest) return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsPost", } if err != nil || localVarHTTPResponse == nil { @@ -639,24 +718,26 @@ func (a *UserManagementApiService) UmGroupsPostExecute(r ApiUmGroupsPostRequest) if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -665,12 +746,12 @@ func (a *UserManagementApiService) UmGroupsPostExecute(r ApiUmGroupsPostRequest) } type ApiUmGroupsPutRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - group *Group - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + group *Group + pretty *bool + depth *int32 xContractNumber *int32 } @@ -696,17 +777,17 @@ func (r ApiUmGroupsPutRequest) Execute() (Group, *APIResponse, error) { } /* - * UmGroupsPut Modify a group - * You can use this method to update properties of the group. + * UmGroupsPut Modify groups + * Modify the properties of the specified group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId The unique ID of the group + * @param groupId The unique ID of the group. * @return ApiUmGroupsPutRequest */ func (a *UserManagementApiService) UmGroupsPut(ctx _context.Context, groupId string) ApiUmGroupsPutRequest { return ApiUmGroupsPutRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, } } @@ -741,10 +822,21 @@ func (a *UserManagementApiService) UmGroupsPutExecute(r ApiUmGroupsPutRequest) ( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -786,13 +878,14 @@ func (a *UserManagementApiService) UmGroupsPutExecute(r ApiUmGroupsPutRequest) ( return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsPut", } if err != nil || localVarHTTPResponse == nil { @@ -808,24 +901,26 @@ func (a *UserManagementApiService) UmGroupsPutExecute(r ApiUmGroupsPutRequest) ( if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -834,11 +929,14 @@ func (a *UserManagementApiService) UmGroupsPutExecute(r ApiUmGroupsPutRequest) ( } type ApiUmGroupsResourcesGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + groupId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -855,21 +953,42 @@ func (r ApiUmGroupsResourcesGetRequest) XContractNumber(xContractNumber int32) A return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmGroupsResourcesGetRequest) Filter(key string, value string) ApiUmGroupsResourcesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmGroupsResourcesGetRequest) OrderBy(orderBy string) ApiUmGroupsResourcesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmGroupsResourcesGetRequest) MaxResults(maxResults int32) ApiUmGroupsResourcesGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmGroupsResourcesGetRequest) Execute() (ResourceGroups, *APIResponse, error) { return r.ApiService.UmGroupsResourcesGetExecute(r) } /* - * UmGroupsResourcesGet Retrieve resources assigned to a group + * UmGroupsResourcesGet Retrieve group resources + * List the resources assigned to the group, by group ID. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId The unique ID of the group + * @param groupId The unique ID of the group. * @return ApiUmGroupsResourcesGetRequest */ func (a *UserManagementApiService) UmGroupsResourcesGet(ctx _context.Context, groupId string) ApiUmGroupsResourcesGetRequest { return ApiUmGroupsResourcesGetRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, + filters: _neturl.Values{}, } } @@ -901,10 +1020,34 @@ func (a *UserManagementApiService) UmGroupsResourcesGetExecute(r ApiUmGroupsReso if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -944,13 +1087,14 @@ func (a *UserManagementApiService) UmGroupsResourcesGetExecute(r ApiUmGroupsReso return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsResourcesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsResourcesGet", } if err != nil || localVarHTTPResponse == nil { @@ -966,24 +1110,26 @@ func (a *UserManagementApiService) UmGroupsResourcesGetExecute(r ApiUmGroupsReso if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -992,12 +1138,12 @@ func (a *UserManagementApiService) UmGroupsResourcesGetExecute(r ApiUmGroupsReso } type ApiUmGroupsSharesDeleteRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - resourceId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + resourceId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1014,44 +1160,42 @@ func (r ApiUmGroupsSharesDeleteRequest) XContractNumber(xContractNumber int32) A return r } -func (r ApiUmGroupsSharesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiUmGroupsSharesDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.UmGroupsSharesDeleteExecute(r) } /* - * UmGroupsSharesDelete Remove a resource from a group - * This will remove a resource from a group + * UmGroupsSharesDelete Remove group shares + * Remove the specified share from the group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId - * @param resourceId + * @param groupId The unique ID of the group. + * @param resourceId The unique ID of the resource. * @return ApiUmGroupsSharesDeleteRequest */ func (a *UserManagementApiService) UmGroupsSharesDelete(ctx _context.Context, groupId string, resourceId string) ApiUmGroupsSharesDeleteRequest { return ApiUmGroupsSharesDeleteRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, resourceId: resourceId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *UserManagementApiService) UmGroupsSharesDeleteExecute(r ApiUmGroupsSharesDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *UserManagementApiService) UmGroupsSharesDeleteExecute(r ApiUmGroupsSharesDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmGroupsSharesDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/um/groups/{groupId}/shares/{resourceId}" @@ -1064,10 +1208,21 @@ func (a *UserManagementApiService) UmGroupsSharesDeleteExecute(r ApiUmGroupsShar if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1104,96 +1259,89 @@ func (a *UserManagementApiService) UmGroupsSharesDeleteExecute(r ApiUmGroupsShar } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsSharesDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsSharesDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } -type ApiUmGroupsSharesFindByResourceRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - resourceId string - pretty *bool - depth *int32 +type ApiUmGroupsSharesFindByResourceIdRequest struct { + ctx _context.Context + ApiService *UserManagementApiService + groupId string + resourceId string + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiUmGroupsSharesFindByResourceRequest) Pretty(pretty bool) ApiUmGroupsSharesFindByResourceRequest { +func (r ApiUmGroupsSharesFindByResourceIdRequest) Pretty(pretty bool) ApiUmGroupsSharesFindByResourceIdRequest { r.pretty = &pretty return r } -func (r ApiUmGroupsSharesFindByResourceRequest) Depth(depth int32) ApiUmGroupsSharesFindByResourceRequest { +func (r ApiUmGroupsSharesFindByResourceIdRequest) Depth(depth int32) ApiUmGroupsSharesFindByResourceIdRequest { r.depth = &depth return r } -func (r ApiUmGroupsSharesFindByResourceRequest) XContractNumber(xContractNumber int32) ApiUmGroupsSharesFindByResourceRequest { +func (r ApiUmGroupsSharesFindByResourceIdRequest) XContractNumber(xContractNumber int32) ApiUmGroupsSharesFindByResourceIdRequest { r.xContractNumber = &xContractNumber return r } -func (r ApiUmGroupsSharesFindByResourceRequest) Execute() (GroupShare, *APIResponse, error) { - return r.ApiService.UmGroupsSharesFindByResourceExecute(r) +func (r ApiUmGroupsSharesFindByResourceIdRequest) Execute() (GroupShare, *APIResponse, error) { + return r.ApiService.UmGroupsSharesFindByResourceIdExecute(r) } /* - * UmGroupsSharesFindByResource Retrieve a group share - * This will retrieve the properties of a group share. + * UmGroupsSharesFindByResourceId Retrieve group shares + * Retrieve the properties of the specified group share. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId - * @param resourceId - * @return ApiUmGroupsSharesFindByResourceRequest + * @param groupId The unique ID of the group. + * @param resourceId The unique ID of the resource. + * @return ApiUmGroupsSharesFindByResourceIdRequest */ -func (a *UserManagementApiService) UmGroupsSharesFindByResource(ctx _context.Context, groupId string, resourceId string) ApiUmGroupsSharesFindByResourceRequest { - return ApiUmGroupsSharesFindByResourceRequest{ +func (a *UserManagementApiService) UmGroupsSharesFindByResourceId(ctx _context.Context, groupId string, resourceId string) ApiUmGroupsSharesFindByResourceIdRequest { + return ApiUmGroupsSharesFindByResourceIdRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, resourceId: resourceId, } } @@ -1202,7 +1350,7 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResource(ctx _context.Con * Execute executes the request * @return GroupShare */ -func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGroupsSharesFindByResourceRequest) (GroupShare, *APIResponse, error) { +func (a *UserManagementApiService) UmGroupsSharesFindByResourceIdExecute(r ApiUmGroupsSharesFindByResourceIdRequest) (GroupShare, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1212,7 +1360,7 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGr localVarReturnValue GroupShare ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmGroupsSharesFindByResource") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmGroupsSharesFindByResourceId") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1227,10 +1375,21 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGr if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1270,13 +1429,14 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGr return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsSharesFindByResource", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsSharesFindByResourceId", } if err != nil || localVarHTTPResponse == nil { @@ -1292,24 +1452,26 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGr if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1318,11 +1480,14 @@ func (a *UserManagementApiService) UmGroupsSharesFindByResourceExecute(r ApiUmGr } type ApiUmGroupsSharesGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + groupId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1339,22 +1504,42 @@ func (r ApiUmGroupsSharesGetRequest) XContractNumber(xContractNumber int32) ApiU return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmGroupsSharesGetRequest) Filter(key string, value string) ApiUmGroupsSharesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmGroupsSharesGetRequest) OrderBy(orderBy string) ApiUmGroupsSharesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmGroupsSharesGetRequest) MaxResults(maxResults int32) ApiUmGroupsSharesGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmGroupsSharesGetRequest) Execute() (GroupShares, *APIResponse, error) { return r.ApiService.UmGroupsSharesGetExecute(r) } /* - * UmGroupsSharesGet List Group Shares - * You can retrieve a list of all resources along with their permissions of the group + * UmGroupsSharesGet List group shares + * List all shares and share privileges for the specified group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId + * @param groupId The unique ID of the group. * @return ApiUmGroupsSharesGetRequest */ func (a *UserManagementApiService) UmGroupsSharesGet(ctx _context.Context, groupId string) ApiUmGroupsSharesGetRequest { return ApiUmGroupsSharesGetRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, + filters: _neturl.Values{}, } } @@ -1386,10 +1571,34 @@ func (a *UserManagementApiService) UmGroupsSharesGetExecute(r ApiUmGroupsSharesG if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1429,13 +1638,14 @@ func (a *UserManagementApiService) UmGroupsSharesGetExecute(r ApiUmGroupsSharesG return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsSharesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsSharesGet", } if err != nil || localVarHTTPResponse == nil { @@ -1451,24 +1661,26 @@ func (a *UserManagementApiService) UmGroupsSharesGetExecute(r ApiUmGroupsSharesG if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1477,13 +1689,13 @@ func (a *UserManagementApiService) UmGroupsSharesGetExecute(r ApiUmGroupsSharesG } type ApiUmGroupsSharesPostRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - resourceId string - resource *GroupShare - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + resourceId string + resource *GroupShare + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1509,18 +1721,18 @@ func (r ApiUmGroupsSharesPostRequest) Execute() (GroupShare, *APIResponse, error } /* - * UmGroupsSharesPost Add a resource to a group - * This will add a resource to the group. + * UmGroupsSharesPost Add group shares + * Add the specified share to the group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId - * @param resourceId + * @param groupId The unique ID of the group. + * @param resourceId The unique ID of the resource. * @return ApiUmGroupsSharesPostRequest */ func (a *UserManagementApiService) UmGroupsSharesPost(ctx _context.Context, groupId string, resourceId string) ApiUmGroupsSharesPostRequest { return ApiUmGroupsSharesPostRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, resourceId: resourceId, } } @@ -1557,10 +1769,21 @@ func (a *UserManagementApiService) UmGroupsSharesPostExecute(r ApiUmGroupsShares if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1602,13 +1825,14 @@ func (a *UserManagementApiService) UmGroupsSharesPostExecute(r ApiUmGroupsShares return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsSharesPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsSharesPost", } if err != nil || localVarHTTPResponse == nil { @@ -1624,24 +1848,26 @@ func (a *UserManagementApiService) UmGroupsSharesPostExecute(r ApiUmGroupsShares if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1650,13 +1876,13 @@ func (a *UserManagementApiService) UmGroupsSharesPostExecute(r ApiUmGroupsShares } type ApiUmGroupsSharesPutRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - resourceId string - resource *GroupShare - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + resourceId string + resource *GroupShare + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1682,18 +1908,18 @@ func (r ApiUmGroupsSharesPutRequest) Execute() (GroupShare, *APIResponse, error) } /* - * UmGroupsSharesPut Modify resource permissions of a group - * You can use update resource permissions of a group. If empty body will be provided, no updates will happen, instead you will be returned the current permissions of resource in a group. In this case response code will be 200 + * UmGroupsSharesPut Modify group share privileges + * Modify share permissions for the specified group. With an empty body, no updates are performed, and the current share permissions for the group are returned with response code 200. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId - * @param resourceId + * @param groupId The unique ID of the group. + * @param resourceId The unique ID of the resource. * @return ApiUmGroupsSharesPutRequest */ func (a *UserManagementApiService) UmGroupsSharesPut(ctx _context.Context, groupId string, resourceId string) ApiUmGroupsSharesPutRequest { return ApiUmGroupsSharesPutRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, resourceId: resourceId, } } @@ -1730,10 +1956,21 @@ func (a *UserManagementApiService) UmGroupsSharesPutExecute(r ApiUmGroupsSharesP if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1775,13 +2012,14 @@ func (a *UserManagementApiService) UmGroupsSharesPutExecute(r ApiUmGroupsSharesP return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsSharesPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsSharesPut", } if err != nil || localVarHTTPResponse == nil { @@ -1797,24 +2035,26 @@ func (a *UserManagementApiService) UmGroupsSharesPutExecute(r ApiUmGroupsSharesP if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1823,12 +2063,12 @@ func (a *UserManagementApiService) UmGroupsSharesPutExecute(r ApiUmGroupsSharesP } type ApiUmGroupsUsersDeleteRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - userId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + userId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1845,44 +2085,42 @@ func (r ApiUmGroupsUsersDeleteRequest) XContractNumber(xContractNumber int32) Ap return r } -func (r ApiUmGroupsUsersDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiUmGroupsUsersDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.UmGroupsUsersDeleteExecute(r) } /* - * UmGroupsUsersDelete Remove a user from a group - * This will remove a user from a group + * UmGroupsUsersDelete Remove users from groups + * Remove the specified user from the group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId - * @param userId + * @param groupId The unique ID of the group. + * @param userId The unique ID of the user. * @return ApiUmGroupsUsersDeleteRequest */ func (a *UserManagementApiService) UmGroupsUsersDelete(ctx _context.Context, groupId string, userId string) ApiUmGroupsUsersDeleteRequest { return ApiUmGroupsUsersDeleteRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, - userId: userId, + ctx: ctx, + groupId: groupId, + userId: userId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *UserManagementApiService) UmGroupsUsersDeleteExecute(r ApiUmGroupsUsersDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *UserManagementApiService) UmGroupsUsersDeleteExecute(r ApiUmGroupsUsersDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmGroupsUsersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/um/groups/{groupId}/users/{userId}" @@ -1895,10 +2133,21 @@ func (a *UserManagementApiService) UmGroupsUsersDeleteExecute(r ApiUmGroupsUsers if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1935,62 +2184,58 @@ func (a *UserManagementApiService) UmGroupsUsersDeleteExecute(r ApiUmGroupsUsers } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsUsersDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsUsersDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiUmGroupsUsersGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + groupId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2007,22 +2252,42 @@ func (r ApiUmGroupsUsersGetRequest) XContractNumber(xContractNumber int32) ApiUm return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmGroupsUsersGetRequest) Filter(key string, value string) ApiUmGroupsUsersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmGroupsUsersGetRequest) OrderBy(orderBy string) ApiUmGroupsUsersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmGroupsUsersGetRequest) MaxResults(maxResults int32) ApiUmGroupsUsersGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmGroupsUsersGetRequest) Execute() (GroupMembers, *APIResponse, error) { return r.ApiService.UmGroupsUsersGetExecute(r) } /* - * UmGroupsUsersGet List Group Members - * You can retrieve a list of users who are members of the group + * UmGroupsUsersGet List group members + * List all members of the specified user group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId + * @param groupId The unique ID of the group. * @return ApiUmGroupsUsersGetRequest */ func (a *UserManagementApiService) UmGroupsUsersGet(ctx _context.Context, groupId string) ApiUmGroupsUsersGetRequest { return ApiUmGroupsUsersGetRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, + filters: _neturl.Values{}, } } @@ -2054,10 +2319,34 @@ func (a *UserManagementApiService) UmGroupsUsersGetExecute(r ApiUmGroupsUsersGet if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2097,13 +2386,14 @@ func (a *UserManagementApiService) UmGroupsUsersGetExecute(r ApiUmGroupsUsersGet return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsUsersGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsUsersGet", } if err != nil || localVarHTTPResponse == nil { @@ -2119,24 +2409,26 @@ func (a *UserManagementApiService) UmGroupsUsersGetExecute(r ApiUmGroupsUsersGet if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2145,12 +2437,12 @@ func (a *UserManagementApiService) UmGroupsUsersGetExecute(r ApiUmGroupsUsersGet } type ApiUmGroupsUsersPostRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - groupId string - user *User - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + groupId string + user *User + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2176,17 +2468,17 @@ func (r ApiUmGroupsUsersPostRequest) Execute() (User, *APIResponse, error) { } /* - * UmGroupsUsersPost Add a user to a group - * This will attach a pre-existing user to a group. + * UmGroupsUsersPost Add group members + * Add an existing user to the specified group. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param groupId + * @param groupId The unique ID of the group. * @return ApiUmGroupsUsersPostRequest */ func (a *UserManagementApiService) UmGroupsUsersPost(ctx _context.Context, groupId string) ApiUmGroupsUsersPostRequest { return ApiUmGroupsUsersPostRequest{ ApiService: a, - ctx: ctx, - groupId: groupId, + ctx: ctx, + groupId: groupId, } } @@ -2221,10 +2513,21 @@ func (a *UserManagementApiService) UmGroupsUsersPostExecute(r ApiUmGroupsUsersPo if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -2266,13 +2569,14 @@ func (a *UserManagementApiService) UmGroupsUsersPostExecute(r ApiUmGroupsUsersPo return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmGroupsUsersPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmGroupsUsersPost", } if err != nil || localVarHTTPResponse == nil { @@ -2288,24 +2592,26 @@ func (a *UserManagementApiService) UmGroupsUsersPostExecute(r ApiUmGroupsUsersPo if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2314,11 +2620,11 @@ func (a *UserManagementApiService) UmGroupsUsersPostExecute(r ApiUmGroupsUsersPo } type ApiUmResourcesFindByTypeRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - resourceType string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + resourceType string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2340,16 +2646,20 @@ func (r ApiUmResourcesFindByTypeRequest) Execute() (Resources, *APIResponse, err } /* - * UmResourcesFindByType Retrieve a list of Resources by type. - * You can retrieve a list of resources by using the type. Allowed values are { datacenter, snapshot, image, ipblock, pcc, backupunit, k8s }. This value of resource type also be found in the response body when you GET a list of all resources. + * UmResourcesFindByType List resources by type + * List all resources of the specified type. + +Resource types are: {datacenter, snapshot, image, ipblock, pcc, backupunit, k8s} + +Resource types are in the list of resources, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param resourceType The resource Type + * @param resourceType The resource type * @return ApiUmResourcesFindByTypeRequest - */ +*/ func (a *UserManagementApiService) UmResourcesFindByType(ctx _context.Context, resourceType string) ApiUmResourcesFindByTypeRequest { return ApiUmResourcesFindByTypeRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, resourceType: resourceType, } } @@ -2382,10 +2692,21 @@ func (a *UserManagementApiService) UmResourcesFindByTypeExecute(r ApiUmResources if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2425,13 +2746,14 @@ func (a *UserManagementApiService) UmResourcesFindByTypeExecute(r ApiUmResources return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmResourcesFindByType", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmResourcesFindByType", } if err != nil || localVarHTTPResponse == nil { @@ -2447,24 +2769,26 @@ func (a *UserManagementApiService) UmResourcesFindByTypeExecute(r ApiUmResources if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2473,12 +2797,12 @@ func (a *UserManagementApiService) UmResourcesFindByTypeExecute(r ApiUmResources } type ApiUmResourcesFindByTypeAndIdRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - resourceType string - resourceId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + resourceType string + resourceId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2500,19 +2824,23 @@ func (r ApiUmResourcesFindByTypeAndIdRequest) Execute() (Resource, *APIResponse, } /* - * UmResourcesFindByTypeAndId Retrieve a Resource by type. - * You can retrieve a resource by using the type and its uuid. Allowed values for types are { datacenter, snapshot, image, ipblock, pcc, backupunit, k8s }. The value of resource type can also be found in the response body when you GET a list of all resources. + * UmResourcesFindByTypeAndId Retrieve resources by type + * Retrieve a resource by the resource type and resource ID. + +Resource types are: {datacenter, snapshot, image, ipblock, pcc, backupunit, k8s} + +Resource types are in the list of resources, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param resourceType The resource Type - * @param resourceId The resource Uuid + * @param resourceType The resource type + * @param resourceId The resource ID * @return ApiUmResourcesFindByTypeAndIdRequest - */ +*/ func (a *UserManagementApiService) UmResourcesFindByTypeAndId(ctx _context.Context, resourceType string, resourceId string) ApiUmResourcesFindByTypeAndIdRequest { return ApiUmResourcesFindByTypeAndIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, resourceType: resourceType, - resourceId: resourceId, + resourceId: resourceId, } } @@ -2545,10 +2873,21 @@ func (a *UserManagementApiService) UmResourcesFindByTypeAndIdExecute(r ApiUmReso if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2588,13 +2927,14 @@ func (a *UserManagementApiService) UmResourcesFindByTypeAndIdExecute(r ApiUmReso return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmResourcesFindByTypeAndId", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmResourcesFindByTypeAndId", } if err != nil || localVarHTTPResponse == nil { @@ -2610,24 +2950,26 @@ func (a *UserManagementApiService) UmResourcesFindByTypeAndIdExecute(r ApiUmReso if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2636,10 +2978,13 @@ func (a *UserManagementApiService) UmResourcesFindByTypeAndIdExecute(r ApiUmReso } type ApiUmResourcesGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2656,20 +3001,40 @@ func (r ApiUmResourcesGetRequest) XContractNumber(xContractNumber int32) ApiUmRe return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmResourcesGetRequest) Filter(key string, value string) ApiUmResourcesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmResourcesGetRequest) OrderBy(orderBy string) ApiUmResourcesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmResourcesGetRequest) MaxResults(maxResults int32) ApiUmResourcesGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmResourcesGetRequest) Execute() (Resources, *APIResponse, error) { return r.ApiService.UmResourcesGetExecute(r) } /* - * UmResourcesGet List All Resources. - * You can retrieve a complete list of all resources that you have access to + * UmResourcesGet List all resources + * List all the available resources. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUmResourcesGetRequest */ func (a *UserManagementApiService) UmResourcesGet(ctx _context.Context) ApiUmResourcesGetRequest { return ApiUmResourcesGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -2700,10 +3065,34 @@ func (a *UserManagementApiService) UmResourcesGetExecute(r ApiUmResourcesGetRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2743,13 +3132,14 @@ func (a *UserManagementApiService) UmResourcesGetExecute(r ApiUmResourcesGetRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmResourcesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmResourcesGet", } if err != nil || localVarHTTPResponse == nil { @@ -2765,24 +3155,26 @@ func (a *UserManagementApiService) UmResourcesGetExecute(r ApiUmResourcesGetRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -2791,11 +3183,11 @@ func (a *UserManagementApiService) UmResourcesGetExecute(r ApiUmResourcesGetRequ } type ApiUmUsersDeleteRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + userId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2812,42 +3204,40 @@ func (r ApiUmUsersDeleteRequest) XContractNumber(xContractNumber int32) ApiUmUse return r } -func (r ApiUmUsersDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiUmUsersDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.UmUsersDeleteExecute(r) } /* - * UmUsersDelete Delete a User - * Delete a user + * UmUsersDelete Delete users + * Delete the specified user. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user + * @param userId The unique ID of the user. * @return ApiUmUsersDeleteRequest */ func (a *UserManagementApiService) UmUsersDelete(ctx _context.Context, userId string) ApiUmUsersDeleteRequest { return ApiUmUsersDeleteRequest{ ApiService: a, - ctx: ctx, - userId: userId, + ctx: ctx, + userId: userId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *UserManagementApiService) UmUsersDeleteExecute(r ApiUmUsersDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *UserManagementApiService) UmUsersDeleteExecute(r ApiUmUsersDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/um/users/{userId}" @@ -2859,10 +3249,21 @@ func (a *UserManagementApiService) UmUsersDeleteExecute(r ApiUmUsersDeleteReques if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2899,62 +3300,55 @@ func (a *UserManagementApiService) UmUsersDeleteExecute(r ApiUmUsersDeleteReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - return localVarReturnValue, localVarAPIResponse, newErr + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiUmUsersFindByIdRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + userId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -2976,17 +3370,17 @@ func (r ApiUmUsersFindByIdRequest) Execute() (User, *APIResponse, error) { } /* - * UmUsersFindById Retrieve a User - * You can retrieve user details by using the users ID. This value can be found in the response body when a user is created or when you GET a list of users. + * UmUsersFindById Retrieve users + * Retrieve user properties by user ID. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user + * @param userId The unique ID of the user. * @return ApiUmUsersFindByIdRequest */ func (a *UserManagementApiService) UmUsersFindById(ctx _context.Context, userId string) ApiUmUsersFindByIdRequest { return ApiUmUsersFindByIdRequest{ ApiService: a, - ctx: ctx, - userId: userId, + ctx: ctx, + userId: userId, } } @@ -3018,10 +3412,21 @@ func (a *UserManagementApiService) UmUsersFindByIdExecute(r ApiUmUsersFindByIdRe if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3061,13 +3466,14 @@ func (a *UserManagementApiService) UmUsersFindByIdExecute(r ApiUmUsersFindByIdRe return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersFindById", } if err != nil || localVarHTTPResponse == nil { @@ -3083,24 +3489,26 @@ func (a *UserManagementApiService) UmUsersFindByIdExecute(r ApiUmUsersFindByIdRe if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3109,11 +3517,16 @@ func (a *UserManagementApiService) UmUsersFindByIdExecute(r ApiUmUsersFindByIdRe } type ApiUmUsersGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiUmUsersGetRequest) Pretty(pretty bool) ApiUmUsersGetRequest { @@ -3128,21 +3541,49 @@ func (r ApiUmUsersGetRequest) XContractNumber(xContractNumber int32) ApiUmUsersG r.xContractNumber = &xContractNumber return r } +func (r ApiUmUsersGetRequest) Offset(offset int32) ApiUmUsersGetRequest { + r.offset = &offset + return r +} +func (r ApiUmUsersGetRequest) Limit(limit int32) ApiUmUsersGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmUsersGetRequest) Filter(key string, value string) ApiUmUsersGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmUsersGetRequest) OrderBy(orderBy string) ApiUmUsersGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmUsersGetRequest) MaxResults(maxResults int32) ApiUmUsersGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiUmUsersGetRequest) Execute() (Users, *APIResponse, error) { return r.ApiService.UmUsersGetExecute(r) } /* - * UmUsersGet List all Users - * You can retrieve a complete list of users under your account + * UmUsersGet List all users + * List all the users in your account. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUmUsersGetRequest */ func (a *UserManagementApiService) UmUsersGet(ctx _context.Context) ApiUmUsersGetRequest { return ApiUmUsersGetRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, + filters: _neturl.Values{}, } } @@ -3173,14 +3614,54 @@ func (a *UserManagementApiService) UmUsersGetExecute(r ApiUmUsersGetRequest) (Us if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(100, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) if localVarHTTPContentType != "" { localVarHeaderParams["Content-Type"] = localVarHTTPContentType @@ -3216,13 +3697,14 @@ func (a *UserManagementApiService) UmUsersGetExecute(r ApiUmUsersGetRequest) (Us return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersGet", } if err != nil || localVarHTTPResponse == nil { @@ -3238,24 +3720,26 @@ func (a *UserManagementApiService) UmUsersGetExecute(r ApiUmUsersGetRequest) (Us if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3264,11 +3748,14 @@ func (a *UserManagementApiService) UmUsersGetExecute(r ApiUmUsersGetRequest) (Us } type ApiUmUsersGroupsGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + userId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3285,22 +3772,42 @@ func (r ApiUmUsersGroupsGetRequest) XContractNumber(xContractNumber int32) ApiUm return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmUsersGroupsGetRequest) Filter(key string, value string) ApiUmUsersGroupsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmUsersGroupsGetRequest) OrderBy(orderBy string) ApiUmUsersGroupsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmUsersGroupsGetRequest) MaxResults(maxResults int32) ApiUmUsersGroupsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmUsersGroupsGetRequest) Execute() (ResourceGroups, *APIResponse, error) { return r.ApiService.UmUsersGroupsGetExecute(r) } /* - * UmUsersGroupsGet Retrieve a User's group resources - * You can retrieve group resources of user by using the users ID. This value can be found in the response body when a user is created or when you GET a list of users. + * UmUsersGroupsGet Retrieve group resources by user ID + * Retrieve group resources of the user by user ID. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user + * @param userId The unique ID of the user. * @return ApiUmUsersGroupsGetRequest */ func (a *UserManagementApiService) UmUsersGroupsGet(ctx _context.Context, userId string) ApiUmUsersGroupsGetRequest { return ApiUmUsersGroupsGetRequest{ ApiService: a, - ctx: ctx, - userId: userId, + ctx: ctx, + userId: userId, + filters: _neturl.Values{}, } } @@ -3332,10 +3839,34 @@ func (a *UserManagementApiService) UmUsersGroupsGetExecute(r ApiUmUsersGroupsGet if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3375,13 +3906,14 @@ func (a *UserManagementApiService) UmUsersGroupsGetExecute(r ApiUmUsersGroupsGet return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersGroupsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersGroupsGet", } if err != nil || localVarHTTPResponse == nil { @@ -3397,24 +3929,26 @@ func (a *UserManagementApiService) UmUsersGroupsGetExecute(r ApiUmUsersGroupsGet if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3423,11 +3957,14 @@ func (a *UserManagementApiService) UmUsersGroupsGetExecute(r ApiUmUsersGroupsGet } type ApiUmUsersOwnsGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + userId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -3444,22 +3981,42 @@ func (r ApiUmUsersOwnsGetRequest) XContractNumber(xContractNumber int32) ApiUmUs return r } +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmUsersOwnsGetRequest) Filter(key string, value string) ApiUmUsersOwnsGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmUsersOwnsGetRequest) OrderBy(orderBy string) ApiUmUsersOwnsGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmUsersOwnsGetRequest) MaxResults(maxResults int32) ApiUmUsersOwnsGetRequest { + r.maxResults = &maxResults + return r +} + func (r ApiUmUsersOwnsGetRequest) Execute() (ResourcesUsers, *APIResponse, error) { return r.ApiService.UmUsersOwnsGetExecute(r) } /* - * UmUsersOwnsGet Retrieve a User's own resources - * You can retrieve resources owned by using the users ID. This value can be found in the response body when a user is created or when you GET a list of users. + * UmUsersOwnsGet Retrieve user resources by user ID + * Retrieve own resources of the user by user ID. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user + * @param userId The unique ID of the user. * @return ApiUmUsersOwnsGetRequest */ func (a *UserManagementApiService) UmUsersOwnsGet(ctx _context.Context, userId string) ApiUmUsersOwnsGetRequest { return ApiUmUsersOwnsGetRequest{ ApiService: a, - ctx: ctx, - userId: userId, + ctx: ctx, + userId: userId, + filters: _neturl.Values{}, } } @@ -3491,10 +4048,34 @@ func (a *UserManagementApiService) UmUsersOwnsGetExecute(r ApiUmUsersOwnsGetRequ if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3534,13 +4115,14 @@ func (a *UserManagementApiService) UmUsersOwnsGetExecute(r ApiUmUsersOwnsGetRequ return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersOwnsGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersOwnsGet", } if err != nil || localVarHTTPResponse == nil { @@ -3556,24 +4138,26 @@ func (a *UserManagementApiService) UmUsersOwnsGetExecute(r ApiUmUsersOwnsGetRequ if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3582,15 +4166,15 @@ func (a *UserManagementApiService) UmUsersOwnsGetExecute(r ApiUmUsersOwnsGetRequ } type ApiUmUsersPostRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - user *User - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + user *UserPost + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiUmUsersPostRequest) User(user User) ApiUmUsersPostRequest { +func (r ApiUmUsersPostRequest) User(user UserPost) ApiUmUsersPostRequest { r.user = &user return r } @@ -3612,15 +4196,15 @@ func (r ApiUmUsersPostRequest) Execute() (User, *APIResponse, error) { } /* - * UmUsersPost Create a user - * You can use this POST method to create a user + * UmUsersPost Create users + * Create a user. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiUmUsersPostRequest */ func (a *UserManagementApiService) UmUsersPost(ctx _context.Context) ApiUmUsersPostRequest { return ApiUmUsersPostRequest{ ApiService: a, - ctx: ctx, + ctx: ctx, } } @@ -3654,10 +4238,21 @@ func (a *UserManagementApiService) UmUsersPostExecute(r ApiUmUsersPostRequest) ( if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3699,13 +4294,14 @@ func (a *UserManagementApiService) UmUsersPostExecute(r ApiUmUsersPostRequest) ( return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersPost", } if err != nil || localVarHTTPResponse == nil { @@ -3721,24 +4317,26 @@ func (a *UserManagementApiService) UmUsersPostExecute(r ApiUmUsersPostRequest) ( if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -3747,16 +4345,16 @@ func (a *UserManagementApiService) UmUsersPostExecute(r ApiUmUsersPostRequest) ( } type ApiUmUsersPutRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - user *User - pretty *bool - depth *int32 + ctx _context.Context + ApiService *UserManagementApiService + userId string + user *UserPut + pretty *bool + depth *int32 xContractNumber *int32 } -func (r ApiUmUsersPutRequest) User(user User) ApiUmUsersPutRequest { +func (r ApiUmUsersPutRequest) User(user UserPut) ApiUmUsersPutRequest { r.user = &user return r } @@ -3778,17 +4376,17 @@ func (r ApiUmUsersPutRequest) Execute() (User, *APIResponse, error) { } /* - * UmUsersPut Modify a user - * You can use update attributes of a User + * UmUsersPut Modify users + * Modify the properties of the specified user. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId + * @param userId The unique ID of the user. * @return ApiUmUsersPutRequest */ func (a *UserManagementApiService) UmUsersPut(ctx _context.Context, userId string) ApiUmUsersPutRequest { return ApiUmUsersPutRequest{ ApiService: a, - ctx: ctx, - userId: userId, + ctx: ctx, + userId: userId, } } @@ -3823,10 +4421,21 @@ func (a *UserManagementApiService) UmUsersPutExecute(r ApiUmUsersPutRequest) (Us if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -3868,13 +4477,14 @@ func (a *UserManagementApiService) UmUsersPutExecute(r ApiUmUsersPutRequest) (Us return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersPut", } if err != nil || localVarHTTPResponse == nil { @@ -3890,992 +4500,26 @@ func (a *UserManagementApiService) UmUsersPutExecute(r ApiUmUsersPutRequest) (Us if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3keysDeleteRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - keyId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiUmUsersS3keysDeleteRequest) Pretty(pretty bool) ApiUmUsersS3keysDeleteRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3keysDeleteRequest) Depth(depth int32) ApiUmUsersS3keysDeleteRequest { - r.depth = &depth - return r -} -func (r ApiUmUsersS3keysDeleteRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysDeleteRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3keysDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { - return r.ApiService.UmUsersS3keysDeleteExecute(r) -} - -/* - * UmUsersS3keysDelete Delete a S3 key - * Delete a S3 key - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user - * @param keyId The unique access key ID of the S3 key - * @return ApiUmUsersS3keysDeleteRequest - */ -func (a *UserManagementApiService) UmUsersS3keysDelete(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysDeleteRequest { - return ApiUmUsersS3keysDeleteRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - keyId: keyId, - } -} - -/* - * Execute executes the request - * @return map[string]interface{} - */ -func (a *UserManagementApiService) UmUsersS3keysDeleteExecute(r ApiUmUsersS3keysDeleteRequest) (map[string]interface{}, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3keysDelete") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3keysDelete", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3keysFindByKeyRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - keyId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiUmUsersS3keysFindByKeyRequest) Pretty(pretty bool) ApiUmUsersS3keysFindByKeyRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3keysFindByKeyRequest) Depth(depth int32) ApiUmUsersS3keysFindByKeyRequest { - r.depth = &depth - return r -} -func (r ApiUmUsersS3keysFindByKeyRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysFindByKeyRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3keysFindByKeyRequest) Execute() (S3Key, *APIResponse, error) { - return r.ApiService.UmUsersS3keysFindByKeyExecute(r) -} - -/* - * UmUsersS3keysFindByKey Retrieve given S3 key belonging to the given User - * You can retrieve S3 key belonging to the given User. This user Id can be found in the response body when a user is created or when you GET a list of users. The key Id can be found in the response body when a S3 key is created or when you GET a list of all S3 keys of a user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user - * @param keyId The unique access key ID of the S3 key - * @return ApiUmUsersS3keysFindByKeyRequest - */ -func (a *UserManagementApiService) UmUsersS3keysFindByKey(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysFindByKeyRequest { - return ApiUmUsersS3keysFindByKeyRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - keyId: keyId, - } -} - -/* - * Execute executes the request - * @return S3Key - */ -func (a *UserManagementApiService) UmUsersS3keysFindByKeyExecute(r ApiUmUsersS3keysFindByKeyRequest) (S3Key, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue S3Key - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3keysFindByKey") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3keysFindByKey", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3keysGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiUmUsersS3keysGetRequest) Pretty(pretty bool) ApiUmUsersS3keysGetRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3keysGetRequest) Depth(depth int32) ApiUmUsersS3keysGetRequest { - r.depth = &depth - return r -} -func (r ApiUmUsersS3keysGetRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysGetRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3keysGetRequest) Execute() (S3Keys, *APIResponse, error) { - return r.ApiService.UmUsersS3keysGetExecute(r) -} - -/* - * UmUsersS3keysGet Retrieve a User's S3 keys - * You can retrieve S3 keys owned by a user by using the users ID. This user Id can be found in the response body when a user is created or when you GET a list of users. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user - * @return ApiUmUsersS3keysGetRequest - */ -func (a *UserManagementApiService) UmUsersS3keysGet(ctx _context.Context, userId string) ApiUmUsersS3keysGetRequest { - return ApiUmUsersS3keysGetRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - } -} - -/* - * Execute executes the request - * @return S3Keys - */ -func (a *UserManagementApiService) UmUsersS3keysGetExecute(r ApiUmUsersS3keysGetRequest) (S3Keys, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue S3Keys - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3keysGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3keys" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3keysGet", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3keysPostRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiUmUsersS3keysPostRequest) Pretty(pretty bool) ApiUmUsersS3keysPostRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3keysPostRequest) Depth(depth int32) ApiUmUsersS3keysPostRequest { - r.depth = &depth - return r -} -func (r ApiUmUsersS3keysPostRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysPostRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3keysPostRequest) Execute() (S3Key, *APIResponse, error) { - return r.ApiService.UmUsersS3keysPostExecute(r) -} - -/* - * UmUsersS3keysPost Create a S3 key for the given user - * Creates a S3 key for the given user. This user Id can be found in the response body when a user is created or when you GET a list of users. Maximum of 5 keys can be generated for a given user - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user - * @return ApiUmUsersS3keysPostRequest - */ -func (a *UserManagementApiService) UmUsersS3keysPost(ctx _context.Context, userId string) ApiUmUsersS3keysPostRequest { - return ApiUmUsersS3keysPostRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - } -} - -/* - * Execute executes the request - * @return S3Key - */ -func (a *UserManagementApiService) UmUsersS3keysPostExecute(r ApiUmUsersS3keysPostRequest) (S3Key, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue S3Key - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3keysPost") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3keys" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3keysPost", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3keysPutRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - keyId string - s3Key *S3Key - pretty *bool - depth *int32 - xContractNumber *int32 -} - -func (r ApiUmUsersS3keysPutRequest) S3Key(s3Key S3Key) ApiUmUsersS3keysPutRequest { - r.s3Key = &s3Key - return r -} -func (r ApiUmUsersS3keysPutRequest) Pretty(pretty bool) ApiUmUsersS3keysPutRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3keysPutRequest) Depth(depth int32) ApiUmUsersS3keysPutRequest { - r.depth = &depth - return r -} -func (r ApiUmUsersS3keysPutRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysPutRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3keysPutRequest) Execute() (S3Key, *APIResponse, error) { - return r.ApiService.UmUsersS3keysPutExecute(r) -} - -/* - * UmUsersS3keysPut Modify a S3 key having the given key id - * You can enable or disable a given S3 key - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId - * @param keyId The unique access key ID of the S3 key - * @return ApiUmUsersS3keysPutRequest - */ -func (a *UserManagementApiService) UmUsersS3keysPut(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysPutRequest { - return ApiUmUsersS3keysPutRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - keyId: keyId, - } -} - -/* - * Execute executes the request - * @return S3Key - */ -func (a *UserManagementApiService) UmUsersS3keysPutExecute(r ApiUmUsersS3keysPutRequest) (S3Key, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue S3Key - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3keysPut") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.s3Key == nil { - return localVarReturnValue, nil, reportError("s3Key is required and must be specified") - } - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - if r.depth != nil { - localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - // body params - localVarPostBody = r.s3Key - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3keysPut", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarAPIResponse, newErr - } - - return localVarReturnValue, localVarAPIResponse, nil -} - -type ApiUmUsersS3ssourlGetRequest struct { - ctx _context.Context - ApiService *UserManagementApiService - userId string - pretty *bool - xContractNumber *int32 -} - -func (r ApiUmUsersS3ssourlGetRequest) Pretty(pretty bool) ApiUmUsersS3ssourlGetRequest { - r.pretty = &pretty - return r -} -func (r ApiUmUsersS3ssourlGetRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3ssourlGetRequest { - r.xContractNumber = &xContractNumber - return r -} - -func (r ApiUmUsersS3ssourlGetRequest) Execute() (S3ObjectStorageSSO, *APIResponse, error) { - return r.ApiService.UmUsersS3ssourlGetExecute(r) -} - -/* - * UmUsersS3ssourlGet Retrieve S3 object storage single signon URL for the given user - * You can retrieve S3 object storage single signon URL for the given user. This user Id can be found in the response body when a user is created or when you GET a list of users. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param userId The unique ID of the user - * @return ApiUmUsersS3ssourlGetRequest - */ -func (a *UserManagementApiService) UmUsersS3ssourlGet(ctx _context.Context, userId string) ApiUmUsersS3ssourlGetRequest { - return ApiUmUsersS3ssourlGetRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - } -} - -/* - * Execute executes the request - * @return S3ObjectStorageSSO - */ -func (a *UserManagementApiService) UmUsersS3ssourlGetExecute(r ApiUmUsersS3ssourlGetRequest) (S3ObjectStorageSSO, *APIResponse, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue S3ObjectStorageSSO - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserManagementApiService.UmUsersS3ssourlGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/um/users/{userId}/s3ssourl" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.pretty != nil { - localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.xContractNumber != nil { - localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Token Authentication"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "UmUsersS3ssourlGet", - } - - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarAPIResponse.Payload = localVarBody - if err != nil { - return localVarReturnValue, localVarAPIResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_s3_keys.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_s3_keys.go new file mode 100644 index 000000000000..d4a943a5fa29 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_user_s3_keys.go @@ -0,0 +1,1135 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// UserS3KeysApiService UserS3KeysApi service +type UserS3KeysApiService service + +type ApiUmUsersS3keysDeleteRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + userId string + keyId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiUmUsersS3keysDeleteRequest) Pretty(pretty bool) ApiUmUsersS3keysDeleteRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3keysDeleteRequest) Depth(depth int32) ApiUmUsersS3keysDeleteRequest { + r.depth = &depth + return r +} +func (r ApiUmUsersS3keysDeleteRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysDeleteRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiUmUsersS3keysDeleteRequest) Execute() (*APIResponse, error) { + return r.ApiService.UmUsersS3keysDeleteExecute(r) +} + +/* + * UmUsersS3keysDelete Delete S3 keys + * Delete the specified user S3 key. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @param keyId The unique ID of the S3 key. + * @return ApiUmUsersS3keysDeleteRequest + */ +func (a *UserS3KeysApiService) UmUsersS3keysDelete(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysDeleteRequest { + return ApiUmUsersS3keysDeleteRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + keyId: keyId, + } +} + +/* + * Execute executes the request + */ +func (a *UserS3KeysApiService) UmUsersS3keysDeleteExecute(r ApiUmUsersS3keysDeleteRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3keysDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3keysDelete", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr + } + newErr.model = v + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} + +type ApiUmUsersS3keysFindByKeyIdRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + userId string + keyId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiUmUsersS3keysFindByKeyIdRequest) Pretty(pretty bool) ApiUmUsersS3keysFindByKeyIdRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3keysFindByKeyIdRequest) Depth(depth int32) ApiUmUsersS3keysFindByKeyIdRequest { + r.depth = &depth + return r +} +func (r ApiUmUsersS3keysFindByKeyIdRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysFindByKeyIdRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiUmUsersS3keysFindByKeyIdRequest) Execute() (S3Key, *APIResponse, error) { + return r.ApiService.UmUsersS3keysFindByKeyIdExecute(r) +} + +/* + * UmUsersS3keysFindByKeyId Retrieve user S3 keys by key ID + * Retrieve the specified user S3 key. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. The key ID is in the response body when the S3 key is created, and in the list of all user S3 keys, returned by GET. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @param keyId The unique ID of the S3 key. + * @return ApiUmUsersS3keysFindByKeyIdRequest + */ +func (a *UserS3KeysApiService) UmUsersS3keysFindByKeyId(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysFindByKeyIdRequest { + return ApiUmUsersS3keysFindByKeyIdRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + keyId: keyId, + } +} + +/* + * Execute executes the request + * @return S3Key + */ +func (a *UserS3KeysApiService) UmUsersS3keysFindByKeyIdExecute(r ApiUmUsersS3keysFindByKeyIdRequest) (S3Key, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue S3Key + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3keysFindByKeyId") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3keysFindByKeyId", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiUmUsersS3keysGetRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + userId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiUmUsersS3keysGetRequest) Pretty(pretty bool) ApiUmUsersS3keysGetRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3keysGetRequest) Depth(depth int32) ApiUmUsersS3keysGetRequest { + r.depth = &depth + return r +} +func (r ApiUmUsersS3keysGetRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmUsersS3keysGetRequest) Filter(key string, value string) ApiUmUsersS3keysGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmUsersS3keysGetRequest) OrderBy(orderBy string) ApiUmUsersS3keysGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmUsersS3keysGetRequest) MaxResults(maxResults int32) ApiUmUsersS3keysGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiUmUsersS3keysGetRequest) Execute() (S3Keys, *APIResponse, error) { + return r.ApiService.UmUsersS3keysGetExecute(r) +} + +/* + * UmUsersS3keysGet List user S3 keys + * List S3 keys by user ID. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @return ApiUmUsersS3keysGetRequest + */ +func (a *UserS3KeysApiService) UmUsersS3keysGet(ctx _context.Context, userId string) ApiUmUsersS3keysGetRequest { + return ApiUmUsersS3keysGetRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return S3Keys + */ +func (a *UserS3KeysApiService) UmUsersS3keysGetExecute(r ApiUmUsersS3keysGetRequest) (S3Keys, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue S3Keys + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3keysGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3keys" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3keysGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiUmUsersS3keysPostRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + userId string + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiUmUsersS3keysPostRequest) Pretty(pretty bool) ApiUmUsersS3keysPostRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3keysPostRequest) Depth(depth int32) ApiUmUsersS3keysPostRequest { + r.depth = &depth + return r +} +func (r ApiUmUsersS3keysPostRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysPostRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiUmUsersS3keysPostRequest) Execute() (S3Key, *APIResponse, error) { + return r.ApiService.UmUsersS3keysPostExecute(r) +} + +/* + * UmUsersS3keysPost Create user S3 keys + * Create an S3 key for the specified user. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. A maximum of five keys per user can be generated. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @return ApiUmUsersS3keysPostRequest + */ +func (a *UserS3KeysApiService) UmUsersS3keysPost(ctx _context.Context, userId string) ApiUmUsersS3keysPostRequest { + return ApiUmUsersS3keysPostRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +/* + * Execute executes the request + * @return S3Key + */ +func (a *UserS3KeysApiService) UmUsersS3keysPostExecute(r ApiUmUsersS3keysPostRequest) (S3Key, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue S3Key + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3keysPost") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3keys" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3keysPost", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiUmUsersS3keysPutRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + userId string + keyId string + s3Key *S3Key + pretty *bool + depth *int32 + xContractNumber *int32 +} + +func (r ApiUmUsersS3keysPutRequest) S3Key(s3Key S3Key) ApiUmUsersS3keysPutRequest { + r.s3Key = &s3Key + return r +} +func (r ApiUmUsersS3keysPutRequest) Pretty(pretty bool) ApiUmUsersS3keysPutRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3keysPutRequest) Depth(depth int32) ApiUmUsersS3keysPutRequest { + r.depth = &depth + return r +} +func (r ApiUmUsersS3keysPutRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3keysPutRequest { + r.xContractNumber = &xContractNumber + return r +} + +func (r ApiUmUsersS3keysPutRequest) Execute() (S3Key, *APIResponse, error) { + return r.ApiService.UmUsersS3keysPutExecute(r) +} + +/* + * UmUsersS3keysPut Modify S3 keys by key ID + * Enable or disable the specified user S3 key. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @param keyId The unique ID of the S3 key. + * @return ApiUmUsersS3keysPutRequest + */ +func (a *UserS3KeysApiService) UmUsersS3keysPut(ctx _context.Context, userId string, keyId string) ApiUmUsersS3keysPutRequest { + return ApiUmUsersS3keysPutRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + keyId: keyId, + } +} + +/* + * Execute executes the request + * @return S3Key + */ +func (a *UserS3KeysApiService) UmUsersS3keysPutExecute(r ApiUmUsersS3keysPutRequest) (S3Key, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue S3Key + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3keysPut") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3keys/{keyId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", _neturl.PathEscape(parameterToString(r.keyId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.s3Key == nil { + return localVarReturnValue, nil, reportError("s3Key is required and must be specified") + } + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.depth != nil { + localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + // body params + localVarPostBody = r.s3Key + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3keysPut", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + +type ApiUmUsersS3ssourlGetRequest struct { + ctx _context.Context + ApiService *UserS3KeysApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + userId string + pretty *bool + xContractNumber *int32 +} + +func (r ApiUmUsersS3ssourlGetRequest) Pretty(pretty bool) ApiUmUsersS3ssourlGetRequest { + r.pretty = &pretty + return r +} +func (r ApiUmUsersS3ssourlGetRequest) XContractNumber(xContractNumber int32) ApiUmUsersS3ssourlGetRequest { + r.xContractNumber = &xContractNumber + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiUmUsersS3ssourlGetRequest) Filter(key string, value string) ApiUmUsersS3ssourlGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiUmUsersS3ssourlGetRequest) OrderBy(orderBy string) ApiUmUsersS3ssourlGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiUmUsersS3ssourlGetRequest) MaxResults(maxResults int32) ApiUmUsersS3ssourlGetRequest { + r.maxResults = &maxResults + return r +} + +func (r ApiUmUsersS3ssourlGetRequest) Execute() (S3ObjectStorageSSO, *APIResponse, error) { + return r.ApiService.UmUsersS3ssourlGetExecute(r) +} + +/* + * UmUsersS3ssourlGet Retrieve S3 single sign-on URLs + * Retrieve S3 Object Storage single sign-on URLs for the the specified user. The user ID is in the response body when the user is created, and in the list of the users, returned by GET. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId The unique ID of the user. + * @return ApiUmUsersS3ssourlGetRequest + */ +func (a *UserS3KeysApiService) UmUsersS3ssourlGet(ctx _context.Context, userId string) ApiUmUsersS3ssourlGetRequest { + return ApiUmUsersS3ssourlGetRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + filters: _neturl.Values{}, + } +} + +/* + * Execute executes the request + * @return S3ObjectStorageSSO + */ +func (a *UserS3KeysApiService) UmUsersS3ssourlGetExecute(r ApiUmUsersS3ssourlGetRequest) (S3ObjectStorageSSO, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue S3ObjectStorageSSO + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserS3KeysApiService.UmUsersS3ssourlGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/um/users/{userId}/s3ssourl" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.PathEscape(parameterToString(r.userId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.pretty != nil { + localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xContractNumber != nil { + localVarHeaderParams["X-Contract-Number"] = parameterToString(*r.xContractNumber, "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Token Authentication"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "UmUsersS3ssourlGet", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = 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(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volume.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volumes.go similarity index 64% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volume.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volumes.go index 5a243ff58359..5c88037315c6 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volume.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/api_volumes.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( _context "context" + "fmt" _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" @@ -23,21 +24,21 @@ var ( _ _context.Context ) -// VolumeApiService VolumeApi service -type VolumeApiService service +// VolumesApiService VolumesApi service +type VolumesApiService service type ApiDatacentersVolumesCreateSnapshotPostRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - pretty *bool - depth *int32 - xContractNumber *int32 - name *string - description *string + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + pretty *bool + depth *int32 + xContractNumber *int32 + name *string + description *string secAuthProtection *bool - licenceType *string + licenceType *string } func (r ApiDatacentersVolumesCreateSnapshotPostRequest) Pretty(pretty bool) ApiDatacentersVolumesCreateSnapshotPostRequest { @@ -74,19 +75,19 @@ func (r ApiDatacentersVolumesCreateSnapshotPostRequest) Execute() (Snapshot, *AP } /* - * DatacentersVolumesCreateSnapshotPost Create Volume Snapshot - * Creates a snapshot of a volume within the datacenter. You can use a snapshot to create a new storage volume or to restore a storage volume. + * DatacentersVolumesCreateSnapshotPost Create volume snapshots + * Create a snapshot of the specified volume within the data center; this snapshot can later be used to restore this volume. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesCreateSnapshotPostRequest */ -func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesCreateSnapshotPostRequest { +func (a *VolumesApiService) DatacentersVolumesCreateSnapshotPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesCreateSnapshotPostRequest { return ApiDatacentersVolumesCreateSnapshotPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } @@ -94,7 +95,7 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPost(ctx _context.Con * Execute executes the request * @return Snapshot */ -func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiDatacentersVolumesCreateSnapshotPostRequest) (Snapshot, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiDatacentersVolumesCreateSnapshotPostRequest) (Snapshot, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -104,7 +105,7 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiData localVarReturnValue Snapshot ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesCreateSnapshotPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesCreateSnapshotPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -119,10 +120,21 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiData if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -174,13 +186,14 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiData return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesCreateSnapshotPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesCreateSnapshotPost", } if err != nil || localVarHTTPResponse == nil { @@ -196,24 +209,26 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiData if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -222,12 +237,12 @@ func (a *VolumeApiService) DatacentersVolumesCreateSnapshotPostExecute(r ApiData } type ApiDatacentersVolumesDeleteRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -244,44 +259,42 @@ func (r ApiDatacentersVolumesDeleteRequest) XContractNumber(xContractNumber int3 return r } -func (r ApiDatacentersVolumesDeleteRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersVolumesDeleteRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersVolumesDeleteExecute(r) } /* - * DatacentersVolumesDelete Delete a Volume - * Deletes the specified volume. This will result in the volume being removed from your datacenter. Use this with caution. + * DatacentersVolumesDelete Delete volumes + * Delete the specified volume within the data center. Use with caution, the volume will be permanently removed! * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesDeleteRequest */ -func (a *VolumeApiService) DatacentersVolumesDelete(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesDeleteRequest { +func (a *VolumesApiService) DatacentersVolumesDelete(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesDeleteRequest { return ApiDatacentersVolumesDeleteRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *VolumeApiService) DatacentersVolumesDeleteExecute(r ApiDatacentersVolumesDeleteRequest) (map[string]interface{}, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesDeleteExecute(r ApiDatacentersVolumesDeleteRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesDelete") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/volumes/{volumeId}" @@ -294,10 +307,21 @@ func (a *VolumeApiService) DatacentersVolumesDeleteExecute(r ApiDatacentersVolum if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -334,63 +358,56 @@ func (a *VolumeApiService) DatacentersVolumesDeleteExecute(r ApiDatacentersVolum } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesDelete", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesDelete", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } type ApiDatacentersVolumesFindByIdRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + pretty *bool + depth *int32 xContractNumber *int32 } @@ -412,19 +429,19 @@ func (r ApiDatacentersVolumesFindByIdRequest) Execute() (Volume, *APIResponse, e } /* - * DatacentersVolumesFindById Retrieve a Volume - * Retrieves the attributes of a given Volume + * DatacentersVolumesFindById Retrieve volumes + * Retrieve the properties of the specified volume within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesFindByIdRequest */ -func (a *VolumeApiService) DatacentersVolumesFindById(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesFindByIdRequest { +func (a *VolumesApiService) DatacentersVolumesFindById(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesFindByIdRequest { return ApiDatacentersVolumesFindByIdRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } @@ -432,7 +449,7 @@ func (a *VolumeApiService) DatacentersVolumesFindById(ctx _context.Context, data * Execute executes the request * @return Volume */ -func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVolumesFindByIdRequest) (Volume, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVolumesFindByIdRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -442,7 +459,7 @@ func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVol localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesFindById") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesFindById") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -457,10 +474,21 @@ func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVol if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -500,13 +528,14 @@ func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVol return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesFindById", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesFindById", } if err != nil || localVarHTTPResponse == nil { @@ -522,24 +551,26 @@ func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVol if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -548,12 +579,17 @@ func (a *VolumeApiService) DatacentersVolumesFindByIdExecute(r ApiDatacentersVol } type ApiDatacentersVolumesGetRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + filters _neturl.Values + orderBy *string + maxResults *int32 + datacenterId string + pretty *bool + depth *int32 xContractNumber *int32 + offset *int32 + limit *int32 } func (r ApiDatacentersVolumesGetRequest) Pretty(pretty bool) ApiDatacentersVolumesGetRequest { @@ -568,23 +604,51 @@ func (r ApiDatacentersVolumesGetRequest) XContractNumber(xContractNumber int32) r.xContractNumber = &xContractNumber return r } +func (r ApiDatacentersVolumesGetRequest) Offset(offset int32) ApiDatacentersVolumesGetRequest { + r.offset = &offset + return r +} +func (r ApiDatacentersVolumesGetRequest) Limit(limit int32) ApiDatacentersVolumesGetRequest { + r.limit = &limit + return r +} + +// Filters query parameters limit results to those containing a matching value for a specific property. +func (r ApiDatacentersVolumesGetRequest) Filter(key string, value string) ApiDatacentersVolumesGetRequest { + filterKey := fmt.Sprintf(FilterQueryParam, key) + r.filters[filterKey] = []string{value} + return r +} + +// OrderBy query param sorts the results alphanumerically in ascending order based on the specified property. +func (r ApiDatacentersVolumesGetRequest) OrderBy(orderBy string) ApiDatacentersVolumesGetRequest { + r.orderBy = &orderBy + return r +} + +// MaxResults query param limits the number of results returned. +func (r ApiDatacentersVolumesGetRequest) MaxResults(maxResults int32) ApiDatacentersVolumesGetRequest { + r.maxResults = &maxResults + return r +} func (r ApiDatacentersVolumesGetRequest) Execute() (Volumes, *APIResponse, error) { return r.ApiService.DatacentersVolumesGetExecute(r) } /* - * DatacentersVolumesGet List Volumes - * Retrieves a list of Volumes. + * DatacentersVolumesGet List volumes + * List all the volumes within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersVolumesGetRequest */ -func (a *VolumeApiService) DatacentersVolumesGet(ctx _context.Context, datacenterId string) ApiDatacentersVolumesGetRequest { +func (a *VolumesApiService) DatacentersVolumesGet(ctx _context.Context, datacenterId string) ApiDatacentersVolumesGetRequest { return ApiDatacentersVolumesGetRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, + filters: _neturl.Values{}, } } @@ -592,7 +656,7 @@ func (a *VolumeApiService) DatacentersVolumesGet(ctx _context.Context, datacente * Execute executes the request * @return Volumes */ -func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesGetRequest) (Volumes, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesGetRequest) (Volumes, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -602,7 +666,7 @@ func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesG localVarReturnValue Volumes ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -616,10 +680,50 @@ func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesG if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("offset") + if defaultQueryParam == "" { + localVarQueryParams.Add("offset", parameterToString(0, "")) + } + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("limit") + if defaultQueryParam == "" { + localVarQueryParams.Add("limit", parameterToString(1000, "")) + } + } + if r.orderBy != nil { + localVarQueryParams.Add("orderBy", parameterToString(*r.orderBy, "")) + } + if r.maxResults != nil { + localVarQueryParams.Add("maxResults", parameterToString(*r.maxResults, "")) + } + if len(r.filters) > 0 { + for k, v := range r.filters { + for _, iv := range v { + localVarQueryParams.Add(k, iv) + } + } + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -659,13 +763,14 @@ func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesG return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesGet", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesGet", } if err != nil || localVarHTTPResponse == nil { @@ -681,24 +786,26 @@ func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesG if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -707,13 +814,13 @@ func (a *VolumeApiService) DatacentersVolumesGetExecute(r ApiDatacentersVolumesG } type ApiDatacentersVolumesPatchRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - volume *VolumeProperties - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + volume *VolumeProperties + pretty *bool + depth *int32 xContractNumber *int32 } @@ -739,19 +846,19 @@ func (r ApiDatacentersVolumesPatchRequest) Execute() (Volume, *APIResponse, erro } /* - * DatacentersVolumesPatch Partially modify a Volume - * You can use update attributes of a Volume + * DatacentersVolumesPatch Partially modify volumes + * Update the properties of the specified storage volume within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesPatchRequest */ -func (a *VolumeApiService) DatacentersVolumesPatch(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesPatchRequest { +func (a *VolumesApiService) DatacentersVolumesPatch(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesPatchRequest { return ApiDatacentersVolumesPatchRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } @@ -759,7 +866,7 @@ func (a *VolumeApiService) DatacentersVolumesPatch(ctx _context.Context, datacen * Execute executes the request * @return Volume */ -func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolumesPatchRequest) (Volume, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolumesPatchRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -769,7 +876,7 @@ func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolume localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -787,10 +894,21 @@ func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolume if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -832,13 +950,14 @@ func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolume return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesPatch", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesPatch", } if err != nil || localVarHTTPResponse == nil { @@ -854,24 +973,26 @@ func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolume if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -880,12 +1001,12 @@ func (a *VolumeApiService) DatacentersVolumesPatchExecute(r ApiDatacentersVolume } type ApiDatacentersVolumesPostRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volume *Volume - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volume *Volume + pretty *bool + depth *int32 xContractNumber *int32 } @@ -911,16 +1032,16 @@ func (r ApiDatacentersVolumesPostRequest) Execute() (Volume, *APIResponse, error } /* - * DatacentersVolumesPost Create a Volume - * Creates a volume within the datacenter. This will not attach the volume to a server. Please see the Servers section for details on how to attach storage volumes + * DatacentersVolumesPost Create volumes + * Create a storage volume within the specified data center. The volume will not be attached! Attaching volumes is described in the Servers section. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter + * @param datacenterId The unique ID of the data center. * @return ApiDatacentersVolumesPostRequest */ -func (a *VolumeApiService) DatacentersVolumesPost(ctx _context.Context, datacenterId string) ApiDatacentersVolumesPostRequest { +func (a *VolumesApiService) DatacentersVolumesPost(ctx _context.Context, datacenterId string) ApiDatacentersVolumesPostRequest { return ApiDatacentersVolumesPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, } } @@ -929,7 +1050,7 @@ func (a *VolumeApiService) DatacentersVolumesPost(ctx _context.Context, datacent * Execute executes the request * @return Volume */ -func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumesPostRequest) (Volume, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumesPostRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -939,7 +1060,7 @@ func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumes localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesPost") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -956,10 +1077,21 @@ func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumes if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1001,13 +1133,14 @@ func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumes return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesPost", } if err != nil || localVarHTTPResponse == nil { @@ -1023,24 +1156,26 @@ func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumes if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1049,13 +1184,13 @@ func (a *VolumeApiService) DatacentersVolumesPostExecute(r ApiDatacentersVolumes } type ApiDatacentersVolumesPutRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - volume *Volume - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + volume *Volume + pretty *bool + depth *int32 xContractNumber *int32 } @@ -1081,19 +1216,19 @@ func (r ApiDatacentersVolumesPutRequest) Execute() (Volume, *APIResponse, error) } /* - * DatacentersVolumesPut Modify a Volume - * You can use update attributes of a Volume + * DatacentersVolumesPut Modify volumes + * Modify the properties of the specified volume within the data center. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesPutRequest */ -func (a *VolumeApiService) DatacentersVolumesPut(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesPutRequest { +func (a *VolumesApiService) DatacentersVolumesPut(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesPutRequest { return ApiDatacentersVolumesPutRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } @@ -1101,7 +1236,7 @@ func (a *VolumeApiService) DatacentersVolumesPut(ctx _context.Context, datacente * Execute executes the request * @return Volume */ -func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesPutRequest) (Volume, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesPutRequest) (Volume, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1111,7 +1246,7 @@ func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesP localVarReturnValue Volume ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesPut") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } @@ -1129,10 +1264,21 @@ func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesP if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1174,13 +1320,14 @@ func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesP return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesPut", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesPut", } if err != nil || localVarHTTPResponse == nil { @@ -1196,24 +1343,26 @@ func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesP if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v return localVarReturnValue, localVarAPIResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), } return localVarReturnValue, localVarAPIResponse, newErr } @@ -1222,14 +1371,14 @@ func (a *VolumeApiService) DatacentersVolumesPutExecute(r ApiDatacentersVolumesP } type ApiDatacentersVolumesRestoreSnapshotPostRequest struct { - ctx _context.Context - ApiService *VolumeApiService - datacenterId string - volumeId string - pretty *bool - depth *int32 + ctx _context.Context + ApiService *VolumesApiService + datacenterId string + volumeId string + pretty *bool + depth *int32 xContractNumber *int32 - snapshotId *string + snapshotId *string } func (r ApiDatacentersVolumesRestoreSnapshotPostRequest) Pretty(pretty bool) ApiDatacentersVolumesRestoreSnapshotPostRequest { @@ -1249,44 +1398,42 @@ func (r ApiDatacentersVolumesRestoreSnapshotPostRequest) SnapshotId(snapshotId s return r } -func (r ApiDatacentersVolumesRestoreSnapshotPostRequest) Execute() (map[string]interface{}, *APIResponse, error) { +func (r ApiDatacentersVolumesRestoreSnapshotPostRequest) Execute() (*APIResponse, error) { return r.ApiService.DatacentersVolumesRestoreSnapshotPostExecute(r) } /* - * DatacentersVolumesRestoreSnapshotPost Restore Volume Snapshot - * This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create subsequent volumes if you want or to restore an existing volume. + * DatacentersVolumesRestoreSnapshotPost Restore volume snapshots + * Restore a snapshot for the specified volume within the data center. A snapshot is an image of a volume, which can be used to restore this volume at a later time. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param datacenterId The unique ID of the datacenter - * @param volumeId The unique ID of the Volume + * @param datacenterId The unique ID of the data center. + * @param volumeId The unique ID of the volume. * @return ApiDatacentersVolumesRestoreSnapshotPostRequest */ -func (a *VolumeApiService) DatacentersVolumesRestoreSnapshotPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesRestoreSnapshotPostRequest { +func (a *VolumesApiService) DatacentersVolumesRestoreSnapshotPost(ctx _context.Context, datacenterId string, volumeId string) ApiDatacentersVolumesRestoreSnapshotPostRequest { return ApiDatacentersVolumesRestoreSnapshotPostRequest{ - ApiService: a, - ctx: ctx, + ApiService: a, + ctx: ctx, datacenterId: datacenterId, - volumeId: volumeId, + volumeId: volumeId, } } /* * Execute executes the request - * @return map[string]interface{} */ -func (a *VolumeApiService) DatacentersVolumesRestoreSnapshotPostExecute(r ApiDatacentersVolumesRestoreSnapshotPostRequest) (map[string]interface{}, *APIResponse, error) { +func (a *VolumesApiService) DatacentersVolumesRestoreSnapshotPostExecute(r ApiDatacentersVolumesRestoreSnapshotPostRequest) (*APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumeApiService.DatacentersVolumesRestoreSnapshotPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VolumesApiService.DatacentersVolumesRestoreSnapshotPost") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datacenters/{datacenterId}/volumes/{volumeId}/restore-snapshot" @@ -1299,10 +1446,21 @@ func (a *VolumeApiService) DatacentersVolumesRestoreSnapshotPostExecute(r ApiDat if r.pretty != nil { localVarQueryParams.Add("pretty", parameterToString(*r.pretty, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("pretty") + if defaultQueryParam == "" { + localVarQueryParams.Add("pretty", parameterToString(true, "")) + } } if r.depth != nil { localVarQueryParams.Add("depth", parameterToString(*r.depth, "")) + } else { + defaultQueryParam := a.client.cfg.DefaultQueryParams.Get("depth") + if defaultQueryParam == "" { + localVarQueryParams.Add("depth", parameterToString(0, "")) + } } + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1342,52 +1500,45 @@ func (a *VolumeApiService) DatacentersVolumesRestoreSnapshotPostExecute(r ApiDat } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } - localVarHTTPResponse, err := a.client.callAPI(req) + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) - localVarAPIResponse := &APIResponse { - Response: localVarHTTPResponse, - Method: localVarHTTPMethod, - RequestURL: localVarPath, - Operation: "DatacentersVolumesRestoreSnapshotPost", + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestURL: localVarPath, + RequestTime: httpRequestTime, + Operation: "DatacentersVolumesRestoreSnapshotPost", } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarAPIResponse.Payload = localVarBody if err != nil { - return localVarReturnValue, localVarAPIResponse, err + return localVarAPIResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, string(localVarBody)), } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarAPIResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarAPIResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = fmt.Sprintf(FormatStringErr, localVarHTTPResponse.Status, err.Error()) + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, newErr + newErr.model = v + return localVarAPIResponse, newErr } - return localVarReturnValue, localVarAPIResponse, nil + return localVarAPIResponse, nil } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/client.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/client.go index e00f5a227a61..e88d2add264d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/client.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/client.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "bytes" @@ -42,16 +42,21 @@ var ( ) const DepthParam = "depth" -const DefaultDepth = "10" const ( - RequestStatusQueued = "QUEUED" - RequestStatusRunning = "RUNNING" - RequestStatusFailed = "FAILED" - RequestStatusDone = "DONE" + RequestStatusQueued = "QUEUED" + RequestStatusRunning = "RUNNING" + RequestStatusFailed = "FAILED" + RequestStatusDone = "DONE" + + Version = "6.0.2" ) -// APIClient manages communication with the CLOUD API API v5.0 +// Constants for APIs +const FilterQueryParam = "filter.%s" +const FormatStringErr = "%s %s" + +// APIClient manages communication with the CLOUD API API v6.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -59,39 +64,53 @@ type APIClient struct { // API Services - BackupUnitApi *BackupUnitApiService + DefaultApi *DefaultApiService + + BackupUnitsApi *BackupUnitsApiService + + ContractResourcesApi *ContractResourcesApiService - ContractApi *ContractApiService + DataCentersApi *DataCentersApiService - DataCenterApi *DataCenterApiService + FirewallRulesApi *FirewallRulesApiService + + FlowLogsApi *FlowLogsApiService IPBlocksApi *IPBlocksApiService - ImageApi *ImageApiService + ImagesApi *ImagesApiService KubernetesApi *KubernetesApiService - LabelApi *LabelApiService + LANsApi *LANsApiService + + LabelsApi *LabelsApiService + + LoadBalancersApi *LoadBalancersApiService - LanApi *LanApiService + LocationsApi *LocationsApiService - LoadBalancerApi *LoadBalancerApiService + NATGatewaysApi *NATGatewaysApiService - LocationApi *LocationApiService + NetworkInterfacesApi *NetworkInterfacesApiService - NicApi *NicApiService + NetworkLoadBalancersApi *NetworkLoadBalancersApiService - PrivateCrossConnectApi *PrivateCrossConnectApiService + PrivateCrossConnectsApi *PrivateCrossConnectsApiService - RequestApi *RequestApiService + RequestsApi *RequestsApiService - ServerApi *ServerApiService + ServersApi *ServersApiService - SnapshotApi *SnapshotApiService + SnapshotsApi *SnapshotsApiService + + TemplatesApi *TemplatesApiService UserManagementApi *UserManagementApiService - VolumeApi *VolumeApiService + UserS3KeysApi *UserS3KeysApiService + + VolumesApi *VolumesApiService } type service struct { @@ -110,23 +129,30 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.BackupUnitApi = (*BackupUnitApiService)(&c.common) - c.ContractApi = (*ContractApiService)(&c.common) - c.DataCenterApi = (*DataCenterApiService)(&c.common) + c.DefaultApi = (*DefaultApiService)(&c.common) + c.BackupUnitsApi = (*BackupUnitsApiService)(&c.common) + c.ContractResourcesApi = (*ContractResourcesApiService)(&c.common) + c.DataCentersApi = (*DataCentersApiService)(&c.common) + c.FirewallRulesApi = (*FirewallRulesApiService)(&c.common) + c.FlowLogsApi = (*FlowLogsApiService)(&c.common) c.IPBlocksApi = (*IPBlocksApiService)(&c.common) - c.ImageApi = (*ImageApiService)(&c.common) + c.ImagesApi = (*ImagesApiService)(&c.common) c.KubernetesApi = (*KubernetesApiService)(&c.common) - c.LabelApi = (*LabelApiService)(&c.common) - c.LanApi = (*LanApiService)(&c.common) - c.LoadBalancerApi = (*LoadBalancerApiService)(&c.common) - c.LocationApi = (*LocationApiService)(&c.common) - c.NicApi = (*NicApiService)(&c.common) - c.PrivateCrossConnectApi = (*PrivateCrossConnectApiService)(&c.common) - c.RequestApi = (*RequestApiService)(&c.common) - c.ServerApi = (*ServerApiService)(&c.common) - c.SnapshotApi = (*SnapshotApiService)(&c.common) + c.LANsApi = (*LANsApiService)(&c.common) + c.LabelsApi = (*LabelsApiService)(&c.common) + c.LoadBalancersApi = (*LoadBalancersApiService)(&c.common) + c.LocationsApi = (*LocationsApiService)(&c.common) + c.NATGatewaysApi = (*NATGatewaysApiService)(&c.common) + c.NetworkInterfacesApi = (*NetworkInterfacesApiService)(&c.common) + c.NetworkLoadBalancersApi = (*NetworkLoadBalancersApiService)(&c.common) + c.PrivateCrossConnectsApi = (*PrivateCrossConnectsApiService)(&c.common) + c.RequestsApi = (*RequestsApiService)(&c.common) + c.ServersApi = (*ServersApiService)(&c.common) + c.SnapshotsApi = (*SnapshotsApiService)(&c.common) + c.TemplatesApi = (*TemplatesApiService)(&c.common) c.UserManagementApi = (*UserManagementApiService)(&c.common) - c.VolumeApi = (*VolumeApiService)(&c.common) + c.UserS3KeysApi = (*UserS3KeysApiService)(&c.common) + c.VolumesApi = (*VolumesApiService)(&c.common) return c } @@ -216,47 +242,52 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } - // callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { +func (c *APIClient) callAPI(request *http.Request) (*http.Response, time.Duration, error) { retryCount := 0 var resp *http.Response + var httpRequestTime time.Duration var err error for { - retryCount ++ + retryCount++ /* we need to clone the request with every retry time because Body closes after the request */ var clonedRequest *http.Request = request.Clone(request.Context()) if request.Body != nil { clonedRequest.Body, err = request.GetBody() if err != nil { - return nil, err + return nil, httpRequestTime, err } } if c.cfg.Debug { dump, err := httputil.DumpRequestOut(clonedRequest, true) - if err != nil { - return nil, err + if err == nil { + log.Printf(" [DEBUG] DumpRequestOut : %s\n", string(dump)) + } else { + log.Println("[DEBUG] DumpRequestOut err: ", err) } - log.Printf("\ntry no: %d\n", retryCount) - log.Printf("%s\n", string(dump)) + log.Printf("\n try no: %d\n", retryCount) } + httpRequestStartTime := time.Now() + clonedRequest.Close = true resp, err = c.cfg.HTTPClient.Do(clonedRequest) + httpRequestTime = time.Since(httpRequestStartTime) if err != nil { - return resp, err + return resp, httpRequestTime, err } if c.cfg.Debug { dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err + if err == nil { + log.Printf("\n [DEBUG] DumpResponse : %s\n", string(dump)) + } else { + log.Println("[DEBUG] DumpResponse err ", err) } - log.Printf("\n%s\n", string(dump)) } var backoffTime time.Duration @@ -271,20 +302,20 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if retryAfterSeconds := resp.Header.Get("Retry-After"); retryAfterSeconds != "" { waitTime, err := time.ParseDuration(retryAfterSeconds + "s") if err != nil { - return resp, err + return resp, httpRequestTime, err } backoffTime = waitTime } else { backoffTime = c.GetConfig().WaitTime } default: - return resp, err + return resp, httpRequestTime, err } if retryCount >= c.GetConfig().MaxRetries { if c.cfg.Debug { - fmt.Printf("number of maximum retries exceeded (%d retries)\n", c.cfg.MaxRetries) + log.Printf("number of maximum retries exceeded (%d retries)\n", c.cfg.MaxRetries) } break } else { @@ -292,7 +323,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } } - return resp, err + return resp, httpRequestTime, err } func (c *APIClient) backOff(t time.Duration) { @@ -300,7 +331,7 @@ func (c *APIClient) backOff(t time.Duration) { t = c.GetConfig().MaxWaitTime } if c.cfg.Debug { - fmt.Printf("sleeping %s before retrying request\n", t.String()) + log.Printf("sleeping %s before retrying request\n", t.String()) } time.Sleep(t) } @@ -409,23 +440,17 @@ func (c *APIClient) prepareRequest( // Adding Query Param query := url.Query() /* adding default query params */ - for k, v := range c.cfg.DefaultQueryParams { - if _, ok := queryParams[k]; !ok { - queryParams[k] = v - } - } + for k, v := range c.cfg.DefaultQueryParams { + if _, ok := queryParams[k]; !ok { + queryParams[k] = v + } + } for k, v := range queryParams { for _, iv := range v { query.Add(k, iv) } } - // Adding default depth if needed - if query.Get(DepthParam) == "" { - query.Add(DepthParam, DefaultDepth) - } - - // Encode the parameters. url.RawQuery = query.Encode() @@ -451,13 +476,13 @@ func (c *APIClient) prepareRequest( // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - if c.cfg.Token != "" { - localVarRequest.Header.Add("Authorization", "Bearer " + c.cfg.Token) - } else { - if c.cfg.Username != "" { - localVarRequest.SetBasicAuth(c.cfg.Username, c.cfg.Password) - } - } + if c.cfg.Token != "" { + localVarRequest.Header.Add("Authorization", "Bearer "+c.cfg.Token) + } else { + if c.cfg.Username != "" { + localVarRequest.SetBasicAuth(c.cfg.Username, c.cfg.Password) + } + } if ctx != nil { // add context to the request @@ -509,22 +534,65 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err!= nil { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { return err } } else { - errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + return errors.New("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") } } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil } - return errors.New("undefined response type") + return fmt.Errorf("undefined response type for content %s", contentType) } +func (c *APIClient) GetRequestStatus(ctx context.Context, path string) (*RequestStatus, *APIResponse, error) { + + r, err := c.prepareRequest(ctx, path, http.MethodGet, nil, nil, nil, nil, "", "", nil) + if err != nil { + return nil, nil, err + } + + resp, httpRequestTime, err := c.callAPI(r) + + var responseBody = make([]byte, 0) + if resp != nil { + var errRead error + responseBody, errRead = ioutil.ReadAll(resp.Body) + _ = resp.Body.Close() + if errRead != nil { + return nil, nil, errRead + } + + } + + apiResponse := &APIResponse{ + Response: resp, + Method: http.MethodGet, + RequestTime: httpRequestTime, + RequestURL: path, + Operation: "GetRequestStatus", + } + + apiResponse.Payload = responseBody + + if err != nil { + return nil, apiResponse, err + } + + status := &RequestStatus{} + err = c.decode(status, responseBody, resp.Header.Get("Content-Type")) + if err != nil { + return nil, apiResponse, err + } + + return status, apiResponse, nil + +} func (c *APIClient) WaitForRequest(ctx context.Context, path string) (*APIResponse, error) { @@ -549,7 +617,7 @@ func (c *APIClient) WaitForRequest(ctx context.Context, path string) (*APIRespon ticker := time.NewTicker(1 * time.Second) defer ticker.Stop() for { - resp, err := c.callAPI(r) + resp, httpRequestTime, err := c.callAPI(r) var localVarBody = make([]byte, 0) if resp != nil { @@ -562,11 +630,12 @@ func (c *APIClient) WaitForRequest(ctx context.Context, path string) (*APIRespon } - localVarAPIResponse := &APIResponse { - Response: resp, - Method: localVarHTTPMethod, - RequestURL: path, - Operation: "WaitForRequest", + localVarAPIResponse := &APIResponse{ + Response: resp, + Method: localVarHTTPMethod, + RequestTime: httpRequestTime, + RequestURL: path, + Operation: "WaitForRequest", } localVarAPIResponse.Payload = localVarBody @@ -577,6 +646,13 @@ func (c *APIClient) WaitForRequest(ctx context.Context, path string) (*APIRespon status := RequestStatus{} err = c.decode(&status, localVarBody, resp.Header.Get("Content-Type")) + if err != nil { + return localVarAPIResponse, err + } + + if resp.StatusCode != http.StatusOK { + return localVarAPIResponse, fmt.Errorf("WaitForRequest failed; received status code %d from API", resp.StatusCode) + } if status.Metadata != nil && status.Metadata.Status != nil { switch *status.Metadata.Status { case RequestStatusDone: @@ -734,9 +810,10 @@ func strlen(s string) int { // GenericOpenAPIError Provides access to the body, error and model on returned errors. type GenericOpenAPIError struct { - body []byte - error string - model interface{} + statusCode int + body []byte + error string + model interface{} } // Error returns non-empty string if there was an error. @@ -753,3 +830,7 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +func (e GenericOpenAPIError) StatusCode() int { + return e.statusCode +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/configuration.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/configuration.go index 0de593f9690d..f3ee9461773e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/configuration.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/configuration.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "context" @@ -16,17 +16,21 @@ import ( "net/http" "net/url" "os" + "strconv" "strings" "time" ) const ( - IonosUsernameEnvVar = "IONOS_USERNAME" - IonosPasswordEnvVar = "IONOS_PASSWORD" - IonosTokenEnvVar = "IONOS_TOKEN" - defaultMaxRetries = 3 - defaultWaitTime = time.Duration(100) * time.Millisecond - defaultMaxWaitTime = time.Duration(2000) * time.Millisecond + IonosUsernameEnvVar = "IONOS_USERNAME" + IonosPasswordEnvVar = "IONOS_PASSWORD" + IonosTokenEnvVar = "IONOS_TOKEN" + IonosApiUrlEnvVar = "IONOS_API_URL" + DefaultIonosServerUrl = "https://api.ionos.com/cloudapi/v6" + DefaultIonosBasePath = "/cloudapi/v6" + defaultMaxRetries = 3 + defaultWaitTime = time.Duration(100) * time.Millisecond + defaultMaxWaitTime = time.Duration(2000) * time.Millisecond ) // contextKeys are used to identify the type of value in the context. @@ -89,9 +93,9 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - URL string + URL string Description string - Variables map[string]ServerVariable + Variables map[string]ServerVariable } // ServerConfigurations stores multiple ServerConfiguration items @@ -99,50 +103,54 @@ 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 - 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"` + 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 + 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 string, password string, token string) *Configuration { +func NewConfiguration(username, password, token, hostUrl string) *Configuration { cfg := &Configuration{ - DefaultHeader: make(map[string]string), + DefaultHeader: make(map[string]string), DefaultQueryParams: url.Values{}, - UserAgent: "ionos-cloud-sdk-go/v5", - Debug: false, - Username: username, - Password: password, - Token: token, - MaxRetries: defaultMaxRetries, - MaxWaitTime: defaultMaxWaitTime, - WaitTime: defaultWaitTime, - Servers: ServerConfigurations{ + UserAgent: "ionos-cloud-sdk-go/v6.0.2", + Debug: false, + Username: username, + Password: password, + Token: token, + MaxRetries: defaultMaxRetries, + MaxWaitTime: defaultMaxWaitTime, + WaitTime: defaultWaitTime, + Servers: ServerConfigurations{ { - URL: "https://api.ionos.com/cloudapi/v5", + URL: getServerUrl(hostUrl), Description: "No description provided", }, }, - OperationServers: map[string]ServerConfigurations{ - }, + OperationServers: map[string]ServerConfigurations{}, } return cfg } func NewConfigurationFromEnv() *Configuration { - return NewConfiguration(os.Getenv(IonosUsernameEnvVar), os.Getenv(IonosPasswordEnvVar), os.Getenv(IonosTokenEnvVar)) + return NewConfiguration(os.Getenv(IonosUsernameEnvVar), os.Getenv(IonosPasswordEnvVar), os.Getenv(IonosTokenEnvVar), os.Getenv(IonosApiUrlEnvVar)) +} + +// SetDepth sets the depth query param for all the requests +func (c *Configuration) SetDepth(depth int32) { + c.DefaultQueryParams["depth"] = []string{strconv.Itoa(int(depth))} } // AddDefaultHeader adds a new HTTP header to the default header in the request @@ -151,11 +159,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { } func (c *Configuration) AddDefaultQueryParam(key string, value string) { - if _, ok := c.DefaultQueryParams[key]; ok { - c.DefaultQueryParams[key] = append(c.DefaultQueryParams[key], value) - } else { - c.DefaultQueryParams[key] = []string{value} - } + c.DefaultQueryParams[key] = []string{value} } // URL formats template on a index using given variables @@ -243,6 +247,19 @@ func getServerOperationVariables(ctx context.Context, endpoint string) (map[stri return getServerVariables(ctx) } +func getServerUrl(serverUrl string) string { + if serverUrl == "" { + return DefaultIonosServerUrl + } + 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] diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_attached_volumes.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_attached_volumes.go index b0ef52a0e039..ed03aea6907f 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_attached_volumes.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_attached_volumes.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // AttachedVolumes struct for AttachedVolumes type AttachedVolumes struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Volume `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewAttachedVolumes instantiates a new AttachedVolumes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAttachedVolumes() *AttachedVolumes { + this := AttachedVolumes{} + return &this +} + +// NewAttachedVolumesWithDefaults instantiates a new AttachedVolumes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAttachedVolumesWithDefaults() *AttachedVolumes { + this := AttachedVolumes{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *AttachedVolumes) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *AttachedVolumes) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *AttachedVolumes) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *AttachedVolumes) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *AttachedVolumes) GetType() *Type { @@ -72,6 +95,7 @@ func (o *AttachedVolumes) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *AttachedVolumes) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *AttachedVolumes) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *AttachedVolumes) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *AttachedVolumes) GetHref() *string { @@ -108,6 +133,7 @@ func (o *AttachedVolumes) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *AttachedVolumes) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *AttachedVolumes) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *AttachedVolumes) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Volume will be returned func (o *AttachedVolumes) GetItems() *[]Volume { @@ -144,6 +171,7 @@ func (o *AttachedVolumes) GetItems() *[]Volume { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *AttachedVolumes) GetItemsOk() (*[]Volume, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *AttachedVolumes) SetItems(v []Volume) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *AttachedVolumes) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *AttachedVolumes) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AttachedVolumes) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *AttachedVolumes) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *AttachedVolumes) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *AttachedVolumes) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AttachedVolumes) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *AttachedVolumes) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *AttachedVolumes) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *AttachedVolumes) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AttachedVolumes) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *AttachedVolumes) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *AttachedVolumes) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o AttachedVolumes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableAttachedVolumes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit.go index 550ca9b1e584..bc9197db9535 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // BackupUnit struct for BackupUnit type BackupUnit struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *BackupUnitProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *BackupUnitProperties `json:"properties"` } +// NewBackupUnit instantiates a new BackupUnit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupUnit(properties BackupUnitProperties) *BackupUnit { + this := BackupUnit{} + this.Properties = &properties + + return &this +} + +// NewBackupUnitWithDefaults instantiates a new BackupUnit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupUnitWithDefaults() *BackupUnit { + this := BackupUnit{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *BackupUnit) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *BackupUnit) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *BackupUnit) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *BackupUnit) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnit) GetType() *string { @@ -72,6 +92,7 @@ func (o *BackupUnit) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *BackupUnit) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *BackupUnit) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *BackupUnit) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnit) GetHref() *string { @@ -108,6 +130,7 @@ func (o *BackupUnit) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *BackupUnit) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *BackupUnit) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *BackupUnit) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *BackupUnit) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *BackupUnit) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *BackupUnit) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *BackupUnit) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *BackupUnit) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for BackupUnitProperties will be returned func (o *BackupUnit) GetProperties() *BackupUnitProperties { @@ -180,6 +206,7 @@ func (o *BackupUnit) GetProperties() *BackupUnitProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *BackupUnit) GetPropertiesOk() (*BackupUnitProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *BackupUnit) SetProperties(v BackupUnitProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *BackupUnit) HasProperties() bool { return false } - func (o BackupUnit) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableBackupUnit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_properties.go index 4428de8b09ad..45b5584e28ba 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,15 +16,33 @@ import ( // BackupUnitProperties struct for BackupUnitProperties type BackupUnitProperties struct { - // A name of that resource (only alphanumeric characters are acceptable) + // The name of the resource (alphanumeric characters only). Name *string `json:"name"` - // the password associated to that resource + // The password associated with that resource. Password *string `json:"password,omitempty"` // The email associated with the backup unit. Bear in mind that this email does not be the same email as of the user. Email *string `json:"email,omitempty"` } +// NewBackupUnitProperties instantiates a new BackupUnitProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupUnitProperties(name string) *BackupUnitProperties { + this := BackupUnitProperties{} + this.Name = &name + + return &this +} + +// NewBackupUnitPropertiesWithDefaults instantiates a new BackupUnitProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupUnitPropertiesWithDefaults() *BackupUnitProperties { + this := BackupUnitProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +52,7 @@ func (o *BackupUnitProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -43,12 +62,15 @@ func (o *BackupUnitProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *BackupUnitProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -60,8 +82,6 @@ func (o *BackupUnitProperties) HasName() bool { return false } - - // GetPassword returns the Password field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnitProperties) GetPassword() *string { @@ -70,6 +90,7 @@ func (o *BackupUnitProperties) GetPassword() *string { } return o.Password + } // GetPasswordOk returns a tuple with the Password field value @@ -79,12 +100,15 @@ func (o *BackupUnitProperties) GetPasswordOk() (*string, bool) { if o == nil { return nil, false } + return o.Password, true } // SetPassword sets field value func (o *BackupUnitProperties) SetPassword(v string) { + o.Password = &v + } // HasPassword returns a boolean if a field has been set. @@ -96,8 +120,6 @@ func (o *BackupUnitProperties) HasPassword() bool { return false } - - // GetEmail returns the Email field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnitProperties) GetEmail() *string { @@ -106,6 +128,7 @@ func (o *BackupUnitProperties) GetEmail() *string { } return o.Email + } // GetEmailOk returns a tuple with the Email field value @@ -115,12 +138,15 @@ func (o *BackupUnitProperties) GetEmailOk() (*string, bool) { if o == nil { return nil, false } + return o.Email, true } // SetEmail sets field value func (o *BackupUnitProperties) SetEmail(v string) { + o.Email = &v + } // HasEmail returns a boolean if a field has been set. @@ -132,24 +158,17 @@ func (o *BackupUnitProperties) HasEmail() bool { return false } - func (o BackupUnitProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Password != nil { toSerialize["password"] = o.Password } - - if o.Email != nil { toSerialize["email"] = o.Email } - return json.Marshal(toSerialize) } @@ -188,5 +207,3 @@ func (v *NullableBackupUnitProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_sso.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_sso.go index ef5355665799..f493bf950c8d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_sso.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_unit_sso.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -20,7 +20,23 @@ type BackupUnitSSO struct { SsoUrl *string `json:"ssoUrl,omitempty"` } +// NewBackupUnitSSO instantiates a new BackupUnitSSO object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupUnitSSO() *BackupUnitSSO { + this := BackupUnitSSO{} + return &this +} + +// NewBackupUnitSSOWithDefaults instantiates a new BackupUnitSSO object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupUnitSSOWithDefaults() *BackupUnitSSO { + this := BackupUnitSSO{} + return &this +} // GetSsoUrl returns the SsoUrl field value // If the value is explicit nil, the zero value for string will be returned @@ -30,6 +46,7 @@ func (o *BackupUnitSSO) GetSsoUrl() *string { } return o.SsoUrl + } // GetSsoUrlOk returns a tuple with the SsoUrl field value @@ -39,12 +56,15 @@ func (o *BackupUnitSSO) GetSsoUrlOk() (*string, bool) { if o == nil { return nil, false } + return o.SsoUrl, true } // SetSsoUrl sets field value func (o *BackupUnitSSO) SetSsoUrl(v string) { + o.SsoUrl = &v + } // HasSsoUrl returns a boolean if a field has been set. @@ -56,14 +76,11 @@ func (o *BackupUnitSSO) HasSsoUrl() bool { return false } - func (o BackupUnitSSO) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SsoUrl != nil { toSerialize["ssoUrl"] = o.SsoUrl } - return json.Marshal(toSerialize) } @@ -102,5 +119,3 @@ func (v *NullableBackupUnitSSO) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_units.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_units.go index 44be5b692dbc..6023f94e15ab 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_units.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_backup_units.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // BackupUnits struct for BackupUnits type BackupUnits struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]BackupUnit `json:"items,omitempty"` } +// NewBackupUnits instantiates a new BackupUnits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupUnits() *BackupUnits { + this := BackupUnits{} + return &this +} + +// NewBackupUnitsWithDefaults instantiates a new BackupUnits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupUnitsWithDefaults() *BackupUnits { + this := BackupUnits{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *BackupUnits) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *BackupUnits) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *BackupUnits) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *BackupUnits) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnits) GetType() *string { @@ -72,6 +90,7 @@ func (o *BackupUnits) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *BackupUnits) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *BackupUnits) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *BackupUnits) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *BackupUnits) GetHref() *string { @@ -108,6 +128,7 @@ func (o *BackupUnits) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *BackupUnits) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *BackupUnits) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *BackupUnits) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []BackupUnit will be returned func (o *BackupUnits) GetItems() *[]BackupUnit { @@ -144,6 +166,7 @@ func (o *BackupUnits) GetItems() *[]BackupUnit { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *BackupUnits) GetItemsOk() (*[]BackupUnit, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *BackupUnits) SetItems(v []BackupUnit) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *BackupUnits) HasItems() bool { return false } - func (o BackupUnits) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableBackupUnits) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_balanced_nics.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_balanced_nics.go index f3ecbfec7b22..feef17f6267c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_balanced_nics.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_balanced_nics.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // BalancedNics struct for BalancedNics type BalancedNics struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Nic `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewBalancedNics instantiates a new BalancedNics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBalancedNics() *BalancedNics { + this := BalancedNics{} + return &this +} + +// NewBalancedNicsWithDefaults instantiates a new BalancedNics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBalancedNicsWithDefaults() *BalancedNics { + this := BalancedNics{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *BalancedNics) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *BalancedNics) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *BalancedNics) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *BalancedNics) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *BalancedNics) GetType() *Type { @@ -72,6 +95,7 @@ func (o *BalancedNics) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *BalancedNics) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *BalancedNics) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *BalancedNics) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *BalancedNics) GetHref() *string { @@ -108,6 +133,7 @@ func (o *BalancedNics) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *BalancedNics) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *BalancedNics) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *BalancedNics) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Nic will be returned func (o *BalancedNics) GetItems() *[]Nic { @@ -144,6 +171,7 @@ func (o *BalancedNics) GetItems() *[]Nic { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *BalancedNics) GetItemsOk() (*[]Nic, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *BalancedNics) SetItems(v []Nic) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *BalancedNics) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *BalancedNics) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BalancedNics) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *BalancedNics) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *BalancedNics) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *BalancedNics) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BalancedNics) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *BalancedNics) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *BalancedNics) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *BalancedNics) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BalancedNics) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *BalancedNics) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *BalancedNics) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o BalancedNics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableBalancedNics) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cdroms.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cdroms.go index 1cad3fb128eb..4d2bb9a85364 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cdroms.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cdroms.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Cdroms struct for Cdroms type Cdroms struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Image `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewCdroms instantiates a new Cdroms object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCdroms() *Cdroms { + this := Cdroms{} + return &this +} + +// NewCdromsWithDefaults instantiates a new Cdroms object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCdromsWithDefaults() *Cdroms { + this := Cdroms{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Cdroms) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Cdroms) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Cdroms) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Cdroms) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Cdroms) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Cdroms) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Cdroms) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Cdroms) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Cdroms) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Cdroms) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Cdroms) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Cdroms) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Cdroms) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Cdroms) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Image will be returned func (o *Cdroms) GetItems() *[]Image { @@ -144,6 +171,7 @@ func (o *Cdroms) GetItems() *[]Image { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Cdroms) GetItemsOk() (*[]Image, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Cdroms) SetItems(v []Image) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Cdroms) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Cdroms) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cdroms) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Cdroms) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Cdroms) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Cdroms) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cdroms) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Cdroms) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Cdroms) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Cdroms) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cdroms) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Cdroms) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Cdroms) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Cdroms) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableCdroms) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_connectable_datacenter.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_connectable_datacenter.go index 4a62657d79a0..6b8a5f4cd818 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_connectable_datacenter.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_connectable_datacenter.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,12 +16,28 @@ import ( // ConnectableDatacenter struct for ConnectableDatacenter type ConnectableDatacenter struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` Location *string `json:"location,omitempty"` } +// NewConnectableDatacenter instantiates a new ConnectableDatacenter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectableDatacenter() *ConnectableDatacenter { + this := ConnectableDatacenter{} + return &this +} + +// NewConnectableDatacenterWithDefaults instantiates a new ConnectableDatacenter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectableDatacenterWithDefaults() *ConnectableDatacenter { + this := ConnectableDatacenter{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -31,6 +47,7 @@ func (o *ConnectableDatacenter) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -40,12 +57,15 @@ func (o *ConnectableDatacenter) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *ConnectableDatacenter) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -57,8 +77,6 @@ func (o *ConnectableDatacenter) HasId() bool { return false } - - // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned func (o *ConnectableDatacenter) GetName() *string { @@ -67,6 +85,7 @@ func (o *ConnectableDatacenter) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -76,12 +95,15 @@ func (o *ConnectableDatacenter) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *ConnectableDatacenter) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -93,8 +115,6 @@ func (o *ConnectableDatacenter) HasName() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *ConnectableDatacenter) GetLocation() *string { @@ -103,6 +123,7 @@ func (o *ConnectableDatacenter) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -112,12 +133,15 @@ func (o *ConnectableDatacenter) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *ConnectableDatacenter) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -129,24 +153,17 @@ func (o *ConnectableDatacenter) HasLocation() bool { return false } - func (o ConnectableDatacenter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Location != nil { toSerialize["location"] = o.Location } - return json.Marshal(toSerialize) } @@ -185,5 +202,3 @@ func (v *NullableConnectableDatacenter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract.go index 09f8fc5d970e..e1e05792e978 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,12 +16,30 @@ import ( // Contract struct for Contract type Contract struct { - // The type of the resource - Type *Type `json:"type,omitempty"` + // The type of the resource. + Type *Type `json:"type,omitempty"` Properties *ContractProperties `json:"properties"` } +// NewContract instantiates a new Contract object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContract(properties ContractProperties) *Contract { + this := Contract{} + this.Properties = &properties + + return &this +} + +// NewContractWithDefaults instantiates a new Contract object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractWithDefaults() *Contract { + this := Contract{} + return &this +} // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned @@ -31,6 +49,7 @@ func (o *Contract) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -40,12 +59,15 @@ func (o *Contract) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Contract) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -57,8 +79,6 @@ func (o *Contract) HasType() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for ContractProperties will be returned func (o *Contract) GetProperties() *ContractProperties { @@ -67,6 +87,7 @@ func (o *Contract) GetProperties() *ContractProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -76,12 +97,15 @@ func (o *Contract) GetPropertiesOk() (*ContractProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Contract) SetProperties(v ContractProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -93,19 +117,14 @@ func (o *Contract) HasProperties() bool { return false } - func (o Contract) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -144,5 +163,3 @@ func (v *NullableContract) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract_properties.go index 9783db40cd88..a888e074f158 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contract_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,34 @@ import ( // ContractProperties struct for ContractProperties type ContractProperties struct { - // contract number + // The contract number. ContractNumber *int64 `json:"contractNumber,omitempty"` - // owner of the contract + // The owner of the contract. Owner *string `json:"owner,omitempty"` - // status of the contract + // The status of the contract. Status *string `json:"status,omitempty"` - // Registration domain of the contract - RegDomain *string `json:"regDomain,omitempty"` + // The registration domain of the contract. + RegDomain *string `json:"regDomain,omitempty"` ResourceLimits *ResourceLimits `json:"resourceLimits,omitempty"` } +// NewContractProperties instantiates a new ContractProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractProperties() *ContractProperties { + this := ContractProperties{} + return &this +} + +// NewContractPropertiesWithDefaults instantiates a new ContractProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractPropertiesWithDefaults() *ContractProperties { + this := ContractProperties{} + return &this +} // GetContractNumber returns the ContractNumber field value // If the value is explicit nil, the zero value for int64 will be returned @@ -37,6 +53,7 @@ func (o *ContractProperties) GetContractNumber() *int64 { } return o.ContractNumber + } // GetContractNumberOk returns a tuple with the ContractNumber field value @@ -46,12 +63,15 @@ func (o *ContractProperties) GetContractNumberOk() (*int64, bool) { if o == nil { return nil, false } + return o.ContractNumber, true } // SetContractNumber sets field value func (o *ContractProperties) SetContractNumber(v int64) { + o.ContractNumber = &v + } // HasContractNumber returns a boolean if a field has been set. @@ -63,8 +83,6 @@ func (o *ContractProperties) HasContractNumber() bool { return false } - - // GetOwner returns the Owner field value // If the value is explicit nil, the zero value for string will be returned func (o *ContractProperties) GetOwner() *string { @@ -73,6 +91,7 @@ func (o *ContractProperties) GetOwner() *string { } return o.Owner + } // GetOwnerOk returns a tuple with the Owner field value @@ -82,12 +101,15 @@ func (o *ContractProperties) GetOwnerOk() (*string, bool) { if o == nil { return nil, false } + return o.Owner, true } // SetOwner sets field value func (o *ContractProperties) SetOwner(v string) { + o.Owner = &v + } // HasOwner returns a boolean if a field has been set. @@ -99,8 +121,6 @@ func (o *ContractProperties) HasOwner() bool { return false } - - // GetStatus returns the Status field value // If the value is explicit nil, the zero value for string will be returned func (o *ContractProperties) GetStatus() *string { @@ -109,6 +129,7 @@ func (o *ContractProperties) GetStatus() *string { } return o.Status + } // GetStatusOk returns a tuple with the Status field value @@ -118,12 +139,15 @@ func (o *ContractProperties) GetStatusOk() (*string, bool) { if o == nil { return nil, false } + return o.Status, true } // SetStatus sets field value func (o *ContractProperties) SetStatus(v string) { + o.Status = &v + } // HasStatus returns a boolean if a field has been set. @@ -135,8 +159,6 @@ func (o *ContractProperties) HasStatus() bool { return false } - - // GetRegDomain returns the RegDomain field value // If the value is explicit nil, the zero value for string will be returned func (o *ContractProperties) GetRegDomain() *string { @@ -145,6 +167,7 @@ func (o *ContractProperties) GetRegDomain() *string { } return o.RegDomain + } // GetRegDomainOk returns a tuple with the RegDomain field value @@ -154,12 +177,15 @@ func (o *ContractProperties) GetRegDomainOk() (*string, bool) { if o == nil { return nil, false } + return o.RegDomain, true } // SetRegDomain sets field value func (o *ContractProperties) SetRegDomain(v string) { + o.RegDomain = &v + } // HasRegDomain returns a boolean if a field has been set. @@ -171,8 +197,6 @@ func (o *ContractProperties) HasRegDomain() bool { return false } - - // GetResourceLimits returns the ResourceLimits field value // If the value is explicit nil, the zero value for ResourceLimits will be returned func (o *ContractProperties) GetResourceLimits() *ResourceLimits { @@ -181,6 +205,7 @@ func (o *ContractProperties) GetResourceLimits() *ResourceLimits { } return o.ResourceLimits + } // GetResourceLimitsOk returns a tuple with the ResourceLimits field value @@ -190,12 +215,15 @@ func (o *ContractProperties) GetResourceLimitsOk() (*ResourceLimits, bool) { if o == nil { return nil, false } + return o.ResourceLimits, true } // SetResourceLimits sets field value func (o *ContractProperties) SetResourceLimits(v ResourceLimits) { + o.ResourceLimits = &v + } // HasResourceLimits returns a boolean if a field has been set. @@ -207,34 +235,23 @@ func (o *ContractProperties) HasResourceLimits() bool { return false } - func (o ContractProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ContractNumber != nil { toSerialize["contractNumber"] = o.ContractNumber } - - if o.Owner != nil { toSerialize["owner"] = o.Owner } - - if o.Status != nil { toSerialize["status"] = o.Status } - - if o.RegDomain != nil { toSerialize["regDomain"] = o.RegDomain } - - if o.ResourceLimits != nil { toSerialize["resourceLimits"] = o.ResourceLimits } - return json.Marshal(toSerialize) } @@ -273,5 +290,3 @@ func (v *NullableContractProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contracts.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contracts.go new file mode 100644 index 000000000000..5695f722762f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_contracts.go @@ -0,0 +1,250 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Contracts struct for Contracts +type Contracts struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]Contract `json:"items,omitempty"` +} + +// NewContracts instantiates a new Contracts object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContracts() *Contracts { + this := Contracts{} + + return &this +} + +// NewContractsWithDefaults instantiates a new Contracts object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractsWithDefaults() *Contracts { + this := Contracts{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Contracts) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contracts) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *Contracts) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *Contracts) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *Contracts) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contracts) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *Contracts) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *Contracts) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Contracts) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contracts) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *Contracts) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *Contracts) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []Contract will be returned +func (o *Contracts) GetItems() *[]Contract { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *Contracts) GetItemsOk() (*[]Contract, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *Contracts) SetItems(v []Contract) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *Contracts) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o Contracts) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + return json.Marshal(toSerialize) +} + +type NullableContracts struct { + value *Contracts + isSet bool +} + +func (v NullableContracts) Get() *Contracts { + return v.value +} + +func (v *NullableContracts) Set(val *Contracts) { + v.value = val + v.isSet = true +} + +func (v NullableContracts) IsSet() bool { + return v.isSet +} + +func (v *NullableContracts) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContracts(val *Contracts) *NullableContracts { + return &NullableContracts{value: val, isSet: true} +} + +func (v NullableContracts) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContracts) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cpu_architecture_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cpu_architecture_properties.go new file mode 100644 index 000000000000..80c6b6c24114 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_cpu_architecture_properties.go @@ -0,0 +1,250 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// CpuArchitectureProperties struct for CpuArchitectureProperties +type CpuArchitectureProperties struct { + // A valid CPU family name. + CpuFamily *string `json:"cpuFamily,omitempty"` + // The maximum number of cores available. + MaxCores *int32 `json:"maxCores,omitempty"` + // The maximum RAM size in MB. + MaxRam *int32 `json:"maxRam,omitempty"` + // A valid CPU vendor name. + Vendor *string `json:"vendor,omitempty"` +} + +// NewCpuArchitectureProperties instantiates a new CpuArchitectureProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCpuArchitectureProperties() *CpuArchitectureProperties { + this := CpuArchitectureProperties{} + + return &this +} + +// NewCpuArchitecturePropertiesWithDefaults instantiates a new CpuArchitectureProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCpuArchitecturePropertiesWithDefaults() *CpuArchitectureProperties { + this := CpuArchitectureProperties{} + return &this +} + +// GetCpuFamily returns the CpuFamily field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CpuArchitectureProperties) GetCpuFamily() *string { + if o == nil { + return nil + } + + return o.CpuFamily + +} + +// GetCpuFamilyOk returns a tuple with the CpuFamily 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 *CpuArchitectureProperties) GetCpuFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CpuFamily, true +} + +// SetCpuFamily sets field value +func (o *CpuArchitectureProperties) SetCpuFamily(v string) { + + o.CpuFamily = &v + +} + +// HasCpuFamily returns a boolean if a field has been set. +func (o *CpuArchitectureProperties) HasCpuFamily() bool { + if o != nil && o.CpuFamily != nil { + return true + } + + return false +} + +// GetMaxCores returns the MaxCores field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *CpuArchitectureProperties) GetMaxCores() *int32 { + if o == nil { + return nil + } + + return o.MaxCores + +} + +// GetMaxCoresOk returns a tuple with the MaxCores 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 *CpuArchitectureProperties) GetMaxCoresOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.MaxCores, true +} + +// SetMaxCores sets field value +func (o *CpuArchitectureProperties) SetMaxCores(v int32) { + + o.MaxCores = &v + +} + +// HasMaxCores returns a boolean if a field has been set. +func (o *CpuArchitectureProperties) HasMaxCores() bool { + if o != nil && o.MaxCores != nil { + return true + } + + return false +} + +// GetMaxRam returns the MaxRam field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *CpuArchitectureProperties) GetMaxRam() *int32 { + if o == nil { + return nil + } + + return o.MaxRam + +} + +// GetMaxRamOk returns a tuple with the MaxRam 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 *CpuArchitectureProperties) GetMaxRamOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.MaxRam, true +} + +// SetMaxRam sets field value +func (o *CpuArchitectureProperties) SetMaxRam(v int32) { + + o.MaxRam = &v + +} + +// HasMaxRam returns a boolean if a field has been set. +func (o *CpuArchitectureProperties) HasMaxRam() bool { + if o != nil && o.MaxRam != nil { + return true + } + + return false +} + +// GetVendor returns the Vendor field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CpuArchitectureProperties) GetVendor() *string { + if o == nil { + return nil + } + + return o.Vendor + +} + +// GetVendorOk returns a tuple with the Vendor 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 *CpuArchitectureProperties) GetVendorOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Vendor, true +} + +// SetVendor sets field value +func (o *CpuArchitectureProperties) SetVendor(v string) { + + o.Vendor = &v + +} + +// HasVendor returns a boolean if a field has been set. +func (o *CpuArchitectureProperties) HasVendor() bool { + if o != nil && o.Vendor != nil { + return true + } + + return false +} + +func (o CpuArchitectureProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CpuFamily != nil { + toSerialize["cpuFamily"] = o.CpuFamily + } + if o.MaxCores != nil { + toSerialize["maxCores"] = o.MaxCores + } + if o.MaxRam != nil { + toSerialize["maxRam"] = o.MaxRam + } + if o.Vendor != nil { + toSerialize["vendor"] = o.Vendor + } + return json.Marshal(toSerialize) +} + +type NullableCpuArchitectureProperties struct { + value *CpuArchitectureProperties + isSet bool +} + +func (v NullableCpuArchitectureProperties) Get() *CpuArchitectureProperties { + return v.value +} + +func (v *NullableCpuArchitectureProperties) Set(val *CpuArchitectureProperties) { + v.value = val + v.isSet = true +} + +func (v NullableCpuArchitectureProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableCpuArchitectureProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCpuArchitectureProperties(val *CpuArchitectureProperties) *NullableCpuArchitectureProperties { + return &NullableCpuArchitectureProperties{value: val, isSet: true} +} + +func (v NullableCpuArchitectureProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCpuArchitectureProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_data_center_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_data_center_entities.go new file mode 100644 index 000000000000..65fa3ee3d1db --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_data_center_entities.go @@ -0,0 +1,330 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// DataCenterEntities struct for DataCenterEntities +type DataCenterEntities struct { + Servers *Servers `json:"servers,omitempty"` + Volumes *Volumes `json:"volumes,omitempty"` + Loadbalancers *Loadbalancers `json:"loadbalancers,omitempty"` + Lans *Lans `json:"lans,omitempty"` + Networkloadbalancers *NetworkLoadBalancers `json:"networkloadbalancers,omitempty"` + Natgateways *NatGateways `json:"natgateways,omitempty"` +} + +// NewDataCenterEntities instantiates a new DataCenterEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataCenterEntities() *DataCenterEntities { + this := DataCenterEntities{} + + return &this +} + +// NewDataCenterEntitiesWithDefaults instantiates a new DataCenterEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataCenterEntitiesWithDefaults() *DataCenterEntities { + this := DataCenterEntities{} + return &this +} + +// GetServers returns the Servers field value +// If the value is explicit nil, the zero value for Servers will be returned +func (o *DataCenterEntities) GetServers() *Servers { + if o == nil { + return nil + } + + return o.Servers + +} + +// GetServersOk returns a tuple with the Servers 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 *DataCenterEntities) GetServersOk() (*Servers, bool) { + if o == nil { + return nil, false + } + + return o.Servers, true +} + +// SetServers sets field value +func (o *DataCenterEntities) SetServers(v Servers) { + + o.Servers = &v + +} + +// HasServers returns a boolean if a field has been set. +func (o *DataCenterEntities) HasServers() bool { + if o != nil && o.Servers != nil { + return true + } + + return false +} + +// GetVolumes returns the Volumes field value +// If the value is explicit nil, the zero value for Volumes will be returned +func (o *DataCenterEntities) GetVolumes() *Volumes { + if o == nil { + return nil + } + + return o.Volumes + +} + +// GetVolumesOk returns a tuple with the Volumes 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 *DataCenterEntities) GetVolumesOk() (*Volumes, bool) { + if o == nil { + return nil, false + } + + return o.Volumes, true +} + +// SetVolumes sets field value +func (o *DataCenterEntities) SetVolumes(v Volumes) { + + o.Volumes = &v + +} + +// HasVolumes returns a boolean if a field has been set. +func (o *DataCenterEntities) HasVolumes() bool { + if o != nil && o.Volumes != nil { + return true + } + + return false +} + +// GetLoadbalancers returns the Loadbalancers field value +// If the value is explicit nil, the zero value for Loadbalancers will be returned +func (o *DataCenterEntities) GetLoadbalancers() *Loadbalancers { + if o == nil { + return nil + } + + return o.Loadbalancers + +} + +// GetLoadbalancersOk returns a tuple with the Loadbalancers 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 *DataCenterEntities) GetLoadbalancersOk() (*Loadbalancers, bool) { + if o == nil { + return nil, false + } + + return o.Loadbalancers, true +} + +// SetLoadbalancers sets field value +func (o *DataCenterEntities) SetLoadbalancers(v Loadbalancers) { + + o.Loadbalancers = &v + +} + +// HasLoadbalancers returns a boolean if a field has been set. +func (o *DataCenterEntities) HasLoadbalancers() bool { + if o != nil && o.Loadbalancers != nil { + return true + } + + return false +} + +// GetLans returns the Lans field value +// If the value is explicit nil, the zero value for Lans will be returned +func (o *DataCenterEntities) GetLans() *Lans { + if o == nil { + return nil + } + + return o.Lans + +} + +// GetLansOk returns a tuple with the Lans 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 *DataCenterEntities) GetLansOk() (*Lans, bool) { + if o == nil { + return nil, false + } + + return o.Lans, true +} + +// SetLans sets field value +func (o *DataCenterEntities) SetLans(v Lans) { + + o.Lans = &v + +} + +// HasLans returns a boolean if a field has been set. +func (o *DataCenterEntities) HasLans() bool { + if o != nil && o.Lans != nil { + return true + } + + return false +} + +// GetNetworkloadbalancers returns the Networkloadbalancers field value +// If the value is explicit nil, the zero value for NetworkLoadBalancers will be returned +func (o *DataCenterEntities) GetNetworkloadbalancers() *NetworkLoadBalancers { + if o == nil { + return nil + } + + return o.Networkloadbalancers + +} + +// GetNetworkloadbalancersOk returns a tuple with the Networkloadbalancers 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 *DataCenterEntities) GetNetworkloadbalancersOk() (*NetworkLoadBalancers, bool) { + if o == nil { + return nil, false + } + + return o.Networkloadbalancers, true +} + +// SetNetworkloadbalancers sets field value +func (o *DataCenterEntities) SetNetworkloadbalancers(v NetworkLoadBalancers) { + + o.Networkloadbalancers = &v + +} + +// HasNetworkloadbalancers returns a boolean if a field has been set. +func (o *DataCenterEntities) HasNetworkloadbalancers() bool { + if o != nil && o.Networkloadbalancers != nil { + return true + } + + return false +} + +// GetNatgateways returns the Natgateways field value +// If the value is explicit nil, the zero value for NatGateways will be returned +func (o *DataCenterEntities) GetNatgateways() *NatGateways { + if o == nil { + return nil + } + + return o.Natgateways + +} + +// GetNatgatewaysOk returns a tuple with the Natgateways 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 *DataCenterEntities) GetNatgatewaysOk() (*NatGateways, bool) { + if o == nil { + return nil, false + } + + return o.Natgateways, true +} + +// SetNatgateways sets field value +func (o *DataCenterEntities) SetNatgateways(v NatGateways) { + + o.Natgateways = &v + +} + +// HasNatgateways returns a boolean if a field has been set. +func (o *DataCenterEntities) HasNatgateways() bool { + if o != nil && o.Natgateways != nil { + return true + } + + return false +} + +func (o DataCenterEntities) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Servers != nil { + toSerialize["servers"] = o.Servers + } + if o.Volumes != nil { + toSerialize["volumes"] = o.Volumes + } + if o.Loadbalancers != nil { + toSerialize["loadbalancers"] = o.Loadbalancers + } + if o.Lans != nil { + toSerialize["lans"] = o.Lans + } + if o.Networkloadbalancers != nil { + toSerialize["networkloadbalancers"] = o.Networkloadbalancers + } + if o.Natgateways != nil { + toSerialize["natgateways"] = o.Natgateways + } + return json.Marshal(toSerialize) +} + +type NullableDataCenterEntities struct { + value *DataCenterEntities + isSet bool +} + +func (v NullableDataCenterEntities) Get() *DataCenterEntities { + return v.value +} + +func (v *NullableDataCenterEntities) Set(val *DataCenterEntities) { + v.value = val + v.isSet = true +} + +func (v NullableDataCenterEntities) IsSet() bool { + return v.isSet +} + +func (v *NullableDataCenterEntities) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataCenterEntities(val *DataCenterEntities) *NullableDataCenterEntities { + return &NullableDataCenterEntities{value: val, isSet: true} +} + +func (v NullableDataCenterEntities) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataCenterEntities) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter.go index c9a8784b7839..45a4e9d7dac2 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // Datacenter struct for Datacenter type Datacenter struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *DatacenterProperties `json:"properties"` - Entities *DatacenterEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *DatacenterProperties `json:"properties"` + Entities *DataCenterEntities `json:"entities,omitempty"` } +// NewDatacenter instantiates a new Datacenter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatacenter(properties DatacenterProperties) *Datacenter { + this := Datacenter{} + this.Properties = &properties + + return &this +} + +// NewDatacenterWithDefaults instantiates a new Datacenter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatacenterWithDefaults() *Datacenter { + this := Datacenter{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *Datacenter) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *Datacenter) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Datacenter) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *Datacenter) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Datacenter) GetType() *Type { @@ -73,6 +93,7 @@ func (o *Datacenter) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *Datacenter) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Datacenter) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *Datacenter) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Datacenter) GetHref() *string { @@ -109,6 +131,7 @@ func (o *Datacenter) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *Datacenter) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Datacenter) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *Datacenter) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Datacenter) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *Datacenter) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *Datacenter) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Datacenter) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *Datacenter) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for DatacenterProperties will be returned func (o *Datacenter) GetProperties() *DatacenterProperties { @@ -181,6 +207,7 @@ func (o *Datacenter) GetProperties() *DatacenterProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *Datacenter) GetPropertiesOk() (*DatacenterProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Datacenter) SetProperties(v DatacenterProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,31 +237,33 @@ func (o *Datacenter) HasProperties() bool { return false } - - // GetEntities returns the Entities field value -// If the value is explicit nil, the zero value for DatacenterEntities will be returned -func (o *Datacenter) GetEntities() *DatacenterEntities { +// If the value is explicit nil, the zero value for DataCenterEntities will be returned +func (o *Datacenter) GetEntities() *DataCenterEntities { if o == nil { return nil } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities 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 *Datacenter) GetEntitiesOk() (*DatacenterEntities, bool) { +func (o *Datacenter) GetEntitiesOk() (*DataCenterEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value -func (o *Datacenter) SetEntities(v DatacenterEntities) { +func (o *Datacenter) SetEntities(v DataCenterEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *Datacenter) HasEntities() bool { return false } - func (o Datacenter) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableDatacenter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_element_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_element_metadata.go index a6df0841d76f..6f504314d25b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_element_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_element_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,25 +17,41 @@ import ( // DatacenterElementMetadata struct for DatacenterElementMetadata type DatacenterElementMetadata struct { - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. Etag *string `json:"etag,omitempty"` - // The last time the resource was created - CreatedDate *time.Time `json:"createdDate,omitempty"` + // The last time the resource was created. + CreatedDate *IonosTime // The user who created the resource. CreatedBy *string `json:"createdBy,omitempty"` - // The user id of the user who has created the resource. + // The unique ID of the user who created the resource. CreatedByUserId *string `json:"createdByUserId,omitempty"` - // The last time the resource has been modified - LastModifiedDate *time.Time `json:"lastModifiedDate,omitempty"` + // The last time the resource was modified. + LastModifiedDate *IonosTime // The user who last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // The user id of the user who has last modified the resource. + // The unique ID of the user who last modified the resource. LastModifiedByUserId *string `json:"lastModifiedByUserId,omitempty"` - // State of the resource. *AVAILABLE* There are no pending modification requests for this item; *BUSY* There is at least one modification request pending and all following requests will be queued; *INACTIVE* Resource has been de-provisioned; *DEPLOYING* Resource state DEPLOYING - relevant for Kubernetes cluster/nodepool; *ACTIVE* Resource state ACTIVE - relevant for Kubernetes cluster/nodepool; *FAILED* Resource state FAILED - relevant for Kubernetes cluster/nodepool; *SUSPENDED* Resource state SUSPENDED - relevant for Kubernetes cluster/nodepool; *FAILED_SUSPENDED* Resource state FAILED_SUSPENDED - relevant for Kubernetes cluster; *UPDATING* Resource state UPDATING - relevant for Kubernetes cluster/nodepool; *FAILED_UPDATING* Resource state FAILED_UPDATING - relevant for Kubernetes cluster/nodepool; *DESTROYING* Resource state DESTROYING - relevant for Kubernetes cluster; *FAILED_DESTROYING* Resource state FAILED_DESTROYING - relevant for Kubernetes cluster/nodepool; *TERMINATED* Resource state TERMINATED - relevant for Kubernetes cluster/nodepool + // State of the resource. *AVAILABLE* There are no pending modification requests for this item; *BUSY* There is at least one modification request pending and all following requests will be queued; *INACTIVE* Resource has been de-provisioned; *DEPLOYING* Resource state DEPLOYING - relevant for Kubernetes cluster/nodepool; *ACTIVE* Resource state ACTIVE - relevant for Kubernetes cluster/nodepool; *FAILED* Resource state FAILED - relevant for Kubernetes cluster/nodepool; *SUSPENDED* Resource state SUSPENDED - relevant for Kubernetes cluster/nodepool; *FAILED_SUSPENDED* Resource state FAILED_SUSPENDED - relevant for Kubernetes cluster; *UPDATING* Resource state UPDATING - relevant for Kubernetes cluster/nodepool; *FAILED_UPDATING* Resource state FAILED_UPDATING - relevant for Kubernetes cluster/nodepool; *DESTROYING* Resource state DESTROYING - relevant for Kubernetes cluster; *FAILED_DESTROYING* Resource state FAILED_DESTROYING - relevant for Kubernetes cluster/nodepool; *TERMINATED* Resource state TERMINATED - relevant for Kubernetes cluster/nodepool. State *string `json:"state,omitempty"` } +// NewDatacenterElementMetadata instantiates a new DatacenterElementMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatacenterElementMetadata() *DatacenterElementMetadata { + this := DatacenterElementMetadata{} + return &this +} + +// NewDatacenterElementMetadataWithDefaults instantiates a new DatacenterElementMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatacenterElementMetadataWithDefaults() *DatacenterElementMetadata { + this := DatacenterElementMetadata{} + return &this +} // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned @@ -45,6 +61,7 @@ func (o *DatacenterElementMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -54,12 +71,15 @@ func (o *DatacenterElementMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *DatacenterElementMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -71,8 +91,6 @@ func (o *DatacenterElementMetadata) HasEtag() bool { return false } - - // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *DatacenterElementMetadata) GetCreatedDate() *time.Time { @@ -80,7 +98,11 @@ func (o *DatacenterElementMetadata) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -90,12 +112,19 @@ func (o *DatacenterElementMetadata) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *DatacenterElementMetadata) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -107,8 +136,6 @@ func (o *DatacenterElementMetadata) HasCreatedDate() bool { return false } - - // GetCreatedBy returns the CreatedBy field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterElementMetadata) GetCreatedBy() *string { @@ -117,6 +144,7 @@ func (o *DatacenterElementMetadata) GetCreatedBy() *string { } return o.CreatedBy + } // GetCreatedByOk returns a tuple with the CreatedBy field value @@ -126,12 +154,15 @@ func (o *DatacenterElementMetadata) GetCreatedByOk() (*string, bool) { if o == nil { return nil, false } + return o.CreatedBy, true } // SetCreatedBy sets field value func (o *DatacenterElementMetadata) SetCreatedBy(v string) { + o.CreatedBy = &v + } // HasCreatedBy returns a boolean if a field has been set. @@ -143,8 +174,6 @@ func (o *DatacenterElementMetadata) HasCreatedBy() bool { return false } - - // GetCreatedByUserId returns the CreatedByUserId field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterElementMetadata) GetCreatedByUserId() *string { @@ -153,6 +182,7 @@ func (o *DatacenterElementMetadata) GetCreatedByUserId() *string { } return o.CreatedByUserId + } // GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value @@ -162,12 +192,15 @@ func (o *DatacenterElementMetadata) GetCreatedByUserIdOk() (*string, bool) { if o == nil { return nil, false } + return o.CreatedByUserId, true } // SetCreatedByUserId sets field value func (o *DatacenterElementMetadata) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v + } // HasCreatedByUserId returns a boolean if a field has been set. @@ -179,8 +212,6 @@ func (o *DatacenterElementMetadata) HasCreatedByUserId() bool { 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 *DatacenterElementMetadata) GetLastModifiedDate() *time.Time { @@ -188,7 +219,11 @@ func (o *DatacenterElementMetadata) GetLastModifiedDate() *time.Time { return nil } - return o.LastModifiedDate + if o.LastModifiedDate == nil { + return nil + } + return &o.LastModifiedDate.Time + } // GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value @@ -198,12 +233,19 @@ func (o *DatacenterElementMetadata) GetLastModifiedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.LastModifiedDate, true + + if o.LastModifiedDate == nil { + return nil, false + } + return &o.LastModifiedDate.Time, true + } // SetLastModifiedDate sets field value func (o *DatacenterElementMetadata) SetLastModifiedDate(v time.Time) { - o.LastModifiedDate = &v + + o.LastModifiedDate = &IonosTime{v} + } // HasLastModifiedDate returns a boolean if a field has been set. @@ -215,8 +257,6 @@ func (o *DatacenterElementMetadata) HasLastModifiedDate() bool { return false } - - // GetLastModifiedBy returns the LastModifiedBy field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterElementMetadata) GetLastModifiedBy() *string { @@ -225,6 +265,7 @@ func (o *DatacenterElementMetadata) GetLastModifiedBy() *string { } return o.LastModifiedBy + } // GetLastModifiedByOk returns a tuple with the LastModifiedBy field value @@ -234,12 +275,15 @@ func (o *DatacenterElementMetadata) GetLastModifiedByOk() (*string, bool) { if o == nil { return nil, false } + return o.LastModifiedBy, true } // SetLastModifiedBy sets field value func (o *DatacenterElementMetadata) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v + } // HasLastModifiedBy returns a boolean if a field has been set. @@ -251,8 +295,6 @@ func (o *DatacenterElementMetadata) HasLastModifiedBy() bool { return false } - - // GetLastModifiedByUserId returns the LastModifiedByUserId field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterElementMetadata) GetLastModifiedByUserId() *string { @@ -261,6 +303,7 @@ func (o *DatacenterElementMetadata) GetLastModifiedByUserId() *string { } return o.LastModifiedByUserId + } // GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value @@ -270,12 +313,15 @@ func (o *DatacenterElementMetadata) GetLastModifiedByUserIdOk() (*string, bool) if o == nil { return nil, false } + return o.LastModifiedByUserId, true } // SetLastModifiedByUserId sets field value func (o *DatacenterElementMetadata) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v + } // HasLastModifiedByUserId returns a boolean if a field has been set. @@ -287,8 +333,6 @@ func (o *DatacenterElementMetadata) HasLastModifiedByUserId() bool { return false } - - // GetState returns the State field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterElementMetadata) GetState() *string { @@ -297,6 +341,7 @@ func (o *DatacenterElementMetadata) GetState() *string { } return o.State + } // GetStateOk returns a tuple with the State field value @@ -306,12 +351,15 @@ func (o *DatacenterElementMetadata) GetStateOk() (*string, bool) { if o == nil { return nil, false } + return o.State, true } // SetState sets field value func (o *DatacenterElementMetadata) SetState(v string) { + o.State = &v + } // HasState returns a boolean if a field has been set. @@ -323,49 +371,32 @@ func (o *DatacenterElementMetadata) HasState() bool { return false } - func (o DatacenterElementMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - - if o.State != nil { toSerialize["state"] = o.State } - return json.Marshal(toSerialize) } @@ -404,5 +435,3 @@ func (v *NullableDatacenterElementMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_entities.go deleted file mode 100644 index 7458507ae22f..000000000000 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_entities.go +++ /dev/null @@ -1,231 +0,0 @@ -/* - * CLOUD API - * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionossdk - -import ( - "encoding/json" -) - -// DatacenterEntities struct for DatacenterEntities -type DatacenterEntities struct { - Servers *Servers `json:"servers,omitempty"` - Volumes *Volumes `json:"volumes,omitempty"` - Loadbalancers *Loadbalancers `json:"loadbalancers,omitempty"` - Lans *Lans `json:"lans,omitempty"` -} - - - -// GetServers returns the Servers field value -// If the value is explicit nil, the zero value for Servers will be returned -func (o *DatacenterEntities) GetServers() *Servers { - if o == nil { - return nil - } - - return o.Servers -} - -// GetServersOk returns a tuple with the Servers 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 *DatacenterEntities) GetServersOk() (*Servers, bool) { - if o == nil { - return nil, false - } - return o.Servers, true -} - -// SetServers sets field value -func (o *DatacenterEntities) SetServers(v Servers) { - o.Servers = &v -} - -// HasServers returns a boolean if a field has been set. -func (o *DatacenterEntities) HasServers() bool { - if o != nil && o.Servers != nil { - return true - } - - return false -} - - - -// GetVolumes returns the Volumes field value -// If the value is explicit nil, the zero value for Volumes will be returned -func (o *DatacenterEntities) GetVolumes() *Volumes { - if o == nil { - return nil - } - - return o.Volumes -} - -// GetVolumesOk returns a tuple with the Volumes 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 *DatacenterEntities) GetVolumesOk() (*Volumes, bool) { - if o == nil { - return nil, false - } - return o.Volumes, true -} - -// SetVolumes sets field value -func (o *DatacenterEntities) SetVolumes(v Volumes) { - o.Volumes = &v -} - -// HasVolumes returns a boolean if a field has been set. -func (o *DatacenterEntities) HasVolumes() bool { - if o != nil && o.Volumes != nil { - return true - } - - return false -} - - - -// GetLoadbalancers returns the Loadbalancers field value -// If the value is explicit nil, the zero value for Loadbalancers will be returned -func (o *DatacenterEntities) GetLoadbalancers() *Loadbalancers { - if o == nil { - return nil - } - - return o.Loadbalancers -} - -// GetLoadbalancersOk returns a tuple with the Loadbalancers 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 *DatacenterEntities) GetLoadbalancersOk() (*Loadbalancers, bool) { - if o == nil { - return nil, false - } - return o.Loadbalancers, true -} - -// SetLoadbalancers sets field value -func (o *DatacenterEntities) SetLoadbalancers(v Loadbalancers) { - o.Loadbalancers = &v -} - -// HasLoadbalancers returns a boolean if a field has been set. -func (o *DatacenterEntities) HasLoadbalancers() bool { - if o != nil && o.Loadbalancers != nil { - return true - } - - return false -} - - - -// GetLans returns the Lans field value -// If the value is explicit nil, the zero value for Lans will be returned -func (o *DatacenterEntities) GetLans() *Lans { - if o == nil { - return nil - } - - return o.Lans -} - -// GetLansOk returns a tuple with the Lans 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 *DatacenterEntities) GetLansOk() (*Lans, bool) { - if o == nil { - return nil, false - } - return o.Lans, true -} - -// SetLans sets field value -func (o *DatacenterEntities) SetLans(v Lans) { - o.Lans = &v -} - -// HasLans returns a boolean if a field has been set. -func (o *DatacenterEntities) HasLans() bool { - if o != nil && o.Lans != nil { - return true - } - - return false -} - - -func (o DatacenterEntities) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - - if o.Servers != nil { - toSerialize["servers"] = o.Servers - } - - - if o.Volumes != nil { - toSerialize["volumes"] = o.Volumes - } - - - if o.Loadbalancers != nil { - toSerialize["loadbalancers"] = o.Loadbalancers - } - - - if o.Lans != nil { - toSerialize["lans"] = o.Lans - } - - return json.Marshal(toSerialize) -} - -type NullableDatacenterEntities struct { - value *DatacenterEntities - isSet bool -} - -func (v NullableDatacenterEntities) Get() *DatacenterEntities { - return v.value -} - -func (v *NullableDatacenterEntities) Set(val *DatacenterEntities) { - v.value = val - v.isSet = true -} - -func (v NullableDatacenterEntities) IsSet() bool { - return v.isSet -} - -func (v *NullableDatacenterEntities) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatacenterEntities(val *DatacenterEntities) *NullableDatacenterEntities { - return &NullableDatacenterEntities{value: val, isSet: true} -} - -func (v NullableDatacenterEntities) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatacenterEntities) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_properties.go index f25e20273c54..7ea457242209 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenter_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,21 +16,41 @@ import ( // DatacenterProperties struct for DatacenterProperties type DatacenterProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // A description for the datacenter, e.g. staging, production + // A description for the datacenter, such as staging, production. Description *string `json:"description,omitempty"` - // The physical location where the datacenter will be created. This will be where all of your servers live. Property cannot be modified after datacenter creation (disallowed in update requests) + // The physical location where the datacenter will be created. This will be where all of your servers live. Property cannot be modified after datacenter creation (disallowed in update requests). Location *string `json:"location"` - // The version of that Data Center. Gets incremented with every change + // The version of the data center; incremented with every change. Version *int32 `json:"version,omitempty"` - // List of features supported by the location this data center is part of + // List of features supported by the location where this data center is provisioned. Features *[]string `json:"features,omitempty"` - // Boolean value representing if the data center requires extra protection e.g. two factor protection + // Boolean value representing if the data center requires extra protection, such as two-step verification. SecAuthProtection *bool `json:"secAuthProtection,omitempty"` + // Array of features and CPU families available in a location + CpuArchitecture *[]CpuArchitectureProperties `json:"cpuArchitecture,omitempty"` } +// NewDatacenterProperties instantiates a new DatacenterProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatacenterProperties(location string) *DatacenterProperties { + this := DatacenterProperties{} + this.Location = &location + + return &this +} + +// NewDatacenterPropertiesWithDefaults instantiates a new DatacenterProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatacenterPropertiesWithDefaults() *DatacenterProperties { + this := DatacenterProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -40,6 +60,7 @@ func (o *DatacenterProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -49,12 +70,15 @@ func (o *DatacenterProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *DatacenterProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -66,8 +90,6 @@ func (o *DatacenterProperties) HasName() bool { return false } - - // GetDescription returns the Description field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterProperties) GetDescription() *string { @@ -76,6 +98,7 @@ func (o *DatacenterProperties) GetDescription() *string { } return o.Description + } // GetDescriptionOk returns a tuple with the Description field value @@ -85,12 +108,15 @@ func (o *DatacenterProperties) GetDescriptionOk() (*string, bool) { if o == nil { return nil, false } + return o.Description, true } // SetDescription sets field value func (o *DatacenterProperties) SetDescription(v string) { + o.Description = &v + } // HasDescription returns a boolean if a field has been set. @@ -102,8 +128,6 @@ func (o *DatacenterProperties) HasDescription() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *DatacenterProperties) GetLocation() *string { @@ -112,6 +136,7 @@ func (o *DatacenterProperties) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -121,12 +146,15 @@ func (o *DatacenterProperties) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *DatacenterProperties) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -138,8 +166,6 @@ func (o *DatacenterProperties) HasLocation() bool { return false } - - // GetVersion returns the Version field value // If the value is explicit nil, the zero value for int32 will be returned func (o *DatacenterProperties) GetVersion() *int32 { @@ -148,6 +174,7 @@ func (o *DatacenterProperties) GetVersion() *int32 { } return o.Version + } // GetVersionOk returns a tuple with the Version field value @@ -157,12 +184,15 @@ func (o *DatacenterProperties) GetVersionOk() (*int32, bool) { if o == nil { return nil, false } + return o.Version, true } // SetVersion sets field value func (o *DatacenterProperties) SetVersion(v int32) { + o.Version = &v + } // HasVersion returns a boolean if a field has been set. @@ -174,8 +204,6 @@ func (o *DatacenterProperties) HasVersion() bool { return false } - - // GetFeatures returns the Features field value // If the value is explicit nil, the zero value for []string will be returned func (o *DatacenterProperties) GetFeatures() *[]string { @@ -184,6 +212,7 @@ func (o *DatacenterProperties) GetFeatures() *[]string { } return o.Features + } // GetFeaturesOk returns a tuple with the Features field value @@ -193,12 +222,15 @@ func (o *DatacenterProperties) GetFeaturesOk() (*[]string, bool) { if o == nil { return nil, false } + return o.Features, true } // SetFeatures sets field value func (o *DatacenterProperties) SetFeatures(v []string) { + o.Features = &v + } // HasFeatures returns a boolean if a field has been set. @@ -210,8 +242,6 @@ func (o *DatacenterProperties) HasFeatures() bool { return false } - - // GetSecAuthProtection returns the SecAuthProtection field value // If the value is explicit nil, the zero value for bool will be returned func (o *DatacenterProperties) GetSecAuthProtection() *bool { @@ -220,6 +250,7 @@ func (o *DatacenterProperties) GetSecAuthProtection() *bool { } return o.SecAuthProtection + } // GetSecAuthProtectionOk returns a tuple with the SecAuthProtection field value @@ -229,12 +260,15 @@ func (o *DatacenterProperties) GetSecAuthProtectionOk() (*bool, bool) { if o == nil { return nil, false } + return o.SecAuthProtection, true } // SetSecAuthProtection sets field value func (o *DatacenterProperties) SetSecAuthProtection(v bool) { + o.SecAuthProtection = &v + } // HasSecAuthProtection returns a boolean if a field has been set. @@ -246,39 +280,67 @@ func (o *DatacenterProperties) HasSecAuthProtection() bool { return false } +// GetCpuArchitecture returns the CpuArchitecture field value +// If the value is explicit nil, the zero value for []CpuArchitectureProperties will be returned +func (o *DatacenterProperties) GetCpuArchitecture() *[]CpuArchitectureProperties { + if o == nil { + return nil + } + + return o.CpuArchitecture + +} + +// GetCpuArchitectureOk returns a tuple with the CpuArchitecture 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 *DatacenterProperties) GetCpuArchitectureOk() (*[]CpuArchitectureProperties, bool) { + if o == nil { + return nil, false + } + + return o.CpuArchitecture, true +} + +// SetCpuArchitecture sets field value +func (o *DatacenterProperties) SetCpuArchitecture(v []CpuArchitectureProperties) { + + o.CpuArchitecture = &v + +} + +// HasCpuArchitecture returns a boolean if a field has been set. +func (o *DatacenterProperties) HasCpuArchitecture() bool { + if o != nil && o.CpuArchitecture != nil { + return true + } + + return false +} func (o DatacenterProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Description != nil { toSerialize["description"] = o.Description } - - if o.Location != nil { toSerialize["location"] = o.Location } - - if o.Version != nil { toSerialize["version"] = o.Version } - - if o.Features != nil { toSerialize["features"] = o.Features } - - if o.SecAuthProtection != nil { toSerialize["secAuthProtection"] = o.SecAuthProtection } - + if o.CpuArchitecture != nil { + toSerialize["cpuArchitecture"] = o.CpuArchitecture + } return json.Marshal(toSerialize) } @@ -317,5 +379,3 @@ func (v *NullableDatacenterProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenters.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenters.go index 5c9e6c48cf2e..28911601f0c1 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenters.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_datacenters.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Datacenters struct for Datacenters type Datacenters struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Datacenter `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewDatacenters instantiates a new Datacenters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatacenters() *Datacenters { + this := Datacenters{} + return &this +} + +// NewDatacentersWithDefaults instantiates a new Datacenters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatacentersWithDefaults() *Datacenters { + this := Datacenters{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Datacenters) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Datacenters) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Datacenters) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Datacenters) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Datacenters) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Datacenters) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Datacenters) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Datacenters) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Datacenters) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Datacenters) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Datacenters) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Datacenters) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Datacenters) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Datacenters) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Datacenter will be returned func (o *Datacenters) GetItems() *[]Datacenter { @@ -144,6 +171,7 @@ func (o *Datacenters) GetItems() *[]Datacenter { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Datacenters) GetItemsOk() (*[]Datacenter, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Datacenters) SetItems(v []Datacenter) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Datacenters) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Datacenters) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Datacenters) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Datacenters) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Datacenters) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Datacenters) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Datacenters) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Datacenters) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Datacenters) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Datacenters) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Datacenters) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Datacenters) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Datacenters) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Datacenters) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableDatacenters) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error.go index 42ef0a4a6487..a383952b7923 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,12 +16,28 @@ import ( // Error struct for Error type Error struct { - // HTTP status code of the operation - HttpStatus *int32 `json:"httpStatus,omitempty"` - Messages *[]ErrorMessage `json:"messages,omitempty"` + // HTTP status code of the operation. + HttpStatus *int32 `json:"httpStatus,omitempty"` + Messages *[]ErrorMessage `json:"messages,omitempty"` } +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError() *Error { + this := Error{} + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} // GetHttpStatus returns the HttpStatus field value // If the value is explicit nil, the zero value for int32 will be returned @@ -31,6 +47,7 @@ func (o *Error) GetHttpStatus() *int32 { } return o.HttpStatus + } // GetHttpStatusOk returns a tuple with the HttpStatus field value @@ -40,12 +57,15 @@ func (o *Error) GetHttpStatusOk() (*int32, bool) { if o == nil { return nil, false } + return o.HttpStatus, true } // SetHttpStatus sets field value func (o *Error) SetHttpStatus(v int32) { + o.HttpStatus = &v + } // HasHttpStatus returns a boolean if a field has been set. @@ -57,8 +77,6 @@ func (o *Error) HasHttpStatus() bool { return false } - - // GetMessages returns the Messages field value // If the value is explicit nil, the zero value for []ErrorMessage will be returned func (o *Error) GetMessages() *[]ErrorMessage { @@ -67,6 +85,7 @@ func (o *Error) GetMessages() *[]ErrorMessage { } return o.Messages + } // GetMessagesOk returns a tuple with the Messages field value @@ -76,12 +95,15 @@ func (o *Error) GetMessagesOk() (*[]ErrorMessage, bool) { if o == nil { return nil, false } + return o.Messages, true } // SetMessages sets field value func (o *Error) SetMessages(v []ErrorMessage) { + o.Messages = &v + } // HasMessages returns a boolean if a field has been set. @@ -93,19 +115,14 @@ func (o *Error) HasMessages() bool { return false } - func (o Error) MarshalJSON() ([]byte, 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) } @@ -144,5 +161,3 @@ func (v *NullableError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error_message.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error_message.go index 2c6fff83e665..f3044d977df4 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error_message.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_error_message.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,29 @@ import ( // ErrorMessage struct for ErrorMessage type ErrorMessage struct { - // Application internal error code + // Application internal error code. ErrorCode *string `json:"errorCode,omitempty"` - // Human readable message + // A human-readable message. Message *string `json:"message,omitempty"` } +// NewErrorMessage instantiates a new ErrorMessage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorMessage() *ErrorMessage { + this := ErrorMessage{} + return &this +} + +// NewErrorMessageWithDefaults instantiates a new ErrorMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorMessageWithDefaults() *ErrorMessage { + this := ErrorMessage{} + return &this +} // GetErrorCode returns the ErrorCode field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +48,7 @@ func (o *ErrorMessage) GetErrorCode() *string { } return o.ErrorCode + } // GetErrorCodeOk returns a tuple with the ErrorCode field value @@ -41,12 +58,15 @@ func (o *ErrorMessage) GetErrorCodeOk() (*string, bool) { if o == nil { 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. @@ -58,8 +78,6 @@ func (o *ErrorMessage) HasErrorCode() bool { 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 { @@ -68,6 +86,7 @@ func (o *ErrorMessage) GetMessage() *string { } return o.Message + } // GetMessageOk returns a tuple with the Message field value @@ -77,12 +96,15 @@ func (o *ErrorMessage) GetMessageOk() (*string, bool) { if o == nil { 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. @@ -94,19 +116,14 @@ func (o *ErrorMessage) HasMessage() bool { return false } - func (o ErrorMessage) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ErrorCode != nil { toSerialize["errorCode"] = o.ErrorCode } - - if o.Message != nil { toSerialize["message"] = o.Message } - return json.Marshal(toSerialize) } @@ -145,5 +162,3 @@ func (v *NullableErrorMessage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rule.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rule.go index ae2bd73f667a..6b472e4e9135 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rule.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rule.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // FirewallRule struct for FirewallRule type FirewallRule struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *FirewallruleProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *FirewallruleProperties `json:"properties"` } +// NewFirewallRule instantiates a new FirewallRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirewallRule(properties FirewallruleProperties) *FirewallRule { + this := FirewallRule{} + this.Properties = &properties + + return &this +} + +// NewFirewallRuleWithDefaults instantiates a new FirewallRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirewallRuleWithDefaults() *FirewallRule { + this := FirewallRule{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *FirewallRule) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *FirewallRule) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *FirewallRule) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *FirewallRule) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *FirewallRule) GetType() *Type { @@ -72,6 +92,7 @@ func (o *FirewallRule) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *FirewallRule) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *FirewallRule) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *FirewallRule) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallRule) GetHref() *string { @@ -108,6 +130,7 @@ func (o *FirewallRule) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *FirewallRule) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *FirewallRule) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *FirewallRule) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *FirewallRule) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *FirewallRule) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *FirewallRule) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *FirewallRule) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *FirewallRule) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for FirewallruleProperties will be returned func (o *FirewallRule) GetProperties() *FirewallruleProperties { @@ -180,6 +206,7 @@ func (o *FirewallRule) GetProperties() *FirewallruleProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *FirewallRule) GetPropertiesOk() (*FirewallruleProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *FirewallRule) SetProperties(v FirewallruleProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *FirewallRule) HasProperties() bool { return false } - func (o FirewallRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableFirewallRule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rules.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rules.go index bd46fb030b73..f3b572931ca0 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rules.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewall_rules.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // FirewallRules struct for FirewallRules type FirewallRules struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]FirewallRule `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewFirewallRules instantiates a new FirewallRules object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirewallRules() *FirewallRules { + this := FirewallRules{} + return &this +} + +// NewFirewallRulesWithDefaults instantiates a new FirewallRules object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirewallRulesWithDefaults() *FirewallRules { + this := FirewallRules{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *FirewallRules) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *FirewallRules) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *FirewallRules) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *FirewallRules) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *FirewallRules) GetType() *Type { @@ -72,6 +95,7 @@ func (o *FirewallRules) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *FirewallRules) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *FirewallRules) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *FirewallRules) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallRules) GetHref() *string { @@ -108,6 +133,7 @@ func (o *FirewallRules) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *FirewallRules) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *FirewallRules) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *FirewallRules) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []FirewallRule will be returned func (o *FirewallRules) GetItems() *[]FirewallRule { @@ -144,6 +171,7 @@ func (o *FirewallRules) GetItems() *[]FirewallRule { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *FirewallRules) GetItemsOk() (*[]FirewallRule, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *FirewallRules) SetItems(v []FirewallRule) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *FirewallRules) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *FirewallRules) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FirewallRules) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *FirewallRules) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *FirewallRules) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *FirewallRules) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FirewallRules) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *FirewallRules) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *FirewallRules) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *FirewallRules) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FirewallRules) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *FirewallRules) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *FirewallRules) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o FirewallRules) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableFirewallRules) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewallrule_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewallrule_properties.go index 501c5c743632..188c3e7f18f2 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewallrule_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_firewallrule_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,27 +16,47 @@ import ( // FirewallruleProperties struct for FirewallruleProperties type FirewallruleProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // The protocol for the rule. Property cannot be modified after creation (disallowed in update requests) + // The protocol for the rule. Property cannot be modified after it is created (disallowed in update requests). Protocol *string `json:"protocol"` - // Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address + // Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows traffic from any MAC address. SourceMac *string `json:"sourceMac,omitempty"` - // Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs + // Only traffic originating from the respective IPv4 address is allowed. Value null allows traffic from any IP address. SourceIp *string `json:"sourceIp,omitempty"` - // In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs + // If the target NIC has multiple IP addresses, only the traffic directed to the respective IP address of the NIC is allowed. Value null Value null allows traffic to any target IP address. TargetIp *string `json:"targetIp,omitempty"` - // Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes + // Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes. IcmpCode *int32 `json:"icmpCode,omitempty"` - // Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Value null allows all types + // Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Value null allows all types. IcmpType *int32 `json:"icmpType,omitempty"` - // Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd value null to allow all ports + // Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd value null to allow all ports. PortRangeStart *int32 `json:"portRangeStart,omitempty"` - // Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports + // Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports. PortRangeEnd *int32 `json:"portRangeEnd,omitempty"` + // The type of the firewall rule. If not specified, the default INGRESS value is used. + Type *string `json:"type,omitempty"` } +// NewFirewallruleProperties instantiates a new FirewallruleProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirewallruleProperties(protocol string) *FirewallruleProperties { + this := FirewallruleProperties{} + this.Protocol = &protocol + + return &this +} + +// NewFirewallrulePropertiesWithDefaults instantiates a new FirewallruleProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirewallrulePropertiesWithDefaults() *FirewallruleProperties { + this := FirewallruleProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -46,6 +66,7 @@ func (o *FirewallruleProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -55,12 +76,15 @@ func (o *FirewallruleProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *FirewallruleProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -72,8 +96,6 @@ func (o *FirewallruleProperties) HasName() bool { return false } - - // GetProtocol returns the Protocol field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallruleProperties) GetProtocol() *string { @@ -82,6 +104,7 @@ func (o *FirewallruleProperties) GetProtocol() *string { } return o.Protocol + } // GetProtocolOk returns a tuple with the Protocol field value @@ -91,12 +114,15 @@ func (o *FirewallruleProperties) GetProtocolOk() (*string, bool) { if o == nil { return nil, false } + return o.Protocol, true } // SetProtocol sets field value func (o *FirewallruleProperties) SetProtocol(v string) { + o.Protocol = &v + } // HasProtocol returns a boolean if a field has been set. @@ -108,8 +134,6 @@ func (o *FirewallruleProperties) HasProtocol() bool { return false } - - // GetSourceMac returns the SourceMac field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallruleProperties) GetSourceMac() *string { @@ -118,6 +142,7 @@ func (o *FirewallruleProperties) GetSourceMac() *string { } return o.SourceMac + } // GetSourceMacOk returns a tuple with the SourceMac field value @@ -127,12 +152,15 @@ func (o *FirewallruleProperties) GetSourceMacOk() (*string, bool) { if o == nil { return nil, false } + return o.SourceMac, true } // SetSourceMac sets field value func (o *FirewallruleProperties) SetSourceMac(v string) { + o.SourceMac = &v + } // HasSourceMac returns a boolean if a field has been set. @@ -144,8 +172,6 @@ func (o *FirewallruleProperties) HasSourceMac() bool { return false } - - // GetSourceIp returns the SourceIp field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallruleProperties) GetSourceIp() *string { @@ -154,6 +180,7 @@ func (o *FirewallruleProperties) GetSourceIp() *string { } return o.SourceIp + } // GetSourceIpOk returns a tuple with the SourceIp field value @@ -163,12 +190,15 @@ func (o *FirewallruleProperties) GetSourceIpOk() (*string, bool) { if o == nil { return nil, false } + return o.SourceIp, true } // SetSourceIp sets field value func (o *FirewallruleProperties) SetSourceIp(v string) { + o.SourceIp = &v + } // HasSourceIp returns a boolean if a field has been set. @@ -180,8 +210,6 @@ func (o *FirewallruleProperties) HasSourceIp() bool { return false } - - // GetTargetIp returns the TargetIp field value // If the value is explicit nil, the zero value for string will be returned func (o *FirewallruleProperties) GetTargetIp() *string { @@ -190,6 +218,7 @@ func (o *FirewallruleProperties) GetTargetIp() *string { } return o.TargetIp + } // GetTargetIpOk returns a tuple with the TargetIp field value @@ -199,12 +228,15 @@ func (o *FirewallruleProperties) GetTargetIpOk() (*string, bool) { if o == nil { return nil, false } + return o.TargetIp, true } // SetTargetIp sets field value func (o *FirewallruleProperties) SetTargetIp(v string) { + o.TargetIp = &v + } // HasTargetIp returns a boolean if a field has been set. @@ -216,8 +248,6 @@ func (o *FirewallruleProperties) HasTargetIp() bool { return false } - - // GetIcmpCode returns the IcmpCode field value // If the value is explicit nil, the zero value for int32 will be returned func (o *FirewallruleProperties) GetIcmpCode() *int32 { @@ -226,6 +256,7 @@ func (o *FirewallruleProperties) GetIcmpCode() *int32 { } return o.IcmpCode + } // GetIcmpCodeOk returns a tuple with the IcmpCode field value @@ -235,12 +266,15 @@ func (o *FirewallruleProperties) GetIcmpCodeOk() (*int32, bool) { if o == nil { return nil, false } + return o.IcmpCode, true } // SetIcmpCode sets field value func (o *FirewallruleProperties) SetIcmpCode(v int32) { + o.IcmpCode = &v + } // HasIcmpCode returns a boolean if a field has been set. @@ -252,8 +286,6 @@ func (o *FirewallruleProperties) HasIcmpCode() bool { return false } - - // GetIcmpType returns the IcmpType field value // If the value is explicit nil, the zero value for int32 will be returned func (o *FirewallruleProperties) GetIcmpType() *int32 { @@ -262,6 +294,7 @@ func (o *FirewallruleProperties) GetIcmpType() *int32 { } return o.IcmpType + } // GetIcmpTypeOk returns a tuple with the IcmpType field value @@ -271,12 +304,15 @@ func (o *FirewallruleProperties) GetIcmpTypeOk() (*int32, bool) { if o == nil { return nil, false } + return o.IcmpType, true } // SetIcmpType sets field value func (o *FirewallruleProperties) SetIcmpType(v int32) { + o.IcmpType = &v + } // HasIcmpType returns a boolean if a field has been set. @@ -288,8 +324,6 @@ func (o *FirewallruleProperties) HasIcmpType() bool { return false } - - // GetPortRangeStart returns the PortRangeStart field value // If the value is explicit nil, the zero value for int32 will be returned func (o *FirewallruleProperties) GetPortRangeStart() *int32 { @@ -298,6 +332,7 @@ func (o *FirewallruleProperties) GetPortRangeStart() *int32 { } return o.PortRangeStart + } // GetPortRangeStartOk returns a tuple with the PortRangeStart field value @@ -307,12 +342,15 @@ func (o *FirewallruleProperties) GetPortRangeStartOk() (*int32, bool) { if o == nil { return nil, false } + return o.PortRangeStart, true } // SetPortRangeStart sets field value func (o *FirewallruleProperties) SetPortRangeStart(v int32) { + o.PortRangeStart = &v + } // HasPortRangeStart returns a boolean if a field has been set. @@ -324,8 +362,6 @@ func (o *FirewallruleProperties) HasPortRangeStart() bool { return false } - - // GetPortRangeEnd returns the PortRangeEnd field value // If the value is explicit nil, the zero value for int32 will be returned func (o *FirewallruleProperties) GetPortRangeEnd() *int32 { @@ -334,6 +370,7 @@ func (o *FirewallruleProperties) GetPortRangeEnd() *int32 { } return o.PortRangeEnd + } // GetPortRangeEndOk returns a tuple with the PortRangeEnd field value @@ -343,12 +380,15 @@ func (o *FirewallruleProperties) GetPortRangeEndOk() (*int32, bool) { if o == nil { return nil, false } + return o.PortRangeEnd, true } // SetPortRangeEnd sets field value func (o *FirewallruleProperties) SetPortRangeEnd(v int32) { + o.PortRangeEnd = &v + } // HasPortRangeEnd returns a boolean if a field has been set. @@ -360,54 +400,66 @@ func (o *FirewallruleProperties) HasPortRangeEnd() bool { return false } +// GetType returns the Type field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FirewallruleProperties) GetType() *string { + if o == nil { + return nil + } -func (o FirewallruleProperties) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} + return o.Type - if o.Name != nil { - toSerialize["name"] = o.Name - } - +} - if o.Protocol != nil { - toSerialize["protocol"] = o.Protocol +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FirewallruleProperties) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false } - - if o.SourceMac != nil { - toSerialize["sourceMac"] = o.SourceMac - } - + return o.Type, true +} - if o.SourceIp != nil { - toSerialize["sourceIp"] = o.SourceIp - } - +// SetType sets field value +func (o *FirewallruleProperties) SetType(v string) { - if o.TargetIp != nil { - toSerialize["targetIp"] = o.TargetIp - } - + o.Type = &v - if o.IcmpCode != nil { - toSerialize["icmpCode"] = o.IcmpCode - } - +} - if o.IcmpType != nil { - toSerialize["icmpType"] = o.IcmpType +// HasType returns a boolean if a field has been set. +func (o *FirewallruleProperties) HasType() bool { + if o != nil && o.Type != nil { + return true } - + return false +} + +func (o FirewallruleProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Protocol != nil { + toSerialize["protocol"] = o.Protocol + } + toSerialize["sourceMac"] = o.SourceMac + toSerialize["sourceIp"] = o.SourceIp + toSerialize["targetIp"] = o.TargetIp + toSerialize["icmpCode"] = o.IcmpCode + toSerialize["icmpType"] = o.IcmpType if o.PortRangeStart != nil { toSerialize["portRangeStart"] = o.PortRangeStart } - - if o.PortRangeEnd != nil { toSerialize["portRangeEnd"] = o.PortRangeEnd } - + if o.Type != nil { + toSerialize["type"] = o.Type + } return json.Marshal(toSerialize) } @@ -446,5 +498,3 @@ func (v *NullableFirewallruleProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log.go new file mode 100644 index 000000000000..ca6a5435c9a5 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log.go @@ -0,0 +1,293 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// FlowLog struct for FlowLog +type FlowLog struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *FlowLogProperties `json:"properties"` +} + +// NewFlowLog instantiates a new FlowLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowLog(properties FlowLogProperties) *FlowLog { + this := FlowLog{} + + this.Properties = &properties + + return &this +} + +// NewFlowLogWithDefaults instantiates a new FlowLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowLogWithDefaults() *FlowLog { + this := FlowLog{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLog) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLog) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *FlowLog) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *FlowLog) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *FlowLog) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLog) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *FlowLog) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *FlowLog) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLog) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLog) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *FlowLog) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *FlowLog) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *FlowLog) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLog) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *FlowLog) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *FlowLog) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for FlowLogProperties will be returned +func (o *FlowLog) GetProperties() *FlowLogProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLog) GetPropertiesOk() (*FlowLogProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *FlowLog) SetProperties(v FlowLogProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *FlowLog) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o FlowLog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableFlowLog struct { + value *FlowLog + isSet bool +} + +func (v NullableFlowLog) Get() *FlowLog { + return v.value +} + +func (v *NullableFlowLog) Set(val *FlowLog) { + v.value = val + v.isSet = true +} + +func (v NullableFlowLog) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowLog(val *FlowLog) *NullableFlowLog { + return &NullableFlowLog{value: val, isSet: true} +} + +func (v NullableFlowLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_properties.go new file mode 100644 index 000000000000..7d3df9fae7cd --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_properties.go @@ -0,0 +1,255 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// FlowLogProperties struct for FlowLogProperties +type FlowLogProperties struct { + // The name of the resource. + Name *string `json:"name"` + // Specifies the traffic action pattern. + Action *string `json:"action"` + // Specifies the traffic direction pattern. + Direction *string `json:"direction"` + // S3 bucket name of an existing IONOS Cloud S3 bucket. + Bucket *string `json:"bucket"` +} + +// NewFlowLogProperties instantiates a new FlowLogProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowLogProperties(name string, action string, direction string, bucket string) *FlowLogProperties { + this := FlowLogProperties{} + + this.Name = &name + this.Action = &action + this.Direction = &direction + this.Bucket = &bucket + + return &this +} + +// NewFlowLogPropertiesWithDefaults instantiates a new FlowLogProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowLogPropertiesWithDefaults() *FlowLogProperties { + this := FlowLogProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *FlowLogProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *FlowLogProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetAction returns the Action field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogProperties) GetAction() *string { + if o == nil { + return nil + } + + return o.Action + +} + +// GetActionOk returns a tuple with the Action 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 *FlowLogProperties) GetActionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Action, true +} + +// SetAction sets field value +func (o *FlowLogProperties) SetAction(v string) { + + o.Action = &v + +} + +// HasAction returns a boolean if a field has been set. +func (o *FlowLogProperties) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// GetDirection returns the Direction field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogProperties) GetDirection() *string { + if o == nil { + return nil + } + + return o.Direction + +} + +// GetDirectionOk returns a tuple with the Direction 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 *FlowLogProperties) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Direction, true +} + +// SetDirection sets field value +func (o *FlowLogProperties) SetDirection(v string) { + + o.Direction = &v + +} + +// HasDirection returns a boolean if a field has been set. +func (o *FlowLogProperties) HasDirection() bool { + if o != nil && o.Direction != nil { + return true + } + + return false +} + +// GetBucket returns the Bucket field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogProperties) GetBucket() *string { + if o == nil { + return nil + } + + return o.Bucket + +} + +// GetBucketOk returns a tuple with the Bucket 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 *FlowLogProperties) GetBucketOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Bucket, true +} + +// SetBucket sets field value +func (o *FlowLogProperties) SetBucket(v string) { + + o.Bucket = &v + +} + +// HasBucket returns a boolean if a field has been set. +func (o *FlowLogProperties) HasBucket() bool { + if o != nil && o.Bucket != nil { + return true + } + + return false +} + +func (o FlowLogProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Action != nil { + toSerialize["action"] = o.Action + } + if o.Direction != nil { + toSerialize["direction"] = o.Direction + } + if o.Bucket != nil { + toSerialize["bucket"] = o.Bucket + } + return json.Marshal(toSerialize) +} + +type NullableFlowLogProperties struct { + value *FlowLogProperties + isSet bool +} + +func (v NullableFlowLogProperties) Get() *FlowLogProperties { + return v.value +} + +func (v *NullableFlowLogProperties) Set(val *FlowLogProperties) { + v.value = val + v.isSet = true +} + +func (v NullableFlowLogProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowLogProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowLogProperties(val *FlowLogProperties) *NullableFlowLogProperties { + return &NullableFlowLogProperties{value: val, isSet: true} +} + +func (v NullableFlowLogProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowLogProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_put.go new file mode 100644 index 000000000000..8f9b7f77781f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_log_put.go @@ -0,0 +1,251 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// FlowLogPut struct for FlowLogPut +type FlowLogPut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *FlowLogProperties `json:"properties"` +} + +// NewFlowLogPut instantiates a new FlowLogPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowLogPut(properties FlowLogProperties) *FlowLogPut { + this := FlowLogPut{} + + this.Properties = &properties + + return &this +} + +// NewFlowLogPutWithDefaults instantiates a new FlowLogPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowLogPutWithDefaults() *FlowLogPut { + this := FlowLogPut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogPut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogPut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *FlowLogPut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *FlowLogPut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *FlowLogPut) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogPut) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *FlowLogPut) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *FlowLogPut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogPut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogPut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *FlowLogPut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *FlowLogPut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for FlowLogProperties will be returned +func (o *FlowLogPut) GetProperties() *FlowLogProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogPut) GetPropertiesOk() (*FlowLogProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *FlowLogPut) SetProperties(v FlowLogProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *FlowLogPut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o FlowLogPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableFlowLogPut struct { + value *FlowLogPut + isSet bool +} + +func (v NullableFlowLogPut) Get() *FlowLogPut { + return v.value +} + +func (v *NullableFlowLogPut) Set(val *FlowLogPut) { + v.value = val + v.isSet = true +} + +func (v NullableFlowLogPut) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowLogPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowLogPut(val *FlowLogPut) *NullableFlowLogPut { + return &NullableFlowLogPut{value: val, isSet: true} +} + +func (v NullableFlowLogPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowLogPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_logs.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_logs.go new file mode 100644 index 000000000000..6ecbeac2b06f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_flow_logs.go @@ -0,0 +1,378 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// FlowLogs struct for FlowLogs +type FlowLogs struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]FlowLog `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewFlowLogs instantiates a new FlowLogs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowLogs() *FlowLogs { + this := FlowLogs{} + + return &this +} + +// NewFlowLogsWithDefaults instantiates a new FlowLogs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowLogsWithDefaults() *FlowLogs { + this := FlowLogs{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogs) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *FlowLogs) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *FlowLogs) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *FlowLogs) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *FlowLogs) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *FlowLogs) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FlowLogs) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *FlowLogs) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *FlowLogs) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []FlowLog will be returned +func (o *FlowLogs) GetItems() *[]FlowLog { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *FlowLogs) GetItemsOk() (*[]FlowLog, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *FlowLogs) SetItems(v []FlowLog) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *FlowLogs) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *FlowLogs) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *FlowLogs) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *FlowLogs) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *FlowLogs) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *FlowLogs) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *FlowLogs) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *FlowLogs) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FlowLogs) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *FlowLogs) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *FlowLogs) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o FlowLogs) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableFlowLogs struct { + value *FlowLogs + isSet bool +} + +func (v NullableFlowLogs) Get() *FlowLogs { + return v.value +} + +func (v *NullableFlowLogs) Set(val *FlowLogs) { + v.value = val + v.isSet = true +} + +func (v NullableFlowLogs) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowLogs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowLogs(val *FlowLogs) *NullableFlowLogs { + return &NullableFlowLogs{value: val, isSet: true} +} + +func (v NullableFlowLogs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowLogs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group.go index c8d4c1a54b62..a1e9b6781a9c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Group struct for Group type Group struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` Properties *GroupProperties `json:"properties"` - Entities *GroupEntities `json:"entities,omitempty"` + Entities *GroupEntities `json:"entities,omitempty"` } +// NewGroup instantiates a new Group object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroup(properties GroupProperties) *Group { + this := Group{} + this.Properties = &properties + + return &this +} + +// NewGroupWithDefaults instantiates a new Group object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupWithDefaults() *Group { + this := Group{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Group) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Group) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Group) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Group) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Group) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Group) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Group) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Group) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Group) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Group) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Group) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Group) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Group) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Group) HasHref() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for GroupProperties will be returned func (o *Group) GetProperties() *GroupProperties { @@ -144,6 +168,7 @@ func (o *Group) GetProperties() *GroupProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -153,12 +178,15 @@ func (o *Group) GetPropertiesOk() (*GroupProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Group) SetProperties(v GroupProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Group) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for GroupEntities will be returned func (o *Group) GetEntities() *GroupEntities { @@ -180,6 +206,7 @@ func (o *Group) GetEntities() *GroupEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -189,12 +216,15 @@ func (o *Group) GetEntitiesOk() (*GroupEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Group) SetEntities(v GroupEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Group) HasEntities() bool { return false } - func (o Group) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_entities.go index f1b6f9d1b41a..067e84cac6db 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,11 +16,27 @@ import ( // GroupEntities struct for GroupEntities type GroupEntities struct { - Users *GroupMembers `json:"users,omitempty"` + Users *GroupMembers `json:"users,omitempty"` Resources *ResourceGroups `json:"resources,omitempty"` } +// NewGroupEntities instantiates a new GroupEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupEntities() *GroupEntities { + this := GroupEntities{} + return &this +} + +// NewGroupEntitiesWithDefaults instantiates a new GroupEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupEntitiesWithDefaults() *GroupEntities { + this := GroupEntities{} + return &this +} // GetUsers returns the Users field value // If the value is explicit nil, the zero value for GroupMembers will be returned @@ -30,6 +46,7 @@ func (o *GroupEntities) GetUsers() *GroupMembers { } return o.Users + } // GetUsersOk returns a tuple with the Users field value @@ -39,12 +56,15 @@ func (o *GroupEntities) GetUsersOk() (*GroupMembers, bool) { if o == nil { return nil, false } + return o.Users, true } // SetUsers sets field value func (o *GroupEntities) SetUsers(v GroupMembers) { + o.Users = &v + } // HasUsers returns a boolean if a field has been set. @@ -56,8 +76,6 @@ func (o *GroupEntities) HasUsers() bool { return false } - - // GetResources returns the Resources field value // If the value is explicit nil, the zero value for ResourceGroups will be returned func (o *GroupEntities) GetResources() *ResourceGroups { @@ -66,6 +84,7 @@ func (o *GroupEntities) GetResources() *ResourceGroups { } return o.Resources + } // GetResourcesOk returns a tuple with the Resources field value @@ -75,12 +94,15 @@ func (o *GroupEntities) GetResourcesOk() (*ResourceGroups, bool) { if o == nil { return nil, false } + return o.Resources, true } // SetResources sets field value func (o *GroupEntities) SetResources(v ResourceGroups) { + o.Resources = &v + } // HasResources returns a boolean if a field has been set. @@ -92,19 +114,14 @@ func (o *GroupEntities) HasResources() bool { return false } - func (o GroupEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Users != nil { toSerialize["users"] = o.Users } - - if o.Resources != nil { toSerialize["resources"] = o.Resources } - return json.Marshal(toSerialize) } @@ -143,5 +160,3 @@ func (v *NullableGroupEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_members.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_members.go index a1df808df3b0..c38d7c018f7b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_members.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_members.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // GroupMembers struct for GroupMembers type GroupMembers struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]User `json:"items,omitempty"` } +// NewGroupMembers instantiates a new GroupMembers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupMembers() *GroupMembers { + this := GroupMembers{} + return &this +} + +// NewGroupMembersWithDefaults instantiates a new GroupMembers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupMembersWithDefaults() *GroupMembers { + this := GroupMembers{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *GroupMembers) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *GroupMembers) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *GroupMembers) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *GroupMembers) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *GroupMembers) GetType() *Type { @@ -72,6 +90,7 @@ func (o *GroupMembers) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *GroupMembers) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *GroupMembers) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *GroupMembers) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *GroupMembers) GetHref() *string { @@ -108,6 +128,7 @@ func (o *GroupMembers) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *GroupMembers) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *GroupMembers) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *GroupMembers) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []User will be returned func (o *GroupMembers) GetItems() *[]User { @@ -144,6 +166,7 @@ func (o *GroupMembers) GetItems() *[]User { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *GroupMembers) GetItemsOk() (*[]User, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *GroupMembers) SetItems(v []User) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *GroupMembers) HasItems() bool { return false } - func (o GroupMembers) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableGroupMembers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_properties.go index bbf75293b64a..a7f78f84c13d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,29 +16,51 @@ import ( // GroupProperties struct for GroupProperties type GroupProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // create data center privilege + // Create data center privilege. CreateDataCenter *bool `json:"createDataCenter,omitempty"` - // create snapshot privilege + // Create snapshot privilege. CreateSnapshot *bool `json:"createSnapshot,omitempty"` - // reserve ip block privilege + // Reserve IP block privilege. ReserveIp *bool `json:"reserveIp,omitempty"` - // activity log access privilege + // Activity log access privilege. AccessActivityLog *bool `json:"accessActivityLog,omitempty"` - // create pcc privilege + // Create pcc privilege. CreatePcc *bool `json:"createPcc,omitempty"` - // S3 privilege + // S3 privilege. S3Privilege *bool `json:"s3Privilege,omitempty"` - // create backup unit privilege + // Create backup unit privilege. CreateBackupUnit *bool `json:"createBackupUnit,omitempty"` - // create internet access privilege + // Create internet access privilege. CreateInternetAccess *bool `json:"createInternetAccess,omitempty"` - // create kubernetes cluster privilege + // Create Kubernetes cluster privilege. CreateK8sCluster *bool `json:"createK8sCluster,omitempty"` + // Create Flow Logs privilege. + CreateFlowLog *bool `json:"createFlowLog,omitempty"` + // Privilege for a group to access and manage monitoring related functionality (access metrics, CRUD on alarms, alarm-actions etc) using Monotoring-as-a-Service (MaaS). + AccessAndManageMonitoring *bool `json:"accessAndManageMonitoring,omitempty"` + // Privilege for a group to access and manage certificates. + AccessAndManageCertificates *bool `json:"accessAndManageCertificates,omitempty"` } +// NewGroupProperties instantiates a new GroupProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupProperties() *GroupProperties { + this := GroupProperties{} + return &this +} + +// NewGroupPropertiesWithDefaults instantiates a new GroupProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupPropertiesWithDefaults() *GroupProperties { + this := GroupProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -48,6 +70,7 @@ func (o *GroupProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -57,12 +80,15 @@ func (o *GroupProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *GroupProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -74,8 +100,6 @@ func (o *GroupProperties) HasName() bool { return false } - - // GetCreateDataCenter returns the CreateDataCenter field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreateDataCenter() *bool { @@ -84,6 +108,7 @@ func (o *GroupProperties) GetCreateDataCenter() *bool { } return o.CreateDataCenter + } // GetCreateDataCenterOk returns a tuple with the CreateDataCenter field value @@ -93,12 +118,15 @@ func (o *GroupProperties) GetCreateDataCenterOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreateDataCenter, true } // SetCreateDataCenter sets field value func (o *GroupProperties) SetCreateDataCenter(v bool) { + o.CreateDataCenter = &v + } // HasCreateDataCenter returns a boolean if a field has been set. @@ -110,8 +138,6 @@ func (o *GroupProperties) HasCreateDataCenter() bool { return false } - - // GetCreateSnapshot returns the CreateSnapshot field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreateSnapshot() *bool { @@ -120,6 +146,7 @@ func (o *GroupProperties) GetCreateSnapshot() *bool { } return o.CreateSnapshot + } // GetCreateSnapshotOk returns a tuple with the CreateSnapshot field value @@ -129,12 +156,15 @@ func (o *GroupProperties) GetCreateSnapshotOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreateSnapshot, true } // SetCreateSnapshot sets field value func (o *GroupProperties) SetCreateSnapshot(v bool) { + o.CreateSnapshot = &v + } // HasCreateSnapshot returns a boolean if a field has been set. @@ -146,8 +176,6 @@ func (o *GroupProperties) HasCreateSnapshot() bool { return false } - - // GetReserveIp returns the ReserveIp field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetReserveIp() *bool { @@ -156,6 +184,7 @@ func (o *GroupProperties) GetReserveIp() *bool { } return o.ReserveIp + } // GetReserveIpOk returns a tuple with the ReserveIp field value @@ -165,12 +194,15 @@ func (o *GroupProperties) GetReserveIpOk() (*bool, bool) { if o == nil { return nil, false } + return o.ReserveIp, true } // SetReserveIp sets field value func (o *GroupProperties) SetReserveIp(v bool) { + o.ReserveIp = &v + } // HasReserveIp returns a boolean if a field has been set. @@ -182,8 +214,6 @@ func (o *GroupProperties) HasReserveIp() bool { return false } - - // GetAccessActivityLog returns the AccessActivityLog field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetAccessActivityLog() *bool { @@ -192,6 +222,7 @@ func (o *GroupProperties) GetAccessActivityLog() *bool { } return o.AccessActivityLog + } // GetAccessActivityLogOk returns a tuple with the AccessActivityLog field value @@ -201,12 +232,15 @@ func (o *GroupProperties) GetAccessActivityLogOk() (*bool, bool) { if o == nil { return nil, false } + return o.AccessActivityLog, true } // SetAccessActivityLog sets field value func (o *GroupProperties) SetAccessActivityLog(v bool) { + o.AccessActivityLog = &v + } // HasAccessActivityLog returns a boolean if a field has been set. @@ -218,8 +252,6 @@ func (o *GroupProperties) HasAccessActivityLog() bool { return false } - - // GetCreatePcc returns the CreatePcc field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreatePcc() *bool { @@ -228,6 +260,7 @@ func (o *GroupProperties) GetCreatePcc() *bool { } return o.CreatePcc + } // GetCreatePccOk returns a tuple with the CreatePcc field value @@ -237,12 +270,15 @@ func (o *GroupProperties) GetCreatePccOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreatePcc, true } // SetCreatePcc sets field value func (o *GroupProperties) SetCreatePcc(v bool) { + o.CreatePcc = &v + } // HasCreatePcc returns a boolean if a field has been set. @@ -254,8 +290,6 @@ func (o *GroupProperties) HasCreatePcc() bool { return false } - - // GetS3Privilege returns the S3Privilege field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetS3Privilege() *bool { @@ -264,6 +298,7 @@ func (o *GroupProperties) GetS3Privilege() *bool { } return o.S3Privilege + } // GetS3PrivilegeOk returns a tuple with the S3Privilege field value @@ -273,12 +308,15 @@ func (o *GroupProperties) GetS3PrivilegeOk() (*bool, bool) { if o == nil { return nil, false } + return o.S3Privilege, true } // SetS3Privilege sets field value func (o *GroupProperties) SetS3Privilege(v bool) { + o.S3Privilege = &v + } // HasS3Privilege returns a boolean if a field has been set. @@ -290,8 +328,6 @@ func (o *GroupProperties) HasS3Privilege() bool { return false } - - // GetCreateBackupUnit returns the CreateBackupUnit field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreateBackupUnit() *bool { @@ -300,6 +336,7 @@ func (o *GroupProperties) GetCreateBackupUnit() *bool { } return o.CreateBackupUnit + } // GetCreateBackupUnitOk returns a tuple with the CreateBackupUnit field value @@ -309,12 +346,15 @@ func (o *GroupProperties) GetCreateBackupUnitOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreateBackupUnit, true } // SetCreateBackupUnit sets field value func (o *GroupProperties) SetCreateBackupUnit(v bool) { + o.CreateBackupUnit = &v + } // HasCreateBackupUnit returns a boolean if a field has been set. @@ -326,8 +366,6 @@ func (o *GroupProperties) HasCreateBackupUnit() bool { return false } - - // GetCreateInternetAccess returns the CreateInternetAccess field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreateInternetAccess() *bool { @@ -336,6 +374,7 @@ func (o *GroupProperties) GetCreateInternetAccess() *bool { } return o.CreateInternetAccess + } // GetCreateInternetAccessOk returns a tuple with the CreateInternetAccess field value @@ -345,12 +384,15 @@ func (o *GroupProperties) GetCreateInternetAccessOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreateInternetAccess, true } // SetCreateInternetAccess sets field value func (o *GroupProperties) SetCreateInternetAccess(v bool) { + o.CreateInternetAccess = &v + } // HasCreateInternetAccess returns a boolean if a field has been set. @@ -362,8 +404,6 @@ func (o *GroupProperties) HasCreateInternetAccess() bool { return false } - - // GetCreateK8sCluster returns the CreateK8sCluster field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupProperties) GetCreateK8sCluster() *bool { @@ -372,6 +412,7 @@ func (o *GroupProperties) GetCreateK8sCluster() *bool { } return o.CreateK8sCluster + } // GetCreateK8sClusterOk returns a tuple with the CreateK8sCluster field value @@ -381,12 +422,15 @@ func (o *GroupProperties) GetCreateK8sClusterOk() (*bool, bool) { if o == nil { return nil, false } + return o.CreateK8sCluster, true } // SetCreateK8sCluster sets field value func (o *GroupProperties) SetCreateK8sCluster(v bool) { + o.CreateK8sCluster = &v + } // HasCreateK8sCluster returns a boolean if a field has been set. @@ -398,59 +442,161 @@ func (o *GroupProperties) HasCreateK8sCluster() bool { return false } +// GetCreateFlowLog returns the CreateFlowLog field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *GroupProperties) GetCreateFlowLog() *bool { + if o == nil { + return nil + } + + return o.CreateFlowLog + +} + +// GetCreateFlowLogOk returns a tuple with the CreateFlowLog 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 *GroupProperties) GetCreateFlowLogOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.CreateFlowLog, true +} + +// SetCreateFlowLog sets field value +func (o *GroupProperties) SetCreateFlowLog(v bool) { + + o.CreateFlowLog = &v + +} + +// HasCreateFlowLog returns a boolean if a field has been set. +func (o *GroupProperties) HasCreateFlowLog() bool { + if o != nil && o.CreateFlowLog != nil { + return true + } + + return false +} + +// GetAccessAndManageMonitoring returns the AccessAndManageMonitoring field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *GroupProperties) GetAccessAndManageMonitoring() *bool { + if o == nil { + return nil + } + + return o.AccessAndManageMonitoring + +} + +// GetAccessAndManageMonitoringOk returns a tuple with the AccessAndManageMonitoring 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 *GroupProperties) GetAccessAndManageMonitoringOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.AccessAndManageMonitoring, true +} + +// SetAccessAndManageMonitoring sets field value +func (o *GroupProperties) SetAccessAndManageMonitoring(v bool) { + + o.AccessAndManageMonitoring = &v + +} + +// HasAccessAndManageMonitoring returns a boolean if a field has been set. +func (o *GroupProperties) HasAccessAndManageMonitoring() bool { + if o != nil && o.AccessAndManageMonitoring != nil { + return true + } + + return false +} + +// GetAccessAndManageCertificates returns the AccessAndManageCertificates field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *GroupProperties) GetAccessAndManageCertificates() *bool { + if o == nil { + return nil + } + + return o.AccessAndManageCertificates + +} + +// GetAccessAndManageCertificatesOk returns a tuple with the AccessAndManageCertificates 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 *GroupProperties) GetAccessAndManageCertificatesOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.AccessAndManageCertificates, true +} + +// SetAccessAndManageCertificates sets field value +func (o *GroupProperties) SetAccessAndManageCertificates(v bool) { + + o.AccessAndManageCertificates = &v + +} + +// HasAccessAndManageCertificates returns a boolean if a field has been set. +func (o *GroupProperties) HasAccessAndManageCertificates() bool { + if o != nil && o.AccessAndManageCertificates != nil { + return true + } + + return false +} func (o GroupProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.CreateDataCenter != nil { toSerialize["createDataCenter"] = o.CreateDataCenter } - - if o.CreateSnapshot != nil { toSerialize["createSnapshot"] = o.CreateSnapshot } - - if o.ReserveIp != nil { toSerialize["reserveIp"] = o.ReserveIp } - - if o.AccessActivityLog != nil { toSerialize["accessActivityLog"] = o.AccessActivityLog } - - if o.CreatePcc != nil { toSerialize["createPcc"] = o.CreatePcc } - - if o.S3Privilege != nil { toSerialize["s3Privilege"] = o.S3Privilege } - - if o.CreateBackupUnit != nil { toSerialize["createBackupUnit"] = o.CreateBackupUnit } - - if o.CreateInternetAccess != nil { toSerialize["createInternetAccess"] = o.CreateInternetAccess } - - if o.CreateK8sCluster != nil { toSerialize["createK8sCluster"] = o.CreateK8sCluster } - + if o.CreateFlowLog != nil { + toSerialize["createFlowLog"] = o.CreateFlowLog + } + if o.AccessAndManageMonitoring != nil { + toSerialize["accessAndManageMonitoring"] = o.AccessAndManageMonitoring + } + if o.AccessAndManageCertificates != nil { + toSerialize["accessAndManageCertificates"] = o.AccessAndManageCertificates + } return json.Marshal(toSerialize) } @@ -489,5 +635,3 @@ func (v *NullableGroupProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share.go index 943a582591dd..a25a874a3792 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,16 +16,34 @@ import ( // GroupShare struct for GroupShare type GroupShare struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` // resource as generic type Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` Properties *GroupShareProperties `json:"properties"` } +// NewGroupShare instantiates a new GroupShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupShare(properties GroupShareProperties) *GroupShare { + this := GroupShare{} + this.Properties = &properties + + return &this +} + +// NewGroupShareWithDefaults instantiates a new GroupShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupShareWithDefaults() *GroupShare { + this := GroupShare{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -35,6 +53,7 @@ func (o *GroupShare) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -44,12 +63,15 @@ func (o *GroupShare) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *GroupShare) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -61,8 +83,6 @@ func (o *GroupShare) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *GroupShare) GetType() *Type { @@ -71,6 +91,7 @@ func (o *GroupShare) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -80,12 +101,15 @@ func (o *GroupShare) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *GroupShare) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -97,8 +121,6 @@ func (o *GroupShare) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *GroupShare) GetHref() *string { @@ -107,6 +129,7 @@ func (o *GroupShare) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -116,12 +139,15 @@ func (o *GroupShare) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *GroupShare) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -133,8 +159,6 @@ func (o *GroupShare) HasHref() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for GroupShareProperties will be returned func (o *GroupShare) GetProperties() *GroupShareProperties { @@ -143,6 +167,7 @@ func (o *GroupShare) GetProperties() *GroupShareProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -152,12 +177,15 @@ func (o *GroupShare) GetPropertiesOk() (*GroupShareProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *GroupShare) SetProperties(v GroupShareProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -169,29 +197,20 @@ func (o *GroupShare) HasProperties() bool { return false } - func (o GroupShare) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -230,5 +249,3 @@ func (v *NullableGroupShare) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share_properties.go index d5dfce78ffb7..5e356c127b1b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_share_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -22,7 +22,23 @@ type GroupShareProperties struct { SharePrivilege *bool `json:"sharePrivilege,omitempty"` } +// NewGroupShareProperties instantiates a new GroupShareProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupShareProperties() *GroupShareProperties { + this := GroupShareProperties{} + return &this +} + +// NewGroupSharePropertiesWithDefaults instantiates a new GroupShareProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSharePropertiesWithDefaults() *GroupShareProperties { + this := GroupShareProperties{} + return &this +} // GetEditPrivilege returns the EditPrivilege field value // If the value is explicit nil, the zero value for bool will be returned @@ -32,6 +48,7 @@ func (o *GroupShareProperties) GetEditPrivilege() *bool { } return o.EditPrivilege + } // GetEditPrivilegeOk returns a tuple with the EditPrivilege field value @@ -41,12 +58,15 @@ func (o *GroupShareProperties) GetEditPrivilegeOk() (*bool, bool) { if o == nil { return nil, false } + return o.EditPrivilege, true } // SetEditPrivilege sets field value func (o *GroupShareProperties) SetEditPrivilege(v bool) { + o.EditPrivilege = &v + } // HasEditPrivilege returns a boolean if a field has been set. @@ -58,8 +78,6 @@ func (o *GroupShareProperties) HasEditPrivilege() bool { return false } - - // GetSharePrivilege returns the SharePrivilege field value // If the value is explicit nil, the zero value for bool will be returned func (o *GroupShareProperties) GetSharePrivilege() *bool { @@ -68,6 +86,7 @@ func (o *GroupShareProperties) GetSharePrivilege() *bool { } return o.SharePrivilege + } // GetSharePrivilegeOk returns a tuple with the SharePrivilege field value @@ -77,12 +96,15 @@ func (o *GroupShareProperties) GetSharePrivilegeOk() (*bool, bool) { if o == nil { return nil, false } + return o.SharePrivilege, true } // SetSharePrivilege sets field value func (o *GroupShareProperties) SetSharePrivilege(v bool) { + o.SharePrivilege = &v + } // HasSharePrivilege returns a boolean if a field has been set. @@ -94,19 +116,14 @@ func (o *GroupShareProperties) HasSharePrivilege() bool { return false } - func (o GroupShareProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.EditPrivilege != nil { toSerialize["editPrivilege"] = o.EditPrivilege } - - if o.SharePrivilege != nil { toSerialize["sharePrivilege"] = o.SharePrivilege } - return json.Marshal(toSerialize) } @@ -145,5 +162,3 @@ func (v *NullableGroupShareProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_shares.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_shares.go index 1c3a6910af70..6735473c8729 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_shares.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_shares.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // GroupShares struct for GroupShares type GroupShares struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` // Share representing groups and resource relationship Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]GroupShare `json:"items,omitempty"` } +// NewGroupShares instantiates a new GroupShares object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupShares() *GroupShares { + this := GroupShares{} + return &this +} + +// NewGroupSharesWithDefaults instantiates a new GroupShares object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSharesWithDefaults() *GroupShares { + this := GroupShares{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *GroupShares) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *GroupShares) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *GroupShares) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *GroupShares) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *GroupShares) GetType() *Type { @@ -72,6 +90,7 @@ func (o *GroupShares) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *GroupShares) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *GroupShares) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *GroupShares) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *GroupShares) GetHref() *string { @@ -108,6 +128,7 @@ func (o *GroupShares) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *GroupShares) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *GroupShares) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *GroupShares) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []GroupShare will be returned func (o *GroupShares) GetItems() *[]GroupShare { @@ -144,6 +166,7 @@ func (o *GroupShares) GetItems() *[]GroupShare { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *GroupShares) GetItemsOk() (*[]GroupShare, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *GroupShares) SetItems(v []GroupShare) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *GroupShares) HasItems() bool { return false } - func (o GroupShares) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableGroupShares) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_users.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_users.go index 503655e6d9c2..a2fb51bc2bba 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_users.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_group_users.go @@ -1,32 +1,48 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" ) -// GroupUsers collection of groups a user is member of +// GroupUsers Collection of the groups the user is a member of. type GroupUsers struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Group `json:"items,omitempty"` } +// NewGroupUsers instantiates a new GroupUsers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupUsers() *GroupUsers { + this := GroupUsers{} + return &this +} + +// NewGroupUsersWithDefaults instantiates a new GroupUsers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupUsersWithDefaults() *GroupUsers { + this := GroupUsers{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *GroupUsers) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *GroupUsers) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *GroupUsers) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *GroupUsers) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *GroupUsers) GetType() *Type { @@ -72,6 +90,7 @@ func (o *GroupUsers) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *GroupUsers) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *GroupUsers) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *GroupUsers) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *GroupUsers) GetHref() *string { @@ -108,6 +128,7 @@ func (o *GroupUsers) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *GroupUsers) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *GroupUsers) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *GroupUsers) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Group will be returned func (o *GroupUsers) GetItems() *[]Group { @@ -144,6 +166,7 @@ func (o *GroupUsers) GetItems() *[]Group { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *GroupUsers) GetItemsOk() (*[]Group, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *GroupUsers) SetItems(v []Group) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *GroupUsers) HasItems() bool { return false } - func (o GroupUsers) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableGroupUsers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_groups.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_groups.go index 8b40fe7dab47..85df0a37de4d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_groups.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_groups.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // Groups struct for Groups type Groups struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Group `json:"items,omitempty"` } +// NewGroups instantiates a new Groups object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroups() *Groups { + this := Groups{} + return &this +} + +// NewGroupsWithDefaults instantiates a new Groups object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupsWithDefaults() *Groups { + this := Groups{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Groups) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Groups) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Groups) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Groups) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Groups) GetType() *Type { @@ -72,6 +90,7 @@ func (o *Groups) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Groups) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Groups) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Groups) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Groups) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Groups) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Groups) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Groups) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Groups) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Group will be returned func (o *Groups) GetItems() *[]Group { @@ -144,6 +166,7 @@ func (o *Groups) GetItems() *[]Group { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Groups) GetItemsOk() (*[]Group, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Groups) SetItems(v []Group) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Groups) HasItems() bool { return false } - func (o Groups) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableGroups) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image.go index 1740e3dcbb9e..747a0e9493cc 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Image struct for Image type Image struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *ImageProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *ImageProperties `json:"properties"` } +// NewImage instantiates a new Image object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImage(properties ImageProperties) *Image { + this := Image{} + this.Properties = &properties + + return &this +} + +// NewImageWithDefaults instantiates a new Image object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageWithDefaults() *Image { + this := Image{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Image) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Image) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Image) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Image) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Image) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Image) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Image) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Image) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Image) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Image) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Image) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Image) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Image) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Image) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Image) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *Image) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Image) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Image) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Image) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for ImageProperties will be returned func (o *Image) GetProperties() *ImageProperties { @@ -180,6 +206,7 @@ func (o *Image) GetProperties() *ImageProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Image) GetPropertiesOk() (*ImageProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Image) SetProperties(v ImageProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Image) HasProperties() bool { return false } - func (o Image) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableImage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image_properties.go index 7c277d3193f6..94cc7e9bacfe 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_image_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,43 +16,65 @@ import ( // ImageProperties struct for ImageProperties type ImageProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Human readable description + // Human-readable description. Description *string `json:"description,omitempty"` - // Location of that image/snapshot. + // Location of that image/snapshot. Location *string `json:"location,omitempty"` - // The size of the image in GB + // The size of the image in GB. Size *float32 `json:"size,omitempty"` - // Is capable of CPU hot plug (no reboot required) + // Hot-plug capable CPU (no reboot required). CpuHotPlug *bool `json:"cpuHotPlug,omitempty"` - // Is capable of CPU hot unplug (no reboot required) + // Hot-unplug capable CPU (no reboot required). CpuHotUnplug *bool `json:"cpuHotUnplug,omitempty"` - // Is capable of memory hot plug (no reboot required) + // Hot-plug capable RAM (no reboot required). RamHotPlug *bool `json:"ramHotPlug,omitempty"` - // Is capable of memory hot unplug (no reboot required) + // Hot-unplug capable RAM (no reboot required). RamHotUnplug *bool `json:"ramHotUnplug,omitempty"` - // Is capable of nic hot plug (no reboot required) + // Hot-plug capable NIC (no reboot required). NicHotPlug *bool `json:"nicHotPlug,omitempty"` - // Is capable of nic hot unplug (no reboot required) + // Hot-unplug capable NIC (no reboot required). NicHotUnplug *bool `json:"nicHotUnplug,omitempty"` - // Is capable of Virt-IO drive hot plug (no reboot required) + // Hot-plug capable Virt-IO drive (no reboot required). DiscVirtioHotPlug *bool `json:"discVirtioHotPlug,omitempty"` - // Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines. + // Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs. DiscVirtioHotUnplug *bool `json:"discVirtioHotUnplug,omitempty"` - // Is capable of SCSI drive hot plug (no reboot required) + // Hot-plug capable SCSI drive (no reboot required). DiscScsiHotPlug *bool `json:"discScsiHotPlug,omitempty"` - // Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines. + // Hot-unplug capable SCSI drive (no reboot required). Not supported with Windows VMs. DiscScsiHotUnplug *bool `json:"discScsiHotUnplug,omitempty"` - // OS type of this Image + // OS type for this image. LicenceType *string `json:"licenceType"` - // This indicates the type of image + // The image type. ImageType *string `json:"imageType,omitempty"` - // Indicates if the image is part of the public repository or not + // Indicates whether the image is part of a public repository. Public *bool `json:"public,omitempty"` + // List of image aliases mapped for this Image + ImageAliases *[]string `json:"imageAliases,omitempty"` + // Cloud init compatibility. + CloudInit *string `json:"cloudInit,omitempty"` } +// NewImageProperties instantiates a new ImageProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageProperties(licenceType string) *ImageProperties { + this := ImageProperties{} + this.LicenceType = &licenceType + + return &this +} + +// NewImagePropertiesWithDefaults instantiates a new ImageProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImagePropertiesWithDefaults() *ImageProperties { + this := ImageProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -62,6 +84,7 @@ func (o *ImageProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -71,12 +94,15 @@ func (o *ImageProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *ImageProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -88,8 +114,6 @@ func (o *ImageProperties) HasName() bool { return false } - - // GetDescription returns the Description field value // If the value is explicit nil, the zero value for string will be returned func (o *ImageProperties) GetDescription() *string { @@ -98,6 +122,7 @@ func (o *ImageProperties) GetDescription() *string { } return o.Description + } // GetDescriptionOk returns a tuple with the Description field value @@ -107,12 +132,15 @@ func (o *ImageProperties) GetDescriptionOk() (*string, bool) { if o == nil { return nil, false } + return o.Description, true } // SetDescription sets field value func (o *ImageProperties) SetDescription(v string) { + o.Description = &v + } // HasDescription returns a boolean if a field has been set. @@ -124,8 +152,6 @@ func (o *ImageProperties) HasDescription() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *ImageProperties) GetLocation() *string { @@ -134,6 +160,7 @@ func (o *ImageProperties) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -143,12 +170,15 @@ func (o *ImageProperties) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *ImageProperties) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -160,8 +190,6 @@ func (o *ImageProperties) HasLocation() bool { return false } - - // GetSize returns the Size field value // If the value is explicit nil, the zero value for float32 will be returned func (o *ImageProperties) GetSize() *float32 { @@ -170,6 +198,7 @@ func (o *ImageProperties) GetSize() *float32 { } return o.Size + } // GetSizeOk returns a tuple with the Size field value @@ -179,12 +208,15 @@ func (o *ImageProperties) GetSizeOk() (*float32, bool) { if o == nil { return nil, false } + return o.Size, true } // SetSize sets field value func (o *ImageProperties) SetSize(v float32) { + o.Size = &v + } // HasSize returns a boolean if a field has been set. @@ -196,8 +228,6 @@ func (o *ImageProperties) HasSize() bool { return false } - - // GetCpuHotPlug returns the CpuHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetCpuHotPlug() *bool { @@ -206,6 +236,7 @@ func (o *ImageProperties) GetCpuHotPlug() *bool { } return o.CpuHotPlug + } // GetCpuHotPlugOk returns a tuple with the CpuHotPlug field value @@ -215,12 +246,15 @@ func (o *ImageProperties) GetCpuHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.CpuHotPlug, true } // SetCpuHotPlug sets field value func (o *ImageProperties) SetCpuHotPlug(v bool) { + o.CpuHotPlug = &v + } // HasCpuHotPlug returns a boolean if a field has been set. @@ -232,8 +266,6 @@ func (o *ImageProperties) HasCpuHotPlug() bool { return false } - - // GetCpuHotUnplug returns the CpuHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetCpuHotUnplug() *bool { @@ -242,6 +274,7 @@ func (o *ImageProperties) GetCpuHotUnplug() *bool { } return o.CpuHotUnplug + } // GetCpuHotUnplugOk returns a tuple with the CpuHotUnplug field value @@ -251,12 +284,15 @@ func (o *ImageProperties) GetCpuHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.CpuHotUnplug, true } // SetCpuHotUnplug sets field value func (o *ImageProperties) SetCpuHotUnplug(v bool) { + o.CpuHotUnplug = &v + } // HasCpuHotUnplug returns a boolean if a field has been set. @@ -268,8 +304,6 @@ func (o *ImageProperties) HasCpuHotUnplug() bool { return false } - - // GetRamHotPlug returns the RamHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetRamHotPlug() *bool { @@ -278,6 +312,7 @@ func (o *ImageProperties) GetRamHotPlug() *bool { } return o.RamHotPlug + } // GetRamHotPlugOk returns a tuple with the RamHotPlug field value @@ -287,12 +322,15 @@ func (o *ImageProperties) GetRamHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.RamHotPlug, true } // SetRamHotPlug sets field value func (o *ImageProperties) SetRamHotPlug(v bool) { + o.RamHotPlug = &v + } // HasRamHotPlug returns a boolean if a field has been set. @@ -304,8 +342,6 @@ func (o *ImageProperties) HasRamHotPlug() bool { return false } - - // GetRamHotUnplug returns the RamHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetRamHotUnplug() *bool { @@ -314,6 +350,7 @@ func (o *ImageProperties) GetRamHotUnplug() *bool { } return o.RamHotUnplug + } // GetRamHotUnplugOk returns a tuple with the RamHotUnplug field value @@ -323,12 +360,15 @@ func (o *ImageProperties) GetRamHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.RamHotUnplug, true } // SetRamHotUnplug sets field value func (o *ImageProperties) SetRamHotUnplug(v bool) { + o.RamHotUnplug = &v + } // HasRamHotUnplug returns a boolean if a field has been set. @@ -340,8 +380,6 @@ func (o *ImageProperties) HasRamHotUnplug() bool { return false } - - // GetNicHotPlug returns the NicHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetNicHotPlug() *bool { @@ -350,6 +388,7 @@ func (o *ImageProperties) GetNicHotPlug() *bool { } return o.NicHotPlug + } // GetNicHotPlugOk returns a tuple with the NicHotPlug field value @@ -359,12 +398,15 @@ func (o *ImageProperties) GetNicHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotPlug, true } // SetNicHotPlug sets field value func (o *ImageProperties) SetNicHotPlug(v bool) { + o.NicHotPlug = &v + } // HasNicHotPlug returns a boolean if a field has been set. @@ -376,8 +418,6 @@ func (o *ImageProperties) HasNicHotPlug() bool { return false } - - // GetNicHotUnplug returns the NicHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetNicHotUnplug() *bool { @@ -386,6 +426,7 @@ func (o *ImageProperties) GetNicHotUnplug() *bool { } return o.NicHotUnplug + } // GetNicHotUnplugOk returns a tuple with the NicHotUnplug field value @@ -395,12 +436,15 @@ func (o *ImageProperties) GetNicHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotUnplug, true } // SetNicHotUnplug sets field value func (o *ImageProperties) SetNicHotUnplug(v bool) { + o.NicHotUnplug = &v + } // HasNicHotUnplug returns a boolean if a field has been set. @@ -412,8 +456,6 @@ func (o *ImageProperties) HasNicHotUnplug() bool { return false } - - // GetDiscVirtioHotPlug returns the DiscVirtioHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetDiscVirtioHotPlug() *bool { @@ -422,6 +464,7 @@ func (o *ImageProperties) GetDiscVirtioHotPlug() *bool { } return o.DiscVirtioHotPlug + } // GetDiscVirtioHotPlugOk returns a tuple with the DiscVirtioHotPlug field value @@ -431,12 +474,15 @@ func (o *ImageProperties) GetDiscVirtioHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotPlug, true } // SetDiscVirtioHotPlug sets field value func (o *ImageProperties) SetDiscVirtioHotPlug(v bool) { + o.DiscVirtioHotPlug = &v + } // HasDiscVirtioHotPlug returns a boolean if a field has been set. @@ -448,8 +494,6 @@ func (o *ImageProperties) HasDiscVirtioHotPlug() bool { return false } - - // GetDiscVirtioHotUnplug returns the DiscVirtioHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetDiscVirtioHotUnplug() *bool { @@ -458,6 +502,7 @@ func (o *ImageProperties) GetDiscVirtioHotUnplug() *bool { } return o.DiscVirtioHotUnplug + } // GetDiscVirtioHotUnplugOk returns a tuple with the DiscVirtioHotUnplug field value @@ -467,12 +512,15 @@ func (o *ImageProperties) GetDiscVirtioHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotUnplug, true } // SetDiscVirtioHotUnplug sets field value func (o *ImageProperties) SetDiscVirtioHotUnplug(v bool) { + o.DiscVirtioHotUnplug = &v + } // HasDiscVirtioHotUnplug returns a boolean if a field has been set. @@ -484,8 +532,6 @@ func (o *ImageProperties) HasDiscVirtioHotUnplug() bool { return false } - - // GetDiscScsiHotPlug returns the DiscScsiHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetDiscScsiHotPlug() *bool { @@ -494,6 +540,7 @@ func (o *ImageProperties) GetDiscScsiHotPlug() *bool { } return o.DiscScsiHotPlug + } // GetDiscScsiHotPlugOk returns a tuple with the DiscScsiHotPlug field value @@ -503,12 +550,15 @@ func (o *ImageProperties) GetDiscScsiHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscScsiHotPlug, true } // SetDiscScsiHotPlug sets field value func (o *ImageProperties) SetDiscScsiHotPlug(v bool) { + o.DiscScsiHotPlug = &v + } // HasDiscScsiHotPlug returns a boolean if a field has been set. @@ -520,8 +570,6 @@ func (o *ImageProperties) HasDiscScsiHotPlug() bool { return false } - - // GetDiscScsiHotUnplug returns the DiscScsiHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetDiscScsiHotUnplug() *bool { @@ -530,6 +578,7 @@ func (o *ImageProperties) GetDiscScsiHotUnplug() *bool { } return o.DiscScsiHotUnplug + } // GetDiscScsiHotUnplugOk returns a tuple with the DiscScsiHotUnplug field value @@ -539,12 +588,15 @@ func (o *ImageProperties) GetDiscScsiHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscScsiHotUnplug, true } // SetDiscScsiHotUnplug sets field value func (o *ImageProperties) SetDiscScsiHotUnplug(v bool) { + o.DiscScsiHotUnplug = &v + } // HasDiscScsiHotUnplug returns a boolean if a field has been set. @@ -556,8 +608,6 @@ func (o *ImageProperties) HasDiscScsiHotUnplug() bool { return false } - - // GetLicenceType returns the LicenceType field value // If the value is explicit nil, the zero value for string will be returned func (o *ImageProperties) GetLicenceType() *string { @@ -566,6 +616,7 @@ func (o *ImageProperties) GetLicenceType() *string { } return o.LicenceType + } // GetLicenceTypeOk returns a tuple with the LicenceType field value @@ -575,12 +626,15 @@ func (o *ImageProperties) GetLicenceTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.LicenceType, true } // SetLicenceType sets field value func (o *ImageProperties) SetLicenceType(v string) { + o.LicenceType = &v + } // HasLicenceType returns a boolean if a field has been set. @@ -592,8 +646,6 @@ func (o *ImageProperties) HasLicenceType() bool { return false } - - // GetImageType returns the ImageType field value // If the value is explicit nil, the zero value for string will be returned func (o *ImageProperties) GetImageType() *string { @@ -602,6 +654,7 @@ func (o *ImageProperties) GetImageType() *string { } return o.ImageType + } // GetImageTypeOk returns a tuple with the ImageType field value @@ -611,12 +664,15 @@ func (o *ImageProperties) GetImageTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.ImageType, true } // SetImageType sets field value func (o *ImageProperties) SetImageType(v string) { + o.ImageType = &v + } // HasImageType returns a boolean if a field has been set. @@ -628,8 +684,6 @@ func (o *ImageProperties) HasImageType() bool { return false } - - // GetPublic returns the Public field value // If the value is explicit nil, the zero value for bool will be returned func (o *ImageProperties) GetPublic() *bool { @@ -638,6 +692,7 @@ func (o *ImageProperties) GetPublic() *bool { } return o.Public + } // GetPublicOk returns a tuple with the Public field value @@ -647,12 +702,15 @@ func (o *ImageProperties) GetPublicOk() (*bool, bool) { if o == nil { return nil, false } + return o.Public, true } // SetPublic sets field value func (o *ImageProperties) SetPublic(v bool) { + o.Public = &v + } // HasPublic returns a boolean if a field has been set. @@ -664,94 +722,141 @@ func (o *ImageProperties) HasPublic() bool { return false } +// GetImageAliases returns the ImageAliases field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *ImageProperties) GetImageAliases() *[]string { + if o == nil { + return nil + } + + return o.ImageAliases + +} + +// GetImageAliasesOk returns a tuple with the ImageAliases 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 *ImageProperties) GetImageAliasesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.ImageAliases, true +} + +// SetImageAliases sets field value +func (o *ImageProperties) SetImageAliases(v []string) { + + o.ImageAliases = &v + +} + +// HasImageAliases returns a boolean if a field has been set. +func (o *ImageProperties) HasImageAliases() bool { + if o != nil && o.ImageAliases != nil { + return true + } + + return false +} + +// GetCloudInit returns the CloudInit field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ImageProperties) GetCloudInit() *string { + if o == nil { + return nil + } + + return o.CloudInit + +} + +// GetCloudInitOk returns a tuple with the CloudInit 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 *ImageProperties) GetCloudInitOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CloudInit, true +} + +// SetCloudInit sets field value +func (o *ImageProperties) SetCloudInit(v string) { + + o.CloudInit = &v + +} + +// HasCloudInit returns a boolean if a field has been set. +func (o *ImageProperties) HasCloudInit() bool { + if o != nil && o.CloudInit != nil { + return true + } + + return false +} func (o ImageProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Description != nil { toSerialize["description"] = o.Description } - - if o.Location != nil { toSerialize["location"] = o.Location } - - if o.Size != nil { toSerialize["size"] = o.Size } - - if o.CpuHotPlug != nil { toSerialize["cpuHotPlug"] = o.CpuHotPlug } - - if o.CpuHotUnplug != nil { toSerialize["cpuHotUnplug"] = o.CpuHotUnplug } - - if o.RamHotPlug != nil { toSerialize["ramHotPlug"] = o.RamHotPlug } - - if o.RamHotUnplug != nil { toSerialize["ramHotUnplug"] = o.RamHotUnplug } - - if o.NicHotPlug != nil { toSerialize["nicHotPlug"] = o.NicHotPlug } - - if o.NicHotUnplug != nil { toSerialize["nicHotUnplug"] = o.NicHotUnplug } - - if o.DiscVirtioHotPlug != nil { toSerialize["discVirtioHotPlug"] = o.DiscVirtioHotPlug } - - if o.DiscVirtioHotUnplug != nil { toSerialize["discVirtioHotUnplug"] = o.DiscVirtioHotUnplug } - - if o.DiscScsiHotPlug != nil { toSerialize["discScsiHotPlug"] = o.DiscScsiHotPlug } - - if o.DiscScsiHotUnplug != nil { toSerialize["discScsiHotUnplug"] = o.DiscScsiHotUnplug } - - if o.LicenceType != nil { toSerialize["licenceType"] = o.LicenceType } - - if o.ImageType != nil { toSerialize["imageType"] = o.ImageType } - - if o.Public != nil { toSerialize["public"] = o.Public } - + if o.ImageAliases != nil { + toSerialize["imageAliases"] = o.ImageAliases + } + if o.CloudInit != nil { + toSerialize["cloudInit"] = o.CloudInit + } return json.Marshal(toSerialize) } @@ -790,5 +895,3 @@ func (v *NullableImageProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_images.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_images.go index 014b165f06ec..42276184cf8b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_images.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_images.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // Images struct for Images type Images struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Image `json:"items,omitempty"` } +// NewImages instantiates a new Images object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImages() *Images { + this := Images{} + return &this +} + +// NewImagesWithDefaults instantiates a new Images object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImagesWithDefaults() *Images { + this := Images{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Images) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Images) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Images) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Images) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Images) GetType() *Type { @@ -72,6 +90,7 @@ func (o *Images) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Images) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Images) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Images) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Images) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Images) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Images) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Images) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Images) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Image will be returned func (o *Images) GetItems() *[]Image { @@ -144,6 +166,7 @@ func (o *Images) GetItems() *[]Image { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Images) GetItemsOk() (*[]Image, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Images) SetItems(v []Image) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Images) HasItems() bool { return false } - func (o Images) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableImages) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_info.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_info.go index e07988ee7243..123accc0b853 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_info.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_info.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -24,7 +24,23 @@ type Info struct { Version *string `json:"version,omitempty"` } +// NewInfo instantiates a new Info object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInfo() *Info { + this := Info{} + return &this +} + +// NewInfoWithDefaults instantiates a new Info object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInfoWithDefaults() *Info { + this := Info{} + return &this +} // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +50,7 @@ func (o *Info) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -43,12 +60,15 @@ func (o *Info) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Info) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -60,8 +80,6 @@ func (o *Info) HasHref() bool { return false } - - // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned func (o *Info) GetName() *string { @@ -70,6 +88,7 @@ func (o *Info) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -79,12 +98,15 @@ func (o *Info) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *Info) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -96,8 +118,6 @@ func (o *Info) HasName() bool { return false } - - // GetVersion returns the Version field value // If the value is explicit nil, the zero value for string will be returned func (o *Info) GetVersion() *string { @@ -106,6 +126,7 @@ func (o *Info) GetVersion() *string { } return o.Version + } // GetVersionOk returns a tuple with the Version field value @@ -115,12 +136,15 @@ func (o *Info) GetVersionOk() (*string, bool) { if o == nil { return nil, false } + return o.Version, true } // SetVersion sets field value func (o *Info) SetVersion(v string) { + o.Version = &v + } // HasVersion returns a boolean if a field has been set. @@ -132,24 +156,17 @@ func (o *Info) HasVersion() bool { return false } - func (o Info) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Version != nil { toSerialize["version"] = o.Version } - return json.Marshal(toSerialize) } @@ -188,5 +205,3 @@ func (v *NullableInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block.go index f9cd95bc29a6..af07f6fb18fb 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // IpBlock struct for IpBlock type IpBlock struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *IpBlockProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *IpBlockProperties `json:"properties"` } +// NewIpBlock instantiates a new IpBlock object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIpBlock(properties IpBlockProperties) *IpBlock { + this := IpBlock{} + this.Properties = &properties + + return &this +} + +// NewIpBlockWithDefaults instantiates a new IpBlock object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIpBlockWithDefaults() *IpBlock { + this := IpBlock{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *IpBlock) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *IpBlock) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *IpBlock) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *IpBlock) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *IpBlock) GetType() *Type { @@ -72,6 +92,7 @@ func (o *IpBlock) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *IpBlock) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *IpBlock) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *IpBlock) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *IpBlock) GetHref() *string { @@ -108,6 +130,7 @@ func (o *IpBlock) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *IpBlock) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *IpBlock) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *IpBlock) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *IpBlock) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *IpBlock) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *IpBlock) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *IpBlock) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *IpBlock) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for IpBlockProperties will be returned func (o *IpBlock) GetProperties() *IpBlockProperties { @@ -180,6 +206,7 @@ func (o *IpBlock) GetProperties() *IpBlockProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *IpBlock) GetPropertiesOk() (*IpBlockProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *IpBlock) SetProperties(v IpBlockProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *IpBlock) HasProperties() bool { return false } - func (o IpBlock) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableIpBlock) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block_properties.go index 14fde442d401..4f732b53b2a7 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_block_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,19 +16,38 @@ import ( // IpBlockProperties struct for IpBlockProperties type IpBlockProperties struct { - // A collection of IPs associated with the IP Block + // Collection of IPs, associated with the IP Block. Ips *[]string `json:"ips,omitempty"` - // Location of that IP Block. Property cannot be modified after creation (disallowed in update requests) + // Location of that IP block. Property cannot be modified after it is created (disallowed in update requests). Location *string `json:"location"` - // The size of the IP block + // The size of the IP block. Size *int32 `json:"size"` - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Read-Only attribute. Lists consumption detail of an individual ip + // Read-Only attribute. Lists consumption detail for an individual IP IpConsumers *[]IpConsumer `json:"ipConsumers,omitempty"` } +// NewIpBlockProperties instantiates a new IpBlockProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIpBlockProperties(location string, size int32) *IpBlockProperties { + this := IpBlockProperties{} + this.Location = &location + this.Size = &size + + return &this +} + +// NewIpBlockPropertiesWithDefaults instantiates a new IpBlockProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIpBlockPropertiesWithDefaults() *IpBlockProperties { + this := IpBlockProperties{} + return &this +} // GetIps returns the Ips field value // If the value is explicit nil, the zero value for []string will be returned @@ -38,6 +57,7 @@ func (o *IpBlockProperties) GetIps() *[]string { } return o.Ips + } // GetIpsOk returns a tuple with the Ips field value @@ -47,12 +67,15 @@ func (o *IpBlockProperties) GetIpsOk() (*[]string, bool) { if o == nil { return nil, false } + return o.Ips, true } // SetIps sets field value func (o *IpBlockProperties) SetIps(v []string) { + o.Ips = &v + } // HasIps returns a boolean if a field has been set. @@ -64,8 +87,6 @@ func (o *IpBlockProperties) HasIps() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *IpBlockProperties) GetLocation() *string { @@ -74,6 +95,7 @@ func (o *IpBlockProperties) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -83,12 +105,15 @@ func (o *IpBlockProperties) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *IpBlockProperties) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -100,8 +125,6 @@ func (o *IpBlockProperties) HasLocation() bool { return false } - - // GetSize returns the Size field value // If the value is explicit nil, the zero value for int32 will be returned func (o *IpBlockProperties) GetSize() *int32 { @@ -110,6 +133,7 @@ func (o *IpBlockProperties) GetSize() *int32 { } return o.Size + } // GetSizeOk returns a tuple with the Size field value @@ -119,12 +143,15 @@ func (o *IpBlockProperties) GetSizeOk() (*int32, bool) { if o == nil { return nil, false } + return o.Size, true } // SetSize sets field value func (o *IpBlockProperties) SetSize(v int32) { + o.Size = &v + } // HasSize returns a boolean if a field has been set. @@ -136,8 +163,6 @@ func (o *IpBlockProperties) HasSize() bool { return false } - - // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned func (o *IpBlockProperties) GetName() *string { @@ -146,6 +171,7 @@ func (o *IpBlockProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -155,12 +181,15 @@ func (o *IpBlockProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *IpBlockProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -172,8 +201,6 @@ func (o *IpBlockProperties) HasName() bool { return false } - - // GetIpConsumers returns the IpConsumers field value // If the value is explicit nil, the zero value for []IpConsumer will be returned func (o *IpBlockProperties) GetIpConsumers() *[]IpConsumer { @@ -182,6 +209,7 @@ func (o *IpBlockProperties) GetIpConsumers() *[]IpConsumer { } return o.IpConsumers + } // GetIpConsumersOk returns a tuple with the IpConsumers field value @@ -191,12 +219,15 @@ func (o *IpBlockProperties) GetIpConsumersOk() (*[]IpConsumer, bool) { if o == nil { return nil, false } + return o.IpConsumers, true } // SetIpConsumers sets field value func (o *IpBlockProperties) SetIpConsumers(v []IpConsumer) { + o.IpConsumers = &v + } // HasIpConsumers returns a boolean if a field has been set. @@ -208,34 +239,23 @@ func (o *IpBlockProperties) HasIpConsumers() bool { return false } - func (o IpBlockProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Ips != nil { toSerialize["ips"] = o.Ips } - - if o.Location != nil { toSerialize["location"] = o.Location } - - if o.Size != nil { toSerialize["size"] = o.Size } - - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.IpConsumers != nil { toSerialize["ipConsumers"] = o.IpConsumers } - return json.Marshal(toSerialize) } @@ -274,5 +294,3 @@ func (v *NullableIpBlockProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_blocks.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_blocks.go index a74f91534614..010dc17fea08 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_blocks.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_blocks.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // IpBlocks struct for IpBlocks type IpBlocks struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]IpBlock `json:"items,omitempty"` + // The offset, specified in the request (if not is specified, 0 is used by default). + Offset *float32 `json:"offset,omitempty"` + // The limit, specified in the request (if not specified, the endpoint's default pagination limit is used). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewIpBlocks instantiates a new IpBlocks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIpBlocks() *IpBlocks { + this := IpBlocks{} + return &this +} + +// NewIpBlocksWithDefaults instantiates a new IpBlocks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIpBlocksWithDefaults() *IpBlocks { + this := IpBlocks{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *IpBlocks) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *IpBlocks) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *IpBlocks) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *IpBlocks) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *IpBlocks) GetType() *Type { @@ -72,6 +95,7 @@ func (o *IpBlocks) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *IpBlocks) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *IpBlocks) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *IpBlocks) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *IpBlocks) GetHref() *string { @@ -108,6 +133,7 @@ func (o *IpBlocks) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *IpBlocks) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *IpBlocks) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *IpBlocks) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []IpBlock will be returned func (o *IpBlocks) GetItems() *[]IpBlock { @@ -144,6 +171,7 @@ func (o *IpBlocks) GetItems() *[]IpBlock { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *IpBlocks) GetItemsOk() (*[]IpBlock, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *IpBlocks) SetItems(v []IpBlock) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *IpBlocks) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *IpBlocks) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IpBlocks) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *IpBlocks) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *IpBlocks) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *IpBlocks) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IpBlocks) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *IpBlocks) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *IpBlocks) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *IpBlocks) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IpBlocks) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *IpBlocks) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *IpBlocks) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o IpBlocks) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableIpBlocks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_consumer.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_consumer.go index cc70643256ab..a0e9e55c6d78 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_consumer.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_consumer.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,16 +16,34 @@ import ( // IpConsumer struct for IpConsumer type IpConsumer struct { - Ip *string `json:"ip,omitempty"` - Mac *string `json:"mac,omitempty"` - NicId *string `json:"nicId,omitempty"` - ServerId *string `json:"serverId,omitempty"` - ServerName *string `json:"serverName,omitempty"` - DatacenterId *string `json:"datacenterId,omitempty"` - DatacenterName *string `json:"datacenterName,omitempty"` + Ip *string `json:"ip,omitempty"` + Mac *string `json:"mac,omitempty"` + NicId *string `json:"nicId,omitempty"` + ServerId *string `json:"serverId,omitempty"` + ServerName *string `json:"serverName,omitempty"` + DatacenterId *string `json:"datacenterId,omitempty"` + DatacenterName *string `json:"datacenterName,omitempty"` + K8sNodePoolUuid *string `json:"k8sNodePoolUuid,omitempty"` + K8sClusterUuid *string `json:"k8sClusterUuid,omitempty"` } +// NewIpConsumer instantiates a new IpConsumer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIpConsumer() *IpConsumer { + this := IpConsumer{} + return &this +} + +// NewIpConsumerWithDefaults instantiates a new IpConsumer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIpConsumerWithDefaults() *IpConsumer { + this := IpConsumer{} + return &this +} // GetIp returns the Ip field value // If the value is explicit nil, the zero value for string will be returned @@ -35,6 +53,7 @@ func (o *IpConsumer) GetIp() *string { } return o.Ip + } // GetIpOk returns a tuple with the Ip field value @@ -44,12 +63,15 @@ func (o *IpConsumer) GetIpOk() (*string, bool) { if o == nil { return nil, false } + return o.Ip, true } // SetIp sets field value func (o *IpConsumer) SetIp(v string) { + o.Ip = &v + } // HasIp returns a boolean if a field has been set. @@ -61,8 +83,6 @@ func (o *IpConsumer) HasIp() bool { return false } - - // GetMac returns the Mac field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetMac() *string { @@ -71,6 +91,7 @@ func (o *IpConsumer) GetMac() *string { } return o.Mac + } // GetMacOk returns a tuple with the Mac field value @@ -80,12 +101,15 @@ func (o *IpConsumer) GetMacOk() (*string, bool) { if o == nil { return nil, false } + return o.Mac, true } // SetMac sets field value func (o *IpConsumer) SetMac(v string) { + o.Mac = &v + } // HasMac returns a boolean if a field has been set. @@ -97,8 +121,6 @@ func (o *IpConsumer) HasMac() bool { return false } - - // GetNicId returns the NicId field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetNicId() *string { @@ -107,6 +129,7 @@ func (o *IpConsumer) GetNicId() *string { } return o.NicId + } // GetNicIdOk returns a tuple with the NicId field value @@ -116,12 +139,15 @@ func (o *IpConsumer) GetNicIdOk() (*string, bool) { if o == nil { return nil, false } + return o.NicId, true } // SetNicId sets field value func (o *IpConsumer) SetNicId(v string) { + o.NicId = &v + } // HasNicId returns a boolean if a field has been set. @@ -133,8 +159,6 @@ func (o *IpConsumer) HasNicId() bool { return false } - - // GetServerId returns the ServerId field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetServerId() *string { @@ -143,6 +167,7 @@ func (o *IpConsumer) GetServerId() *string { } return o.ServerId + } // GetServerIdOk returns a tuple with the ServerId field value @@ -152,12 +177,15 @@ func (o *IpConsumer) GetServerIdOk() (*string, bool) { if o == nil { return nil, false } + return o.ServerId, true } // SetServerId sets field value func (o *IpConsumer) SetServerId(v string) { + o.ServerId = &v + } // HasServerId returns a boolean if a field has been set. @@ -169,8 +197,6 @@ func (o *IpConsumer) HasServerId() bool { return false } - - // GetServerName returns the ServerName field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetServerName() *string { @@ -179,6 +205,7 @@ func (o *IpConsumer) GetServerName() *string { } return o.ServerName + } // GetServerNameOk returns a tuple with the ServerName field value @@ -188,12 +215,15 @@ func (o *IpConsumer) GetServerNameOk() (*string, bool) { if o == nil { return nil, false } + return o.ServerName, true } // SetServerName sets field value func (o *IpConsumer) SetServerName(v string) { + o.ServerName = &v + } // HasServerName returns a boolean if a field has been set. @@ -205,8 +235,6 @@ func (o *IpConsumer) HasServerName() bool { return false } - - // GetDatacenterId returns the DatacenterId field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetDatacenterId() *string { @@ -215,6 +243,7 @@ func (o *IpConsumer) GetDatacenterId() *string { } return o.DatacenterId + } // GetDatacenterIdOk returns a tuple with the DatacenterId field value @@ -224,12 +253,15 @@ func (o *IpConsumer) GetDatacenterIdOk() (*string, bool) { if o == nil { return nil, false } + return o.DatacenterId, true } // SetDatacenterId sets field value func (o *IpConsumer) SetDatacenterId(v string) { + o.DatacenterId = &v + } // HasDatacenterId returns a boolean if a field has been set. @@ -241,8 +273,6 @@ func (o *IpConsumer) HasDatacenterId() bool { return false } - - // GetDatacenterName returns the DatacenterName field value // If the value is explicit nil, the zero value for string will be returned func (o *IpConsumer) GetDatacenterName() *string { @@ -251,6 +281,7 @@ func (o *IpConsumer) GetDatacenterName() *string { } return o.DatacenterName + } // GetDatacenterNameOk returns a tuple with the DatacenterName field value @@ -260,12 +291,15 @@ func (o *IpConsumer) GetDatacenterNameOk() (*string, bool) { if o == nil { return nil, false } + return o.DatacenterName, true } // SetDatacenterName sets field value func (o *IpConsumer) SetDatacenterName(v string) { + o.DatacenterName = &v + } // HasDatacenterName returns a boolean if a field has been set. @@ -277,44 +311,111 @@ func (o *IpConsumer) HasDatacenterName() bool { return false } +// GetK8sNodePoolUuid returns the K8sNodePoolUuid field value +// If the value is explicit nil, the zero value for string will be returned +func (o *IpConsumer) GetK8sNodePoolUuid() *string { + if o == nil { + return nil + } + + return o.K8sNodePoolUuid + +} + +// GetK8sNodePoolUuidOk returns a tuple with the K8sNodePoolUuid 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 *IpConsumer) GetK8sNodePoolUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.K8sNodePoolUuid, true +} + +// SetK8sNodePoolUuid sets field value +func (o *IpConsumer) SetK8sNodePoolUuid(v string) { + + o.K8sNodePoolUuid = &v + +} + +// HasK8sNodePoolUuid returns a boolean if a field has been set. +func (o *IpConsumer) HasK8sNodePoolUuid() bool { + if o != nil && o.K8sNodePoolUuid != nil { + return true + } + + return false +} + +// GetK8sClusterUuid returns the K8sClusterUuid field value +// If the value is explicit nil, the zero value for string will be returned +func (o *IpConsumer) GetK8sClusterUuid() *string { + if o == nil { + return nil + } + + return o.K8sClusterUuid + +} + +// GetK8sClusterUuidOk returns a tuple with the K8sClusterUuid 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 *IpConsumer) GetK8sClusterUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.K8sClusterUuid, true +} + +// SetK8sClusterUuid sets field value +func (o *IpConsumer) SetK8sClusterUuid(v string) { + + o.K8sClusterUuid = &v + +} + +// HasK8sClusterUuid returns a boolean if a field has been set. +func (o *IpConsumer) HasK8sClusterUuid() bool { + if o != nil && o.K8sClusterUuid != nil { + return true + } + + return false +} func (o IpConsumer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Ip != nil { toSerialize["ip"] = o.Ip } - - if o.Mac != nil { toSerialize["mac"] = o.Mac } - - if o.NicId != nil { toSerialize["nicId"] = o.NicId } - - if o.ServerId != nil { toSerialize["serverId"] = o.ServerId } - - if o.ServerName != nil { toSerialize["serverName"] = o.ServerName } - - if o.DatacenterId != nil { toSerialize["datacenterId"] = o.DatacenterId } - - if o.DatacenterName != nil { toSerialize["datacenterName"] = o.DatacenterName } - + if o.K8sNodePoolUuid != nil { + toSerialize["k8sNodePoolUuid"] = o.K8sNodePoolUuid + } + if o.K8sClusterUuid != nil { + toSerialize["k8sClusterUuid"] = o.K8sClusterUuid + } return json.Marshal(toSerialize) } @@ -353,5 +454,3 @@ func (v *NullableIpConsumer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_failover.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_failover.go index e2a3064516b4..16677e73e1a9 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_failover.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_ip_failover.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,11 +16,27 @@ import ( // IPFailover struct for IPFailover type IPFailover struct { - Ip *string `json:"ip,omitempty"` + Ip *string `json:"ip,omitempty"` NicUuid *string `json:"nicUuid,omitempty"` } +// NewIPFailover instantiates a new IPFailover object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPFailover() *IPFailover { + this := IPFailover{} + return &this +} + +// NewIPFailoverWithDefaults instantiates a new IPFailover object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPFailoverWithDefaults() *IPFailover { + this := IPFailover{} + return &this +} // GetIp returns the Ip field value // If the value is explicit nil, the zero value for string will be returned @@ -30,6 +46,7 @@ func (o *IPFailover) GetIp() *string { } return o.Ip + } // GetIpOk returns a tuple with the Ip field value @@ -39,12 +56,15 @@ func (o *IPFailover) GetIpOk() (*string, bool) { if o == nil { return nil, false } + return o.Ip, true } // SetIp sets field value func (o *IPFailover) SetIp(v string) { + o.Ip = &v + } // HasIp returns a boolean if a field has been set. @@ -56,8 +76,6 @@ func (o *IPFailover) HasIp() bool { return false } - - // GetNicUuid returns the NicUuid field value // If the value is explicit nil, the zero value for string will be returned func (o *IPFailover) GetNicUuid() *string { @@ -66,6 +84,7 @@ func (o *IPFailover) GetNicUuid() *string { } return o.NicUuid + } // GetNicUuidOk returns a tuple with the NicUuid field value @@ -75,12 +94,15 @@ func (o *IPFailover) GetNicUuidOk() (*string, bool) { if o == nil { return nil, false } + return o.NicUuid, true } // SetNicUuid sets field value func (o *IPFailover) SetNicUuid(v string) { + o.NicUuid = &v + } // HasNicUuid returns a boolean if a field has been set. @@ -92,19 +114,14 @@ func (o *IPFailover) HasNicUuid() bool { return false } - func (o IPFailover) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Ip != nil { toSerialize["ip"] = o.Ip } - - if o.NicUuid != nil { toSerialize["nicUuid"] = o.NicUuid } - return json.Marshal(toSerialize) } @@ -143,5 +160,3 @@ func (v *NullableIPFailover) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_auto_scaling.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_auto_scaling.go index 31084b780727..6ba3b8fde10e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_auto_scaling.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_auto_scaling.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,12 +17,31 @@ import ( // KubernetesAutoScaling struct for KubernetesAutoScaling type KubernetesAutoScaling struct { // The minimum number of worker nodes that the managed node group can scale in. Should be set together with 'maxNodeCount'. Value for this attribute must be greater than equal to 1 and less than equal to maxNodeCount. - MinNodeCount *int32 `json:"minNodeCount,omitempty"` + MinNodeCount *int32 `json:"minNodeCount"` // The maximum number of worker nodes that the managed node pool can scale-out. Should be set together with 'minNodeCount'. Value for this attribute must be greater than equal to 1 and minNodeCount. - MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` + MaxNodeCount *int32 `json:"maxNodeCount"` } +// NewKubernetesAutoScaling instantiates a new KubernetesAutoScaling object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesAutoScaling(minNodeCount int32, maxNodeCount int32) *KubernetesAutoScaling { + this := KubernetesAutoScaling{} + this.MinNodeCount = &minNodeCount + this.MaxNodeCount = &maxNodeCount + + return &this +} + +// NewKubernetesAutoScalingWithDefaults instantiates a new KubernetesAutoScaling object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesAutoScalingWithDefaults() *KubernetesAutoScaling { + this := KubernetesAutoScaling{} + return &this +} // GetMinNodeCount returns the MinNodeCount field value // If the value is explicit nil, the zero value for int32 will be returned @@ -32,6 +51,7 @@ func (o *KubernetesAutoScaling) GetMinNodeCount() *int32 { } return o.MinNodeCount + } // GetMinNodeCountOk returns a tuple with the MinNodeCount field value @@ -41,12 +61,15 @@ func (o *KubernetesAutoScaling) GetMinNodeCountOk() (*int32, bool) { if o == nil { return nil, false } + return o.MinNodeCount, true } // SetMinNodeCount sets field value func (o *KubernetesAutoScaling) SetMinNodeCount(v int32) { + o.MinNodeCount = &v + } // HasMinNodeCount returns a boolean if a field has been set. @@ -58,8 +81,6 @@ func (o *KubernetesAutoScaling) HasMinNodeCount() bool { return false } - - // GetMaxNodeCount returns the MaxNodeCount field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesAutoScaling) GetMaxNodeCount() *int32 { @@ -68,6 +89,7 @@ func (o *KubernetesAutoScaling) GetMaxNodeCount() *int32 { } return o.MaxNodeCount + } // GetMaxNodeCountOk returns a tuple with the MaxNodeCount field value @@ -77,12 +99,15 @@ func (o *KubernetesAutoScaling) GetMaxNodeCountOk() (*int32, bool) { if o == nil { return nil, false } + return o.MaxNodeCount, true } // SetMaxNodeCount sets field value func (o *KubernetesAutoScaling) SetMaxNodeCount(v int32) { + o.MaxNodeCount = &v + } // HasMaxNodeCount returns a boolean if a field has been set. @@ -94,19 +119,14 @@ func (o *KubernetesAutoScaling) HasMaxNodeCount() bool { return false } - func (o KubernetesAutoScaling) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MinNodeCount != nil { toSerialize["minNodeCount"] = o.MinNodeCount } - - if o.MaxNodeCount != nil { toSerialize["maxNodeCount"] = o.MaxNodeCount } - return json.Marshal(toSerialize) } @@ -145,5 +165,3 @@ func (v *NullableKubernetesAutoScaling) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster.go index 7e6bedda22a7..8931a1643bd9 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,16 +18,34 @@ import ( type KubernetesCluster struct { // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object + // The type of object. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` Properties *KubernetesClusterProperties `json:"properties"` - Entities *KubernetesClusterEntities `json:"entities,omitempty"` + Entities *KubernetesClusterEntities `json:"entities,omitempty"` } +// NewKubernetesCluster instantiates a new KubernetesCluster object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesCluster(properties KubernetesClusterProperties) *KubernetesCluster { + this := KubernetesCluster{} + this.Properties = &properties + + return &this +} + +// NewKubernetesClusterWithDefaults instantiates a new KubernetesCluster object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterWithDefaults() *KubernetesCluster { + this := KubernetesCluster{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *KubernetesCluster) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *KubernetesCluster) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesCluster) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *KubernetesCluster) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesCluster) GetType() *string { @@ -73,6 +93,7 @@ func (o *KubernetesCluster) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *KubernetesCluster) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesCluster) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *KubernetesCluster) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesCluster) GetHref() *string { @@ -109,6 +131,7 @@ func (o *KubernetesCluster) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *KubernetesCluster) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesCluster) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *KubernetesCluster) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *KubernetesCluster) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *KubernetesCluster) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *KubernetesCluster) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *KubernetesCluster) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *KubernetesCluster) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for KubernetesClusterProperties will be returned func (o *KubernetesCluster) GetProperties() *KubernetesClusterProperties { @@ -181,6 +207,7 @@ func (o *KubernetesCluster) GetProperties() *KubernetesClusterProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *KubernetesCluster) GetPropertiesOk() (*KubernetesClusterProperties, boo if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *KubernetesCluster) SetProperties(v KubernetesClusterProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *KubernetesCluster) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for KubernetesClusterEntities will be returned func (o *KubernetesCluster) GetEntities() *KubernetesClusterEntities { @@ -217,6 +245,7 @@ func (o *KubernetesCluster) GetEntities() *KubernetesClusterEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *KubernetesCluster) GetEntitiesOk() (*KubernetesClusterEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *KubernetesCluster) SetEntities(v KubernetesClusterEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *KubernetesCluster) HasEntities() bool { return false } - func (o KubernetesCluster) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableKubernetesCluster) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_entities.go index 21f038e03486..3e5dbaf4dbe4 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -19,7 +19,23 @@ type KubernetesClusterEntities struct { Nodepools *KubernetesNodePools `json:"nodepools,omitempty"` } +// NewKubernetesClusterEntities instantiates a new KubernetesClusterEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterEntities() *KubernetesClusterEntities { + this := KubernetesClusterEntities{} + return &this +} + +// NewKubernetesClusterEntitiesWithDefaults instantiates a new KubernetesClusterEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterEntitiesWithDefaults() *KubernetesClusterEntities { + this := KubernetesClusterEntities{} + return &this +} // GetNodepools returns the Nodepools field value // If the value is explicit nil, the zero value for KubernetesNodePools will be returned @@ -29,6 +45,7 @@ func (o *KubernetesClusterEntities) GetNodepools() *KubernetesNodePools { } return o.Nodepools + } // GetNodepoolsOk returns a tuple with the Nodepools field value @@ -38,12 +55,15 @@ func (o *KubernetesClusterEntities) GetNodepoolsOk() (*KubernetesNodePools, bool if o == nil { return nil, false } + return o.Nodepools, true } // SetNodepools sets field value func (o *KubernetesClusterEntities) SetNodepools(v KubernetesNodePools) { + o.Nodepools = &v + } // HasNodepools returns a boolean if a field has been set. @@ -55,14 +75,11 @@ func (o *KubernetesClusterEntities) HasNodepools() bool { return false } - func (o KubernetesClusterEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Nodepools != nil { toSerialize["nodepools"] = o.Nodepools } - return json.Marshal(toSerialize) } @@ -101,5 +118,3 @@ func (v *NullableKubernetesClusterEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_post.go new file mode 100644 index 000000000000..8f375515a0a5 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_post.go @@ -0,0 +1,335 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesClusterForPost struct for KubernetesClusterForPost +type KubernetesClusterForPost struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object. + Type *string `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *KubernetesClusterPropertiesForPost `json:"properties"` + Entities *KubernetesClusterEntities `json:"entities,omitempty"` +} + +// NewKubernetesClusterForPost instantiates a new KubernetesClusterForPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterForPost(properties KubernetesClusterPropertiesForPost) *KubernetesClusterForPost { + this := KubernetesClusterForPost{} + + this.Properties = &properties + + return &this +} + +// NewKubernetesClusterForPostWithDefaults instantiates a new KubernetesClusterForPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterForPostWithDefaults() *KubernetesClusterForPost { + this := KubernetesClusterForPost{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPost) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPost) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *KubernetesClusterForPost) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPost) GetType() *string { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPost) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *KubernetesClusterForPost) SetType(v string) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPost) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPost) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *KubernetesClusterForPost) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *KubernetesClusterForPost) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPost) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *KubernetesClusterForPost) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for KubernetesClusterPropertiesForPost will be returned +func (o *KubernetesClusterForPost) GetProperties() *KubernetesClusterPropertiesForPost { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPost) GetPropertiesOk() (*KubernetesClusterPropertiesForPost, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *KubernetesClusterForPost) SetProperties(v KubernetesClusterPropertiesForPost) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// GetEntities returns the Entities field value +// If the value is explicit nil, the zero value for KubernetesClusterEntities will be returned +func (o *KubernetesClusterForPost) GetEntities() *KubernetesClusterEntities { + if o == nil { + return nil + } + + return o.Entities + +} + +// GetEntitiesOk returns a tuple with the Entities 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 *KubernetesClusterForPost) GetEntitiesOk() (*KubernetesClusterEntities, bool) { + if o == nil { + return nil, false + } + + return o.Entities, true +} + +// SetEntities sets field value +func (o *KubernetesClusterForPost) SetEntities(v KubernetesClusterEntities) { + + o.Entities = &v + +} + +// HasEntities returns a boolean if a field has been set. +func (o *KubernetesClusterForPost) HasEntities() bool { + if o != nil && o.Entities != nil { + return true + } + + return false +} + +func (o KubernetesClusterForPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.Entities != nil { + toSerialize["entities"] = o.Entities + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesClusterForPost struct { + value *KubernetesClusterForPost + isSet bool +} + +func (v NullableKubernetesClusterForPost) Get() *KubernetesClusterForPost { + return v.value +} + +func (v *NullableKubernetesClusterForPost) Set(val *KubernetesClusterForPost) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesClusterForPost) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesClusterForPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesClusterForPost(val *KubernetesClusterForPost) *NullableKubernetesClusterForPost { + return &NullableKubernetesClusterForPost{value: val, isSet: true} +} + +func (v NullableKubernetesClusterForPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesClusterForPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_put.go new file mode 100644 index 000000000000..2873bf5c8603 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_for_put.go @@ -0,0 +1,335 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesClusterForPut struct for KubernetesClusterForPut +type KubernetesClusterForPut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object. + Type *string `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *KubernetesClusterPropertiesForPut `json:"properties"` + Entities *KubernetesClusterEntities `json:"entities,omitempty"` +} + +// NewKubernetesClusterForPut instantiates a new KubernetesClusterForPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterForPut(properties KubernetesClusterPropertiesForPut) *KubernetesClusterForPut { + this := KubernetesClusterForPut{} + + this.Properties = &properties + + return &this +} + +// NewKubernetesClusterForPutWithDefaults instantiates a new KubernetesClusterForPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterForPutWithDefaults() *KubernetesClusterForPut { + this := KubernetesClusterForPut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *KubernetesClusterForPut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPut) GetType() *string { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPut) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *KubernetesClusterForPut) SetType(v string) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterForPut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *KubernetesClusterForPut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *KubernetesClusterForPut) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPut) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *KubernetesClusterForPut) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for KubernetesClusterPropertiesForPut will be returned +func (o *KubernetesClusterForPut) GetProperties() *KubernetesClusterPropertiesForPut { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterForPut) GetPropertiesOk() (*KubernetesClusterPropertiesForPut, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *KubernetesClusterForPut) SetProperties(v KubernetesClusterPropertiesForPut) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// GetEntities returns the Entities field value +// If the value is explicit nil, the zero value for KubernetesClusterEntities will be returned +func (o *KubernetesClusterForPut) GetEntities() *KubernetesClusterEntities { + if o == nil { + return nil + } + + return o.Entities + +} + +// GetEntitiesOk returns a tuple with the Entities 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 *KubernetesClusterForPut) GetEntitiesOk() (*KubernetesClusterEntities, bool) { + if o == nil { + return nil, false + } + + return o.Entities, true +} + +// SetEntities sets field value +func (o *KubernetesClusterForPut) SetEntities(v KubernetesClusterEntities) { + + o.Entities = &v + +} + +// HasEntities returns a boolean if a field has been set. +func (o *KubernetesClusterForPut) HasEntities() bool { + if o != nil && o.Entities != nil { + return true + } + + return false +} + +func (o KubernetesClusterForPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.Entities != nil { + toSerialize["entities"] = o.Entities + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesClusterForPut struct { + value *KubernetesClusterForPut + isSet bool +} + +func (v NullableKubernetesClusterForPut) Get() *KubernetesClusterForPut { + return v.value +} + +func (v *NullableKubernetesClusterForPut) Set(val *KubernetesClusterForPut) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesClusterForPut) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesClusterForPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesClusterForPut(val *KubernetesClusterForPut) *NullableKubernetesClusterForPut { + return &NullableKubernetesClusterForPut{value: val, isSet: true} +} + +func (v NullableKubernetesClusterForPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesClusterForPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties.go index 0525a484ca0a..376f0d2870e5 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,14 +16,46 @@ import ( // KubernetesClusterProperties struct for KubernetesClusterProperties type KubernetesClusterProperties struct { - // A Kubernetes Cluster Name. Valid Kubernetes Cluster name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + // A Kubernetes cluster name. Valid Kubernetes cluster name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. Name *string `json:"name"` - // The kubernetes version in which a cluster is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions. - K8sVersion *string `json:"k8sVersion,omitempty"` + // The Kubernetes version the cluster is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` + // List of available versions for upgrading the cluster + AvailableUpgradeVersions *[]string `json:"availableUpgradeVersions,omitempty"` + // List of versions that may be used for node pools under this cluster + ViableNodePoolVersions *[]string `json:"viableNodePoolVersions,omitempty"` + // The indicator if the cluster is public or private. Be aware that setting it to false is currently in beta phase. + Public *bool `json:"public,omitempty"` + // Access to the K8s API server is restricted to these CIDRs. Traffic, internal to the cluster, is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value is used: 32 for IPv4 and 128 for IPv6. + ApiSubnetAllowList *[]string `json:"apiSubnetAllowList,omitempty"` + // List of S3 bucket configured for K8s usage. For now it contains only an S3 bucket used to store K8s API audit logs + S3Buckets *[]S3Bucket `json:"s3Buckets,omitempty"` } +// NewKubernetesClusterProperties instantiates a new KubernetesClusterProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterProperties(name string) *KubernetesClusterProperties { + this := KubernetesClusterProperties{} + this.Name = &name + var public bool = true + this.Public = &public + + return &this +} + +// NewKubernetesClusterPropertiesWithDefaults instantiates a new KubernetesClusterProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterPropertiesWithDefaults() *KubernetesClusterProperties { + this := KubernetesClusterProperties{} + var public bool = true + this.Public = &public + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -33,6 +65,7 @@ func (o *KubernetesClusterProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -42,12 +75,15 @@ func (o *KubernetesClusterProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *KubernetesClusterProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -59,8 +95,6 @@ func (o *KubernetesClusterProperties) HasName() bool { return false } - - // GetK8sVersion returns the K8sVersion field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesClusterProperties) GetK8sVersion() *string { @@ -69,6 +103,7 @@ func (o *KubernetesClusterProperties) GetK8sVersion() *string { } return o.K8sVersion + } // GetK8sVersionOk returns a tuple with the K8sVersion field value @@ -78,12 +113,15 @@ func (o *KubernetesClusterProperties) GetK8sVersionOk() (*string, bool) { if o == nil { return nil, false } + return o.K8sVersion, true } // SetK8sVersion sets field value func (o *KubernetesClusterProperties) SetK8sVersion(v string) { + o.K8sVersion = &v + } // HasK8sVersion returns a boolean if a field has been set. @@ -95,8 +133,6 @@ func (o *KubernetesClusterProperties) HasK8sVersion() bool { return false } - - // GetMaintenanceWindow returns the MaintenanceWindow field value // If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned func (o *KubernetesClusterProperties) GetMaintenanceWindow() *KubernetesMaintenanceWindow { @@ -105,6 +141,7 @@ func (o *KubernetesClusterProperties) GetMaintenanceWindow() *KubernetesMaintena } return o.MaintenanceWindow + } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value @@ -114,12 +151,15 @@ func (o *KubernetesClusterProperties) GetMaintenanceWindowOk() (*KubernetesMaint if o == nil { return nil, false } + return o.MaintenanceWindow, true } // SetMaintenanceWindow sets field value func (o *KubernetesClusterProperties) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + o.MaintenanceWindow = &v + } // HasMaintenanceWindow returns a boolean if a field has been set. @@ -131,24 +171,222 @@ func (o *KubernetesClusterProperties) HasMaintenanceWindow() bool { return false } +// GetAvailableUpgradeVersions returns the AvailableUpgradeVersions field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesClusterProperties) GetAvailableUpgradeVersions() *[]string { + if o == nil { + return nil + } + + return o.AvailableUpgradeVersions + +} + +// GetAvailableUpgradeVersionsOk returns a tuple with the AvailableUpgradeVersions 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 *KubernetesClusterProperties) GetAvailableUpgradeVersionsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.AvailableUpgradeVersions, true +} + +// SetAvailableUpgradeVersions sets field value +func (o *KubernetesClusterProperties) SetAvailableUpgradeVersions(v []string) { + + o.AvailableUpgradeVersions = &v + +} + +// HasAvailableUpgradeVersions returns a boolean if a field has been set. +func (o *KubernetesClusterProperties) HasAvailableUpgradeVersions() bool { + if o != nil && o.AvailableUpgradeVersions != nil { + return true + } + + return false +} + +// GetViableNodePoolVersions returns the ViableNodePoolVersions field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesClusterProperties) GetViableNodePoolVersions() *[]string { + if o == nil { + return nil + } + + return o.ViableNodePoolVersions + +} + +// GetViableNodePoolVersionsOk returns a tuple with the ViableNodePoolVersions 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 *KubernetesClusterProperties) GetViableNodePoolVersionsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.ViableNodePoolVersions, true +} + +// SetViableNodePoolVersions sets field value +func (o *KubernetesClusterProperties) SetViableNodePoolVersions(v []string) { + + o.ViableNodePoolVersions = &v + +} + +// HasViableNodePoolVersions returns a boolean if a field has been set. +func (o *KubernetesClusterProperties) HasViableNodePoolVersions() bool { + if o != nil && o.ViableNodePoolVersions != nil { + return true + } + + return false +} + +// GetPublic returns the Public field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *KubernetesClusterProperties) GetPublic() *bool { + if o == nil { + return nil + } + + return o.Public + +} + +// GetPublicOk returns a tuple with the Public 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 *KubernetesClusterProperties) GetPublicOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Public, true +} + +// SetPublic sets field value +func (o *KubernetesClusterProperties) SetPublic(v bool) { + + o.Public = &v + +} + +// HasPublic returns a boolean if a field has been set. +func (o *KubernetesClusterProperties) HasPublic() bool { + if o != nil && o.Public != nil { + return true + } + + return false +} + +// GetApiSubnetAllowList returns the ApiSubnetAllowList field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesClusterProperties) GetApiSubnetAllowList() *[]string { + if o == nil { + return nil + } + + return o.ApiSubnetAllowList + +} + +// GetApiSubnetAllowListOk returns a tuple with the ApiSubnetAllowList 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 *KubernetesClusterProperties) GetApiSubnetAllowListOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.ApiSubnetAllowList, true +} + +// SetApiSubnetAllowList sets field value +func (o *KubernetesClusterProperties) SetApiSubnetAllowList(v []string) { + + o.ApiSubnetAllowList = &v + +} + +// HasApiSubnetAllowList returns a boolean if a field has been set. +func (o *KubernetesClusterProperties) HasApiSubnetAllowList() bool { + if o != nil && o.ApiSubnetAllowList != nil { + return true + } + + return false +} + +// GetS3Buckets returns the S3Buckets field value +// If the value is explicit nil, the zero value for []S3Bucket will be returned +func (o *KubernetesClusterProperties) GetS3Buckets() *[]S3Bucket { + if o == nil { + return nil + } + + return o.S3Buckets + +} + +// GetS3BucketsOk returns a tuple with the S3Buckets 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 *KubernetesClusterProperties) GetS3BucketsOk() (*[]S3Bucket, bool) { + if o == nil { + return nil, false + } + + return o.S3Buckets, true +} + +// SetS3Buckets sets field value +func (o *KubernetesClusterProperties) SetS3Buckets(v []S3Bucket) { + + o.S3Buckets = &v + +} + +// HasS3Buckets returns a boolean if a field has been set. +func (o *KubernetesClusterProperties) HasS3Buckets() bool { + if o != nil && o.S3Buckets != nil { + return true + } + + return false +} func (o KubernetesClusterProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.K8sVersion != nil { toSerialize["k8sVersion"] = o.K8sVersion } - - if o.MaintenanceWindow != nil { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - + if o.AvailableUpgradeVersions != nil { + toSerialize["availableUpgradeVersions"] = o.AvailableUpgradeVersions + } + if o.ViableNodePoolVersions != nil { + toSerialize["viableNodePoolVersions"] = o.ViableNodePoolVersions + } + if o.Public != nil { + toSerialize["public"] = o.Public + } + if o.ApiSubnetAllowList != nil { + toSerialize["apiSubnetAllowList"] = o.ApiSubnetAllowList + } + if o.S3Buckets != nil { + toSerialize["s3Buckets"] = o.S3Buckets + } return json.Marshal(toSerialize) } @@ -187,5 +425,3 @@ func (v *NullableKubernetesClusterProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_post.go new file mode 100644 index 000000000000..42dfec53da8d --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_post.go @@ -0,0 +1,341 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesClusterPropertiesForPost struct for KubernetesClusterPropertiesForPost +type KubernetesClusterPropertiesForPost struct { + // A Kubernetes cluster name. Valid Kubernetes cluster name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + Name *string `json:"name"` + // The Kubernetes version the cluster is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` + MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` + // The indicator if the cluster is public or private. Be aware that setting it to false is currently in beta phase. + Public *bool `json:"public,omitempty"` + // Access to the K8s API server is restricted to these CIDRs. Traffic, internal to the cluster, is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value is used: 32 for IPv4 and 128 for IPv6. + ApiSubnetAllowList *[]string `json:"apiSubnetAllowList,omitempty"` + // List of S3 bucket configured for K8s usage. For now it contains only an S3 bucket used to store K8s API audit logs + S3Buckets *[]S3Bucket `json:"s3Buckets,omitempty"` +} + +// NewKubernetesClusterPropertiesForPost instantiates a new KubernetesClusterPropertiesForPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterPropertiesForPost(name string) *KubernetesClusterPropertiesForPost { + this := KubernetesClusterPropertiesForPost{} + + this.Name = &name + var public bool = true + this.Public = &public + + return &this +} + +// NewKubernetesClusterPropertiesForPostWithDefaults instantiates a new KubernetesClusterPropertiesForPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterPropertiesForPostWithDefaults() *KubernetesClusterPropertiesForPost { + this := KubernetesClusterPropertiesForPost{} + var public bool = true + this.Public = &public + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterPropertiesForPost) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterPropertiesForPost) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *KubernetesClusterPropertiesForPost) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetK8sVersion returns the K8sVersion field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterPropertiesForPost) GetK8sVersion() *string { + if o == nil { + return nil + } + + return o.K8sVersion + +} + +// GetK8sVersionOk returns a tuple with the K8sVersion 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 *KubernetesClusterPropertiesForPost) GetK8sVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.K8sVersion, true +} + +// SetK8sVersion sets field value +func (o *KubernetesClusterPropertiesForPost) SetK8sVersion(v string) { + + o.K8sVersion = &v + +} + +// HasK8sVersion returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasK8sVersion() bool { + if o != nil && o.K8sVersion != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned +func (o *KubernetesClusterPropertiesForPost) GetMaintenanceWindow() *KubernetesMaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *KubernetesClusterPropertiesForPost) GetMaintenanceWindowOk() (*KubernetesMaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *KubernetesClusterPropertiesForPost) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +// GetPublic returns the Public field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *KubernetesClusterPropertiesForPost) GetPublic() *bool { + if o == nil { + return nil + } + + return o.Public + +} + +// GetPublicOk returns a tuple with the Public 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 *KubernetesClusterPropertiesForPost) GetPublicOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Public, true +} + +// SetPublic sets field value +func (o *KubernetesClusterPropertiesForPost) SetPublic(v bool) { + + o.Public = &v + +} + +// HasPublic returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasPublic() bool { + if o != nil && o.Public != nil { + return true + } + + return false +} + +// GetApiSubnetAllowList returns the ApiSubnetAllowList field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesClusterPropertiesForPost) GetApiSubnetAllowList() *[]string { + if o == nil { + return nil + } + + return o.ApiSubnetAllowList + +} + +// GetApiSubnetAllowListOk returns a tuple with the ApiSubnetAllowList 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 *KubernetesClusterPropertiesForPost) GetApiSubnetAllowListOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.ApiSubnetAllowList, true +} + +// SetApiSubnetAllowList sets field value +func (o *KubernetesClusterPropertiesForPost) SetApiSubnetAllowList(v []string) { + + o.ApiSubnetAllowList = &v + +} + +// HasApiSubnetAllowList returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasApiSubnetAllowList() bool { + if o != nil && o.ApiSubnetAllowList != nil { + return true + } + + return false +} + +// GetS3Buckets returns the S3Buckets field value +// If the value is explicit nil, the zero value for []S3Bucket will be returned +func (o *KubernetesClusterPropertiesForPost) GetS3Buckets() *[]S3Bucket { + if o == nil { + return nil + } + + return o.S3Buckets + +} + +// GetS3BucketsOk returns a tuple with the S3Buckets 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 *KubernetesClusterPropertiesForPost) GetS3BucketsOk() (*[]S3Bucket, bool) { + if o == nil { + return nil, false + } + + return o.S3Buckets, true +} + +// SetS3Buckets sets field value +func (o *KubernetesClusterPropertiesForPost) SetS3Buckets(v []S3Bucket) { + + o.S3Buckets = &v + +} + +// HasS3Buckets returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPost) HasS3Buckets() bool { + if o != nil && o.S3Buckets != nil { + return true + } + + return false +} + +func (o KubernetesClusterPropertiesForPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.K8sVersion != nil { + toSerialize["k8sVersion"] = o.K8sVersion + } + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if o.Public != nil { + toSerialize["public"] = o.Public + } + if o.ApiSubnetAllowList != nil { + toSerialize["apiSubnetAllowList"] = o.ApiSubnetAllowList + } + if o.S3Buckets != nil { + toSerialize["s3Buckets"] = o.S3Buckets + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesClusterPropertiesForPost struct { + value *KubernetesClusterPropertiesForPost + isSet bool +} + +func (v NullableKubernetesClusterPropertiesForPost) Get() *KubernetesClusterPropertiesForPost { + return v.value +} + +func (v *NullableKubernetesClusterPropertiesForPost) Set(val *KubernetesClusterPropertiesForPost) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesClusterPropertiesForPost) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesClusterPropertiesForPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesClusterPropertiesForPost(val *KubernetesClusterPropertiesForPost) *NullableKubernetesClusterPropertiesForPost { + return &NullableKubernetesClusterPropertiesForPost{value: val, isSet: true} +} + +func (v NullableKubernetesClusterPropertiesForPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesClusterPropertiesForPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_put.go new file mode 100644 index 000000000000..c845c73bc143 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_cluster_properties_for_put.go @@ -0,0 +1,294 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesClusterPropertiesForPut struct for KubernetesClusterPropertiesForPut +type KubernetesClusterPropertiesForPut struct { + // A Kubernetes cluster name. Valid Kubernetes cluster name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + Name *string `json:"name"` + // The Kubernetes version the cluster is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` + MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` + // Access to the K8s API server is restricted to these CIDRs. Traffic, internal to the cluster, is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value is used: 32 for IPv4 and 128 for IPv6. + ApiSubnetAllowList *[]string `json:"apiSubnetAllowList,omitempty"` + // List of S3 bucket configured for K8s usage. For now it contains only an S3 bucket used to store K8s API audit logs + S3Buckets *[]S3Bucket `json:"s3Buckets,omitempty"` +} + +// NewKubernetesClusterPropertiesForPut instantiates a new KubernetesClusterPropertiesForPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusterPropertiesForPut(name string) *KubernetesClusterPropertiesForPut { + this := KubernetesClusterPropertiesForPut{} + + this.Name = &name + + return &this +} + +// NewKubernetesClusterPropertiesForPutWithDefaults instantiates a new KubernetesClusterPropertiesForPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClusterPropertiesForPutWithDefaults() *KubernetesClusterPropertiesForPut { + this := KubernetesClusterPropertiesForPut{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterPropertiesForPut) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesClusterPropertiesForPut) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *KubernetesClusterPropertiesForPut) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPut) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetK8sVersion returns the K8sVersion field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesClusterPropertiesForPut) GetK8sVersion() *string { + if o == nil { + return nil + } + + return o.K8sVersion + +} + +// GetK8sVersionOk returns a tuple with the K8sVersion 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 *KubernetesClusterPropertiesForPut) GetK8sVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.K8sVersion, true +} + +// SetK8sVersion sets field value +func (o *KubernetesClusterPropertiesForPut) SetK8sVersion(v string) { + + o.K8sVersion = &v + +} + +// HasK8sVersion returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPut) HasK8sVersion() bool { + if o != nil && o.K8sVersion != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned +func (o *KubernetesClusterPropertiesForPut) GetMaintenanceWindow() *KubernetesMaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *KubernetesClusterPropertiesForPut) GetMaintenanceWindowOk() (*KubernetesMaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *KubernetesClusterPropertiesForPut) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPut) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +// GetApiSubnetAllowList returns the ApiSubnetAllowList field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesClusterPropertiesForPut) GetApiSubnetAllowList() *[]string { + if o == nil { + return nil + } + + return o.ApiSubnetAllowList + +} + +// GetApiSubnetAllowListOk returns a tuple with the ApiSubnetAllowList 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 *KubernetesClusterPropertiesForPut) GetApiSubnetAllowListOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.ApiSubnetAllowList, true +} + +// SetApiSubnetAllowList sets field value +func (o *KubernetesClusterPropertiesForPut) SetApiSubnetAllowList(v []string) { + + o.ApiSubnetAllowList = &v + +} + +// HasApiSubnetAllowList returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPut) HasApiSubnetAllowList() bool { + if o != nil && o.ApiSubnetAllowList != nil { + return true + } + + return false +} + +// GetS3Buckets returns the S3Buckets field value +// If the value is explicit nil, the zero value for []S3Bucket will be returned +func (o *KubernetesClusterPropertiesForPut) GetS3Buckets() *[]S3Bucket { + if o == nil { + return nil + } + + return o.S3Buckets + +} + +// GetS3BucketsOk returns a tuple with the S3Buckets 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 *KubernetesClusterPropertiesForPut) GetS3BucketsOk() (*[]S3Bucket, bool) { + if o == nil { + return nil, false + } + + return o.S3Buckets, true +} + +// SetS3Buckets sets field value +func (o *KubernetesClusterPropertiesForPut) SetS3Buckets(v []S3Bucket) { + + o.S3Buckets = &v + +} + +// HasS3Buckets returns a boolean if a field has been set. +func (o *KubernetesClusterPropertiesForPut) HasS3Buckets() bool { + if o != nil && o.S3Buckets != nil { + return true + } + + return false +} + +func (o KubernetesClusterPropertiesForPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.K8sVersion != nil { + toSerialize["k8sVersion"] = o.K8sVersion + } + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if o.ApiSubnetAllowList != nil { + toSerialize["apiSubnetAllowList"] = o.ApiSubnetAllowList + } + if o.S3Buckets != nil { + toSerialize["s3Buckets"] = o.S3Buckets + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesClusterPropertiesForPut struct { + value *KubernetesClusterPropertiesForPut + isSet bool +} + +func (v NullableKubernetesClusterPropertiesForPut) Get() *KubernetesClusterPropertiesForPut { + return v.value +} + +func (v *NullableKubernetesClusterPropertiesForPut) Set(val *KubernetesClusterPropertiesForPut) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesClusterPropertiesForPut) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesClusterPropertiesForPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesClusterPropertiesForPut(val *KubernetesClusterPropertiesForPut) *NullableKubernetesClusterPropertiesForPut { + return &NullableKubernetesClusterPropertiesForPut{value: val, isSet: true} +} + +func (v NullableKubernetesClusterPropertiesForPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesClusterPropertiesForPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_clusters.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_clusters.go index 5f5d03ab016e..4066927e6dab 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_clusters.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_clusters.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // KubernetesClusters struct for KubernetesClusters type KubernetesClusters struct { - // Unique representation for Kubernetes Cluster as a collection on a resource. + // A unique representation of the Kubernetes cluster as a resource collection. Id *string `json:"id,omitempty"` - // The type of resource within a collection + // The type of resource within a collection. Type *string `json:"type,omitempty"` - // URL to the collection representation (absolute path) + // URL to the collection representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]KubernetesCluster `json:"items,omitempty"` } +// NewKubernetesClusters instantiates a new KubernetesClusters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesClusters() *KubernetesClusters { + this := KubernetesClusters{} + return &this +} + +// NewKubernetesClustersWithDefaults instantiates a new KubernetesClusters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesClustersWithDefaults() *KubernetesClusters { + this := KubernetesClusters{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *KubernetesClusters) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *KubernetesClusters) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesClusters) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *KubernetesClusters) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesClusters) GetType() *string { @@ -72,6 +90,7 @@ func (o *KubernetesClusters) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *KubernetesClusters) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesClusters) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *KubernetesClusters) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesClusters) GetHref() *string { @@ -108,6 +128,7 @@ func (o *KubernetesClusters) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *KubernetesClusters) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesClusters) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *KubernetesClusters) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []KubernetesCluster will be returned func (o *KubernetesClusters) GetItems() *[]KubernetesCluster { @@ -144,6 +166,7 @@ func (o *KubernetesClusters) GetItems() *[]KubernetesCluster { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *KubernetesClusters) GetItemsOk() (*[]KubernetesCluster, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *KubernetesClusters) SetItems(v []KubernetesCluster) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *KubernetesClusters) HasItems() bool { return false } - func (o KubernetesClusters) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableKubernetesClusters) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config_properties.go deleted file mode 100644 index 48c423675b66..000000000000 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config_properties.go +++ /dev/null @@ -1,106 +0,0 @@ -/* - * CLOUD API - * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionossdk - -import ( - "encoding/json" -) - -// KubernetesConfigProperties struct for KubernetesConfigProperties -type KubernetesConfigProperties struct { - // A Kubernetes Config file data - Kubeconfig *string `json:"kubeconfig,omitempty"` -} - - - -// GetKubeconfig returns the Kubeconfig field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesConfigProperties) GetKubeconfig() *string { - if o == nil { - return nil - } - - return o.Kubeconfig -} - -// GetKubeconfigOk returns a tuple with the Kubeconfig 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 *KubernetesConfigProperties) GetKubeconfigOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Kubeconfig, true -} - -// SetKubeconfig sets field value -func (o *KubernetesConfigProperties) SetKubeconfig(v string) { - o.Kubeconfig = &v -} - -// HasKubeconfig returns a boolean if a field has been set. -func (o *KubernetesConfigProperties) HasKubeconfig() bool { - if o != nil && o.Kubeconfig != nil { - return true - } - - return false -} - - -func (o KubernetesConfigProperties) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - - if o.Kubeconfig != nil { - toSerialize["kubeconfig"] = o.Kubeconfig - } - - return json.Marshal(toSerialize) -} - -type NullableKubernetesConfigProperties struct { - value *KubernetesConfigProperties - isSet bool -} - -func (v NullableKubernetesConfigProperties) Get() *KubernetesConfigProperties { - return v.value -} - -func (v *NullableKubernetesConfigProperties) Set(val *KubernetesConfigProperties) { - v.value = val - v.isSet = true -} - -func (v NullableKubernetesConfigProperties) IsSet() bool { - return v.isSet -} - -func (v *NullableKubernetesConfigProperties) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKubernetesConfigProperties(val *KubernetesConfigProperties) *NullableKubernetesConfigProperties { - return &NullableKubernetesConfigProperties{value: val, isSet: true} -} - -func (v NullableKubernetesConfigProperties) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKubernetesConfigProperties) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_maintenance_window.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_maintenance_window.go index f7ecc2a9522e..e257e823b5c7 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_maintenance_window.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_maintenance_window.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,12 +17,31 @@ import ( // KubernetesMaintenanceWindow struct for KubernetesMaintenanceWindow type KubernetesMaintenanceWindow struct { // The day of the week for a maintenance window. - DayOfTheWeek *string `json:"dayOfTheWeek,omitempty"` + DayOfTheWeek *string `json:"dayOfTheWeek"` // The time to use for a maintenance window. Accepted formats are: HH:mm:ss; HH:mm:ss\"Z\"; HH:mm:ssZ. This time may varies by 15 minutes. - Time *string `json:"time,omitempty"` + Time *string `json:"time"` } +// NewKubernetesMaintenanceWindow instantiates a new KubernetesMaintenanceWindow object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesMaintenanceWindow(dayOfTheWeek string, time string) *KubernetesMaintenanceWindow { + this := KubernetesMaintenanceWindow{} + this.DayOfTheWeek = &dayOfTheWeek + this.Time = &time + + return &this +} + +// NewKubernetesMaintenanceWindowWithDefaults instantiates a new KubernetesMaintenanceWindow object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesMaintenanceWindowWithDefaults() *KubernetesMaintenanceWindow { + this := KubernetesMaintenanceWindow{} + return &this +} // GetDayOfTheWeek returns the DayOfTheWeek field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +51,7 @@ func (o *KubernetesMaintenanceWindow) GetDayOfTheWeek() *string { } return o.DayOfTheWeek + } // GetDayOfTheWeekOk returns a tuple with the DayOfTheWeek field value @@ -41,12 +61,15 @@ func (o *KubernetesMaintenanceWindow) GetDayOfTheWeekOk() (*string, bool) { if o == nil { return nil, false } + return o.DayOfTheWeek, true } // SetDayOfTheWeek sets field value func (o *KubernetesMaintenanceWindow) SetDayOfTheWeek(v string) { + o.DayOfTheWeek = &v + } // HasDayOfTheWeek returns a boolean if a field has been set. @@ -58,8 +81,6 @@ func (o *KubernetesMaintenanceWindow) HasDayOfTheWeek() bool { return false } - - // GetTime returns the Time field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesMaintenanceWindow) GetTime() *string { @@ -68,6 +89,7 @@ func (o *KubernetesMaintenanceWindow) GetTime() *string { } return o.Time + } // GetTimeOk returns a tuple with the Time field value @@ -77,12 +99,15 @@ func (o *KubernetesMaintenanceWindow) GetTimeOk() (*string, bool) { if o == nil { return nil, false } + return o.Time, true } // SetTime sets field value func (o *KubernetesMaintenanceWindow) SetTime(v string) { + o.Time = &v + } // HasTime returns a boolean if a field has been set. @@ -94,19 +119,14 @@ func (o *KubernetesMaintenanceWindow) HasTime() bool { return false } - func (o KubernetesMaintenanceWindow) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.DayOfTheWeek != nil { toSerialize["dayOfTheWeek"] = o.DayOfTheWeek } - - if o.Time != nil { toSerialize["time"] = o.Time } - return json.Marshal(toSerialize) } @@ -145,5 +165,3 @@ func (v *NullableKubernetesMaintenanceWindow) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node.go index b33e440d11ac..b3d8e2b81b5e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,15 +18,33 @@ import ( type KubernetesNode struct { // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object + // The type of object. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *KubernetesNodeMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *KubernetesNodeMetadata `json:"metadata,omitempty"` Properties *KubernetesNodeProperties `json:"properties"` } +// NewKubernetesNode instantiates a new KubernetesNode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNode(properties KubernetesNodeProperties) *KubernetesNode { + this := KubernetesNode{} + this.Properties = &properties + + return &this +} + +// NewKubernetesNodeWithDefaults instantiates a new KubernetesNode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodeWithDefaults() *KubernetesNode { + this := KubernetesNode{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *KubernetesNode) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *KubernetesNode) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNode) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *KubernetesNode) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNode) GetType() *string { @@ -72,6 +92,7 @@ func (o *KubernetesNode) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *KubernetesNode) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesNode) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *KubernetesNode) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNode) GetHref() *string { @@ -108,6 +130,7 @@ func (o *KubernetesNode) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *KubernetesNode) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesNode) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *KubernetesNode) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for KubernetesNodeMetadata will be returned func (o *KubernetesNode) GetMetadata() *KubernetesNodeMetadata { @@ -144,6 +168,7 @@ func (o *KubernetesNode) GetMetadata() *KubernetesNodeMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *KubernetesNode) GetMetadataOk() (*KubernetesNodeMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *KubernetesNode) SetMetadata(v KubernetesNodeMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *KubernetesNode) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for KubernetesNodeProperties will be returned func (o *KubernetesNode) GetProperties() *KubernetesNodeProperties { @@ -180,6 +206,7 @@ func (o *KubernetesNode) GetProperties() *KubernetesNodeProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *KubernetesNode) GetPropertiesOk() (*KubernetesNodeProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *KubernetesNode) SetProperties(v KubernetesNodeProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *KubernetesNode) HasProperties() bool { return false } - func (o KubernetesNode) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableKubernetesNode) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_metadata.go index f0b25cebf8b2..6d69ee2da294 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,19 +17,35 @@ import ( // KubernetesNodeMetadata struct for KubernetesNodeMetadata type KubernetesNodeMetadata struct { - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. Etag *string `json:"etag,omitempty"` - // The last time the resource was created - CreatedDate *time.Time `json:"createdDate,omitempty"` - // The last time the resource has been modified - LastModifiedDate *time.Time `json:"lastModifiedDate,omitempty"` + // The last time the resource was created. + CreatedDate *IonosTime + // The last time the resource was modified. + LastModifiedDate *IonosTime // State of the resource. State *string `json:"state,omitempty"` - // The last time the software updated on node. - LastSoftwareUpdatedDate *time.Time `json:"lastSoftwareUpdatedDate,omitempty"` + // The last time the software was updated on the node. + LastSoftwareUpdatedDate *IonosTime } +// NewKubernetesNodeMetadata instantiates a new KubernetesNodeMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodeMetadata() *KubernetesNodeMetadata { + this := KubernetesNodeMetadata{} + return &this +} + +// NewKubernetesNodeMetadataWithDefaults instantiates a new KubernetesNodeMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodeMetadataWithDefaults() *KubernetesNodeMetadata { + this := KubernetesNodeMetadata{} + return &this +} // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned @@ -39,6 +55,7 @@ func (o *KubernetesNodeMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -48,12 +65,15 @@ func (o *KubernetesNodeMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *KubernetesNodeMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -65,8 +85,6 @@ func (o *KubernetesNodeMetadata) HasEtag() bool { return false } - - // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *KubernetesNodeMetadata) GetCreatedDate() *time.Time { @@ -74,7 +92,11 @@ func (o *KubernetesNodeMetadata) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -84,12 +106,19 @@ func (o *KubernetesNodeMetadata) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *KubernetesNodeMetadata) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -101,8 +130,6 @@ func (o *KubernetesNodeMetadata) HasCreatedDate() bool { 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 *KubernetesNodeMetadata) GetLastModifiedDate() *time.Time { @@ -110,7 +137,11 @@ func (o *KubernetesNodeMetadata) GetLastModifiedDate() *time.Time { return nil } - return o.LastModifiedDate + if o.LastModifiedDate == nil { + return nil + } + return &o.LastModifiedDate.Time + } // GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value @@ -120,12 +151,19 @@ func (o *KubernetesNodeMetadata) GetLastModifiedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.LastModifiedDate, true + + if o.LastModifiedDate == nil { + return nil, false + } + return &o.LastModifiedDate.Time, true + } // SetLastModifiedDate sets field value func (o *KubernetesNodeMetadata) SetLastModifiedDate(v time.Time) { - o.LastModifiedDate = &v + + o.LastModifiedDate = &IonosTime{v} + } // HasLastModifiedDate returns a boolean if a field has been set. @@ -137,8 +175,6 @@ func (o *KubernetesNodeMetadata) HasLastModifiedDate() bool { return false } - - // GetState returns the State field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodeMetadata) GetState() *string { @@ -147,6 +183,7 @@ func (o *KubernetesNodeMetadata) GetState() *string { } return o.State + } // GetStateOk returns a tuple with the State field value @@ -156,12 +193,15 @@ func (o *KubernetesNodeMetadata) GetStateOk() (*string, bool) { if o == nil { return nil, false } + return o.State, true } // SetState sets field value func (o *KubernetesNodeMetadata) SetState(v string) { + o.State = &v + } // HasState returns a boolean if a field has been set. @@ -173,8 +213,6 @@ func (o *KubernetesNodeMetadata) HasState() bool { return false } - - // GetLastSoftwareUpdatedDate returns the LastSoftwareUpdatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *KubernetesNodeMetadata) GetLastSoftwareUpdatedDate() *time.Time { @@ -182,7 +220,11 @@ func (o *KubernetesNodeMetadata) GetLastSoftwareUpdatedDate() *time.Time { return nil } - return o.LastSoftwareUpdatedDate + if o.LastSoftwareUpdatedDate == nil { + return nil + } + return &o.LastSoftwareUpdatedDate.Time + } // GetLastSoftwareUpdatedDateOk returns a tuple with the LastSoftwareUpdatedDate field value @@ -192,12 +234,19 @@ func (o *KubernetesNodeMetadata) GetLastSoftwareUpdatedDateOk() (*time.Time, boo if o == nil { return nil, false } - return o.LastSoftwareUpdatedDate, true + + if o.LastSoftwareUpdatedDate == nil { + return nil, false + } + return &o.LastSoftwareUpdatedDate.Time, true + } // SetLastSoftwareUpdatedDate sets field value func (o *KubernetesNodeMetadata) SetLastSoftwareUpdatedDate(v time.Time) { - o.LastSoftwareUpdatedDate = &v + + o.LastSoftwareUpdatedDate = &IonosTime{v} + } // HasLastSoftwareUpdatedDate returns a boolean if a field has been set. @@ -209,34 +258,23 @@ func (o *KubernetesNodeMetadata) HasLastSoftwareUpdatedDate() bool { return false } - func (o KubernetesNodeMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - - if o.LastModifiedDate != nil { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.State != nil { toSerialize["state"] = o.State } - - if o.LastSoftwareUpdatedDate != nil { toSerialize["lastSoftwareUpdatedDate"] = o.LastSoftwareUpdatedDate } - return json.Marshal(toSerialize) } @@ -275,5 +313,3 @@ func (v *NullableKubernetesNodeMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool.go index 85378c5ba130..04b859467c1b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,15 +18,33 @@ import ( type KubernetesNodePool struct { // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object + // The type of object. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` Properties *KubernetesNodePoolProperties `json:"properties"` } +// NewKubernetesNodePool instantiates a new KubernetesNodePool object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePool(properties KubernetesNodePoolProperties) *KubernetesNodePool { + this := KubernetesNodePool{} + this.Properties = &properties + + return &this +} + +// NewKubernetesNodePoolWithDefaults instantiates a new KubernetesNodePool object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolWithDefaults() *KubernetesNodePool { + this := KubernetesNodePool{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *KubernetesNodePool) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *KubernetesNodePool) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNodePool) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *KubernetesNodePool) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePool) GetType() *string { @@ -72,6 +92,7 @@ func (o *KubernetesNodePool) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *KubernetesNodePool) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesNodePool) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *KubernetesNodePool) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePool) GetHref() *string { @@ -108,6 +130,7 @@ func (o *KubernetesNodePool) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *KubernetesNodePool) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesNodePool) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *KubernetesNodePool) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *KubernetesNodePool) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *KubernetesNodePool) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *KubernetesNodePool) GetMetadataOk() (*DatacenterElementMetadata, bool) if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *KubernetesNodePool) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *KubernetesNodePool) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for KubernetesNodePoolProperties will be returned func (o *KubernetesNodePool) GetProperties() *KubernetesNodePoolProperties { @@ -180,6 +206,7 @@ func (o *KubernetesNodePool) GetProperties() *KubernetesNodePoolProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *KubernetesNodePool) GetPropertiesOk() (*KubernetesNodePoolProperties, b if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *KubernetesNodePool) SetProperties(v KubernetesNodePoolProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *KubernetesNodePool) HasProperties() bool { return false } - func (o KubernetesNodePool) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableKubernetesNodePool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_annotation.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_annotation.go deleted file mode 100644 index 0192b337ab43..000000000000 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_annotation.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - * CLOUD API - * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionossdk - -import ( - "encoding/json" -) - -// KubernetesNodePoolAnnotation map of annotations attached to node pool -type KubernetesNodePoolAnnotation struct { - // Key of the annotation. String part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character. - Key *string `json:"key,omitempty"` - // Value of the annotation. - Value *string `json:"value,omitempty"` -} - - - -// GetKey returns the Key field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolAnnotation) GetKey() *string { - if o == nil { - return nil - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key 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 *KubernetesNodePoolAnnotation) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Key, true -} - -// SetKey sets field value -func (o *KubernetesNodePoolAnnotation) SetKey(v string) { - o.Key = &v -} - -// HasKey returns a boolean if a field has been set. -func (o *KubernetesNodePoolAnnotation) HasKey() bool { - if o != nil && o.Key != nil { - return true - } - - return false -} - - - -// GetValue returns the Value field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolAnnotation) GetValue() *string { - if o == nil { - return nil - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value 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 *KubernetesNodePoolAnnotation) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Value, true -} - -// SetValue sets field value -func (o *KubernetesNodePoolAnnotation) SetValue(v string) { - o.Value = &v -} - -// HasValue returns a boolean if a field has been set. -func (o *KubernetesNodePoolAnnotation) HasValue() bool { - if o != nil && o.Value != nil { - return true - } - - return false -} - - -func (o KubernetesNodePoolAnnotation) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - - if o.Key != nil { - toSerialize["key"] = o.Key - } - - - if o.Value != nil { - toSerialize["value"] = o.Value - } - - return json.Marshal(toSerialize) -} - -type NullableKubernetesNodePoolAnnotation struct { - value *KubernetesNodePoolAnnotation - isSet bool -} - -func (v NullableKubernetesNodePoolAnnotation) Get() *KubernetesNodePoolAnnotation { - return v.value -} - -func (v *NullableKubernetesNodePoolAnnotation) Set(val *KubernetesNodePoolAnnotation) { - v.value = val - v.isSet = true -} - -func (v NullableKubernetesNodePoolAnnotation) IsSet() bool { - return v.isSet -} - -func (v *NullableKubernetesNodePoolAnnotation) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKubernetesNodePoolAnnotation(val *KubernetesNodePoolAnnotation) *NullableKubernetesNodePoolAnnotation { - return &NullableKubernetesNodePoolAnnotation{value: val, isSet: true} -} - -func (v NullableKubernetesNodePoolAnnotation) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKubernetesNodePoolAnnotation) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_post.go new file mode 100644 index 000000000000..8fd4e742d2c7 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_post.go @@ -0,0 +1,293 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesNodePoolForPost struct for KubernetesNodePoolForPost +type KubernetesNodePoolForPost struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object. + Type *string `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *KubernetesNodePoolPropertiesForPost `json:"properties"` +} + +// NewKubernetesNodePoolForPost instantiates a new KubernetesNodePoolForPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolForPost(properties KubernetesNodePoolPropertiesForPost) *KubernetesNodePoolForPost { + this := KubernetesNodePoolForPost{} + + this.Properties = &properties + + return &this +} + +// NewKubernetesNodePoolForPostWithDefaults instantiates a new KubernetesNodePoolForPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolForPostWithDefaults() *KubernetesNodePoolForPost { + this := KubernetesNodePoolForPost{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolForPost) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolForPost) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *KubernetesNodePoolForPost) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *KubernetesNodePoolForPost) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolForPost) GetType() *string { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolForPost) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *KubernetesNodePoolForPost) SetType(v string) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *KubernetesNodePoolForPost) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolForPost) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolForPost) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *KubernetesNodePoolForPost) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *KubernetesNodePoolForPost) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *KubernetesNodePoolForPost) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolForPost) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *KubernetesNodePoolForPost) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *KubernetesNodePoolForPost) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for KubernetesNodePoolPropertiesForPost will be returned +func (o *KubernetesNodePoolForPost) GetProperties() *KubernetesNodePoolPropertiesForPost { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolForPost) GetPropertiesOk() (*KubernetesNodePoolPropertiesForPost, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *KubernetesNodePoolForPost) SetProperties(v KubernetesNodePoolPropertiesForPost) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *KubernetesNodePoolForPost) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o KubernetesNodePoolForPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesNodePoolForPost struct { + value *KubernetesNodePoolForPost + isSet bool +} + +func (v NullableKubernetesNodePoolForPost) Get() *KubernetesNodePoolForPost { + return v.value +} + +func (v *NullableKubernetesNodePoolForPost) Set(val *KubernetesNodePoolForPost) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesNodePoolForPost) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesNodePoolForPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesNodePoolForPost(val *KubernetesNodePoolForPost) *NullableKubernetesNodePoolForPost { + return &NullableKubernetesNodePoolForPost{value: val, isSet: true} +} + +func (v NullableKubernetesNodePoolForPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesNodePoolForPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_put.go index d2c7b93de7f7..46fda0f5fafb 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_put.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_for_put.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,15 +18,33 @@ import ( type KubernetesNodePoolForPut struct { // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object + // The type of object. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` Properties *KubernetesNodePoolPropertiesForPut `json:"properties"` } +// NewKubernetesNodePoolForPut instantiates a new KubernetesNodePoolForPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolForPut(properties KubernetesNodePoolPropertiesForPut) *KubernetesNodePoolForPut { + this := KubernetesNodePoolForPut{} + this.Properties = &properties + + return &this +} + +// NewKubernetesNodePoolForPutWithDefaults instantiates a new KubernetesNodePoolForPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolForPutWithDefaults() *KubernetesNodePoolForPut { + this := KubernetesNodePoolForPut{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *KubernetesNodePoolForPut) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *KubernetesNodePoolForPut) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNodePoolForPut) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *KubernetesNodePoolForPut) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolForPut) GetType() *string { @@ -72,6 +92,7 @@ func (o *KubernetesNodePoolForPut) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *KubernetesNodePoolForPut) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesNodePoolForPut) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *KubernetesNodePoolForPut) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolForPut) GetHref() *string { @@ -108,6 +130,7 @@ func (o *KubernetesNodePoolForPut) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *KubernetesNodePoolForPut) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesNodePoolForPut) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *KubernetesNodePoolForPut) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *KubernetesNodePoolForPut) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *KubernetesNodePoolForPut) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *KubernetesNodePoolForPut) GetMetadataOk() (*DatacenterElementMetadata, if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *KubernetesNodePoolForPut) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *KubernetesNodePoolForPut) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for KubernetesNodePoolPropertiesForPut will be returned func (o *KubernetesNodePoolForPut) GetProperties() *KubernetesNodePoolPropertiesForPut { @@ -180,6 +206,7 @@ func (o *KubernetesNodePoolForPut) GetProperties() *KubernetesNodePoolProperties } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *KubernetesNodePoolForPut) GetPropertiesOk() (*KubernetesNodePoolPropert if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *KubernetesNodePoolForPut) SetProperties(v KubernetesNodePoolPropertiesForPut) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *KubernetesNodePoolForPut) HasProperties() bool { return false } - func (o KubernetesNodePoolForPut) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableKubernetesNodePoolForPut) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_label.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_label.go deleted file mode 100644 index 29869a188c66..000000000000 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_label.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - * CLOUD API - * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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: 5.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ionossdk - -import ( - "encoding/json" -) - -// KubernetesNodePoolLabel map of labels attached to node pool -type KubernetesNodePoolLabel struct { - // Key of the label. String part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character. - Key *string `json:"key,omitempty"` - // Value of the label. String part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character. - Value *string `json:"value,omitempty"` -} - - - -// GetKey returns the Key field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolLabel) GetKey() *string { - if o == nil { - return nil - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key 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 *KubernetesNodePoolLabel) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Key, true -} - -// SetKey sets field value -func (o *KubernetesNodePoolLabel) SetKey(v string) { - o.Key = &v -} - -// HasKey returns a boolean if a field has been set. -func (o *KubernetesNodePoolLabel) HasKey() bool { - if o != nil && o.Key != nil { - return true - } - - return false -} - - - -// GetValue returns the Value field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolLabel) GetValue() *string { - if o == nil { - return nil - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value 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 *KubernetesNodePoolLabel) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Value, true -} - -// SetValue sets field value -func (o *KubernetesNodePoolLabel) SetValue(v string) { - o.Value = &v -} - -// HasValue returns a boolean if a field has been set. -func (o *KubernetesNodePoolLabel) HasValue() bool { - if o != nil && o.Value != nil { - return true - } - - return false -} - - -func (o KubernetesNodePoolLabel) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - - if o.Key != nil { - toSerialize["key"] = o.Key - } - - - if o.Value != nil { - toSerialize["value"] = o.Value - } - - return json.Marshal(toSerialize) -} - -type NullableKubernetesNodePoolLabel struct { - value *KubernetesNodePoolLabel - isSet bool -} - -func (v NullableKubernetesNodePoolLabel) Get() *KubernetesNodePoolLabel { - return v.value -} - -func (v *NullableKubernetesNodePoolLabel) Set(val *KubernetesNodePoolLabel) { - v.value = val - v.isSet = true -} - -func (v NullableKubernetesNodePoolLabel) IsSet() bool { - return v.isSet -} - -func (v *NullableKubernetesNodePoolLabel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKubernetesNodePoolLabel(val *KubernetesNodePoolLabel) *NullableKubernetesNodePoolLabel { - return &NullableKubernetesNodePoolLabel{value: val, isSet: true} -} - -func (v NullableKubernetesNodePoolLabel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKubernetesNodePoolLabel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan.go index 88811ba51b03..88b08990c640 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,10 +17,32 @@ import ( // KubernetesNodePoolLan struct for KubernetesNodePoolLan type KubernetesNodePoolLan struct { // The LAN ID of an existing LAN at the related datacenter - Id *int32 `json:"id,omitempty"` + Id *int32 `json:"id"` + // Indicates if the Kubernetes node pool LAN will reserve an IP using DHCP. + Dhcp *bool `json:"dhcp,omitempty"` + // array of additional LANs attached to worker nodes + Routes *[]KubernetesNodePoolLanRoutes `json:"routes,omitempty"` } +// NewKubernetesNodePoolLan instantiates a new KubernetesNodePoolLan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolLan(id int32) *KubernetesNodePoolLan { + this := KubernetesNodePoolLan{} + this.Id = &id + + return &this +} + +// NewKubernetesNodePoolLanWithDefaults instantiates a new KubernetesNodePoolLan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolLanWithDefaults() *KubernetesNodePoolLan { + this := KubernetesNodePoolLan{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for int32 will be returned @@ -30,6 +52,7 @@ func (o *KubernetesNodePoolLan) GetId() *int32 { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -39,12 +62,15 @@ func (o *KubernetesNodePoolLan) GetIdOk() (*int32, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNodePoolLan) SetId(v int32) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -56,14 +82,93 @@ func (o *KubernetesNodePoolLan) HasId() bool { return false } +// GetDhcp returns the Dhcp field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *KubernetesNodePoolLan) GetDhcp() *bool { + if o == nil { + return nil + } + + return o.Dhcp + +} + +// GetDhcpOk returns a tuple with the Dhcp 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 *KubernetesNodePoolLan) GetDhcpOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Dhcp, true +} + +// SetDhcp sets field value +func (o *KubernetesNodePoolLan) SetDhcp(v bool) { + + o.Dhcp = &v + +} + +// HasDhcp returns a boolean if a field has been set. +func (o *KubernetesNodePoolLan) HasDhcp() bool { + if o != nil && o.Dhcp != nil { + return true + } + + return false +} + +// GetRoutes returns the Routes field value +// If the value is explicit nil, the zero value for []KubernetesNodePoolLanRoutes will be returned +func (o *KubernetesNodePoolLan) GetRoutes() *[]KubernetesNodePoolLanRoutes { + if o == nil { + return nil + } + + return o.Routes + +} + +// GetRoutesOk returns a tuple with the Routes 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 *KubernetesNodePoolLan) GetRoutesOk() (*[]KubernetesNodePoolLanRoutes, bool) { + if o == nil { + return nil, false + } + + return o.Routes, true +} + +// SetRoutes sets field value +func (o *KubernetesNodePoolLan) SetRoutes(v []KubernetesNodePoolLanRoutes) { + + o.Routes = &v + +} + +// HasRoutes returns a boolean if a field has been set. +func (o *KubernetesNodePoolLan) HasRoutes() bool { + if o != nil && o.Routes != nil { + return true + } + + return false +} func (o KubernetesNodePoolLan) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - + if o.Dhcp != nil { + toSerialize["dhcp"] = o.Dhcp + } + if o.Routes != nil { + toSerialize["routes"] = o.Routes + } return json.Marshal(toSerialize) } @@ -102,5 +207,3 @@ func (v *NullableKubernetesNodePoolLan) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan_routes.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan_routes.go new file mode 100644 index 000000000000..0d57c45927f1 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_lan_routes.go @@ -0,0 +1,164 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesNodePoolLanRoutes struct for KubernetesNodePoolLanRoutes +type KubernetesNodePoolLanRoutes struct { + // IPv4 or IPv6 CIDR to be routed via the interface. + Network *string `json:"network,omitempty"` + // IPv4 or IPv6 Gateway IP for the route. + GatewayIp *string `json:"gatewayIp,omitempty"` +} + +// NewKubernetesNodePoolLanRoutes instantiates a new KubernetesNodePoolLanRoutes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolLanRoutes() *KubernetesNodePoolLanRoutes { + this := KubernetesNodePoolLanRoutes{} + + return &this +} + +// NewKubernetesNodePoolLanRoutesWithDefaults instantiates a new KubernetesNodePoolLanRoutes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolLanRoutesWithDefaults() *KubernetesNodePoolLanRoutes { + this := KubernetesNodePoolLanRoutes{} + return &this +} + +// GetNetwork returns the Network field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolLanRoutes) GetNetwork() *string { + if o == nil { + return nil + } + + return o.Network + +} + +// GetNetworkOk returns a tuple with the Network 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 *KubernetesNodePoolLanRoutes) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Network, true +} + +// SetNetwork sets field value +func (o *KubernetesNodePoolLanRoutes) SetNetwork(v string) { + + o.Network = &v + +} + +// HasNetwork returns a boolean if a field has been set. +func (o *KubernetesNodePoolLanRoutes) HasNetwork() bool { + if o != nil && o.Network != nil { + return true + } + + return false +} + +// GetGatewayIp returns the GatewayIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolLanRoutes) GetGatewayIp() *string { + if o == nil { + return nil + } + + return o.GatewayIp + +} + +// GetGatewayIpOk returns a tuple with the GatewayIp 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 *KubernetesNodePoolLanRoutes) GetGatewayIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.GatewayIp, true +} + +// SetGatewayIp sets field value +func (o *KubernetesNodePoolLanRoutes) SetGatewayIp(v string) { + + o.GatewayIp = &v + +} + +// HasGatewayIp returns a boolean if a field has been set. +func (o *KubernetesNodePoolLanRoutes) HasGatewayIp() bool { + if o != nil && o.GatewayIp != nil { + return true + } + + return false +} + +func (o KubernetesNodePoolLanRoutes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Network != nil { + toSerialize["network"] = o.Network + } + if o.GatewayIp != nil { + toSerialize["gatewayIp"] = o.GatewayIp + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesNodePoolLanRoutes struct { + value *KubernetesNodePoolLanRoutes + isSet bool +} + +func (v NullableKubernetesNodePoolLanRoutes) Get() *KubernetesNodePoolLanRoutes { + return v.value +} + +func (v *NullableKubernetesNodePoolLanRoutes) Set(val *KubernetesNodePoolLanRoutes) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesNodePoolLanRoutes) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesNodePoolLanRoutes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesNodePoolLanRoutes(val *KubernetesNodePoolLanRoutes) *NullableKubernetesNodePoolLanRoutes { + return &NullableKubernetesNodePoolLanRoutes{value: val, isSet: true} +} + +func (v NullableKubernetesNodePoolLanRoutes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesNodePoolLanRoutes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties.go index 3130e8d1257d..22c3cb9e950f 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,36 +16,70 @@ import ( // KubernetesNodePoolProperties struct for KubernetesNodePoolProperties type KubernetesNodePoolProperties struct { - // A Kubernetes Node Pool Name. Valid Kubernetes Node Pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + // A Kubernetes node pool name. Valid Kubernetes node pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. Name *string `json:"name"` - // A valid uuid of the datacenter on which user has access + // A valid ID of the data center, to which user has access. DatacenterId *string `json:"datacenterId"` - // Number of nodes part of the Node Pool + // The number of nodes that make up the node pool. NodeCount *int32 `json:"nodeCount"` - // A valid cpu family name + // A valid CPU family name. CpuFamily *string `json:"cpuFamily"` - // Number of cores for node + // The number of cores for the node. CoresCount *int32 `json:"coresCount"` - // RAM size for node, minimum size 2048MB is recommended. Ram size must be set to multiple of 1024MB. + // The RAM size for the node. Must be set in multiples of 1024 MB, with minimum size is of 2048 MB. RamSize *int32 `json:"ramSize"` - // The availability zone in which the server should exist + // The availability zone in which the target VM should be provisioned. AvailabilityZone *string `json:"availabilityZone"` - // Hardware type of the volume + // The type of hardware for the volume. StorageType *string `json:"storageType"` // The size of the volume in GB. The size should be greater than 10GB. StorageSize *int32 `json:"storageSize"` - // The kubernetes version in which a nodepool is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions. - K8sVersion *string `json:"k8sVersion,omitempty"` + // The Kubernetes version the nodepool is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` - AutoScaling *KubernetesAutoScaling `json:"autoScaling,omitempty"` + AutoScaling *KubernetesAutoScaling `json:"autoScaling,omitempty"` // array of additional LANs attached to worker nodes Lans *[]KubernetesNodePoolLan `json:"lans,omitempty"` - Labels *KubernetesNodePoolLabel `json:"labels,omitempty"` - Annotations *KubernetesNodePoolAnnotation `json:"annotations,omitempty"` + // map of labels attached to node pool. + Labels *map[string]string `json:"labels,omitempty"` + // map of annotations attached to node pool. + Annotations *map[string]string `json:"annotations,omitempty"` + // Optional array of reserved public IP addresses to be used by the nodes. IPs must be from same location as the data center used for the node pool. The array must contain one more IP than maximum number possible number of nodes (nodeCount+1 for fixed number of nodes or maxNodeCount+1 when auto scaling is used). The extra IP is used when the nodes are rebuilt. + PublicIps *[]string `json:"publicIps,omitempty"` + // List of available versions for upgrading the node pool. + AvailableUpgradeVersions *[]string `json:"availableUpgradeVersions,omitempty"` + // Public IP address for the gateway performing source NAT for the node pool's nodes belonging to a private cluster. Required only if the node pool belongs to a private cluster. + GatewayIp *string `json:"gatewayIp,omitempty"` +} + +// NewKubernetesNodePoolProperties instantiates a new KubernetesNodePoolProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolProperties(name string, datacenterId string, nodeCount int32, cpuFamily string, coresCount int32, ramSize int32, availabilityZone string, storageType string, storageSize int32) *KubernetesNodePoolProperties { + this := KubernetesNodePoolProperties{} + + this.Name = &name + this.DatacenterId = &datacenterId + this.NodeCount = &nodeCount + this.CpuFamily = &cpuFamily + this.CoresCount = &coresCount + this.RamSize = &ramSize + this.AvailabilityZone = &availabilityZone + this.StorageType = &storageType + this.StorageSize = &storageSize + + return &this +} + +// NewKubernetesNodePoolPropertiesWithDefaults instantiates a new KubernetesNodePoolProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolPropertiesWithDefaults() *KubernetesNodePoolProperties { + this := KubernetesNodePoolProperties{} + return &this } - - // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetName() *string { @@ -54,6 +88,7 @@ func (o *KubernetesNodePoolProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -63,12 +98,15 @@ func (o *KubernetesNodePoolProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *KubernetesNodePoolProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -80,8 +118,6 @@ func (o *KubernetesNodePoolProperties) HasName() bool { return false } - - // GetDatacenterId returns the DatacenterId field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetDatacenterId() *string { @@ -90,6 +126,7 @@ func (o *KubernetesNodePoolProperties) GetDatacenterId() *string { } return o.DatacenterId + } // GetDatacenterIdOk returns a tuple with the DatacenterId field value @@ -99,12 +136,15 @@ func (o *KubernetesNodePoolProperties) GetDatacenterIdOk() (*string, bool) { if o == nil { return nil, false } + return o.DatacenterId, true } // SetDatacenterId sets field value func (o *KubernetesNodePoolProperties) SetDatacenterId(v string) { + o.DatacenterId = &v + } // HasDatacenterId returns a boolean if a field has been set. @@ -116,8 +156,6 @@ func (o *KubernetesNodePoolProperties) HasDatacenterId() bool { return false } - - // GetNodeCount returns the NodeCount field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesNodePoolProperties) GetNodeCount() *int32 { @@ -126,6 +164,7 @@ func (o *KubernetesNodePoolProperties) GetNodeCount() *int32 { } return o.NodeCount + } // GetNodeCountOk returns a tuple with the NodeCount field value @@ -135,12 +174,15 @@ func (o *KubernetesNodePoolProperties) GetNodeCountOk() (*int32, bool) { if o == nil { return nil, false } + return o.NodeCount, true } // SetNodeCount sets field value func (o *KubernetesNodePoolProperties) SetNodeCount(v int32) { + o.NodeCount = &v + } // HasNodeCount returns a boolean if a field has been set. @@ -152,8 +194,6 @@ func (o *KubernetesNodePoolProperties) HasNodeCount() bool { return false } - - // GetCpuFamily returns the CpuFamily field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetCpuFamily() *string { @@ -162,6 +202,7 @@ func (o *KubernetesNodePoolProperties) GetCpuFamily() *string { } return o.CpuFamily + } // GetCpuFamilyOk returns a tuple with the CpuFamily field value @@ -171,12 +212,15 @@ func (o *KubernetesNodePoolProperties) GetCpuFamilyOk() (*string, bool) { if o == nil { return nil, false } + return o.CpuFamily, true } // SetCpuFamily sets field value func (o *KubernetesNodePoolProperties) SetCpuFamily(v string) { + o.CpuFamily = &v + } // HasCpuFamily returns a boolean if a field has been set. @@ -188,8 +232,6 @@ func (o *KubernetesNodePoolProperties) HasCpuFamily() bool { return false } - - // GetCoresCount returns the CoresCount field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesNodePoolProperties) GetCoresCount() *int32 { @@ -198,6 +240,7 @@ func (o *KubernetesNodePoolProperties) GetCoresCount() *int32 { } return o.CoresCount + } // GetCoresCountOk returns a tuple with the CoresCount field value @@ -207,12 +250,15 @@ func (o *KubernetesNodePoolProperties) GetCoresCountOk() (*int32, bool) { if o == nil { return nil, false } + return o.CoresCount, true } // SetCoresCount sets field value func (o *KubernetesNodePoolProperties) SetCoresCount(v int32) { + o.CoresCount = &v + } // HasCoresCount returns a boolean if a field has been set. @@ -224,8 +270,6 @@ func (o *KubernetesNodePoolProperties) HasCoresCount() bool { return false } - - // GetRamSize returns the RamSize field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesNodePoolProperties) GetRamSize() *int32 { @@ -234,6 +278,7 @@ func (o *KubernetesNodePoolProperties) GetRamSize() *int32 { } return o.RamSize + } // GetRamSizeOk returns a tuple with the RamSize field value @@ -243,12 +288,15 @@ func (o *KubernetesNodePoolProperties) GetRamSizeOk() (*int32, bool) { if o == nil { return nil, false } + return o.RamSize, true } // SetRamSize sets field value func (o *KubernetesNodePoolProperties) SetRamSize(v int32) { + o.RamSize = &v + } // HasRamSize returns a boolean if a field has been set. @@ -260,8 +308,6 @@ func (o *KubernetesNodePoolProperties) HasRamSize() bool { return false } - - // GetAvailabilityZone returns the AvailabilityZone field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetAvailabilityZone() *string { @@ -270,6 +316,7 @@ func (o *KubernetesNodePoolProperties) GetAvailabilityZone() *string { } return o.AvailabilityZone + } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value @@ -279,12 +326,15 @@ func (o *KubernetesNodePoolProperties) GetAvailabilityZoneOk() (*string, bool) { if o == nil { return nil, false } + return o.AvailabilityZone, true } // SetAvailabilityZone sets field value func (o *KubernetesNodePoolProperties) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v + } // HasAvailabilityZone returns a boolean if a field has been set. @@ -296,8 +346,6 @@ func (o *KubernetesNodePoolProperties) HasAvailabilityZone() bool { return false } - - // GetStorageType returns the StorageType field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetStorageType() *string { @@ -306,6 +354,7 @@ func (o *KubernetesNodePoolProperties) GetStorageType() *string { } return o.StorageType + } // GetStorageTypeOk returns a tuple with the StorageType field value @@ -315,12 +364,15 @@ func (o *KubernetesNodePoolProperties) GetStorageTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.StorageType, true } // SetStorageType sets field value func (o *KubernetesNodePoolProperties) SetStorageType(v string) { + o.StorageType = &v + } // HasStorageType returns a boolean if a field has been set. @@ -332,8 +384,6 @@ func (o *KubernetesNodePoolProperties) HasStorageType() bool { return false } - - // GetStorageSize returns the StorageSize field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesNodePoolProperties) GetStorageSize() *int32 { @@ -342,6 +392,7 @@ func (o *KubernetesNodePoolProperties) GetStorageSize() *int32 { } return o.StorageSize + } // GetStorageSizeOk returns a tuple with the StorageSize field value @@ -351,12 +402,15 @@ func (o *KubernetesNodePoolProperties) GetStorageSizeOk() (*int32, bool) { if o == nil { return nil, false } + return o.StorageSize, true } // SetStorageSize sets field value func (o *KubernetesNodePoolProperties) SetStorageSize(v int32) { + o.StorageSize = &v + } // HasStorageSize returns a boolean if a field has been set. @@ -368,8 +422,6 @@ func (o *KubernetesNodePoolProperties) HasStorageSize() bool { return false } - - // GetK8sVersion returns the K8sVersion field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePoolProperties) GetK8sVersion() *string { @@ -378,6 +430,7 @@ func (o *KubernetesNodePoolProperties) GetK8sVersion() *string { } return o.K8sVersion + } // GetK8sVersionOk returns a tuple with the K8sVersion field value @@ -387,12 +440,15 @@ func (o *KubernetesNodePoolProperties) GetK8sVersionOk() (*string, bool) { if o == nil { return nil, false } + return o.K8sVersion, true } // SetK8sVersion sets field value func (o *KubernetesNodePoolProperties) SetK8sVersion(v string) { + o.K8sVersion = &v + } // HasK8sVersion returns a boolean if a field has been set. @@ -404,8 +460,6 @@ func (o *KubernetesNodePoolProperties) HasK8sVersion() bool { return false } - - // GetMaintenanceWindow returns the MaintenanceWindow field value // If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned func (o *KubernetesNodePoolProperties) GetMaintenanceWindow() *KubernetesMaintenanceWindow { @@ -414,6 +468,7 @@ func (o *KubernetesNodePoolProperties) GetMaintenanceWindow() *KubernetesMainten } return o.MaintenanceWindow + } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value @@ -423,12 +478,15 @@ func (o *KubernetesNodePoolProperties) GetMaintenanceWindowOk() (*KubernetesMain if o == nil { return nil, false } + return o.MaintenanceWindow, true } // SetMaintenanceWindow sets field value func (o *KubernetesNodePoolProperties) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + o.MaintenanceWindow = &v + } // HasMaintenanceWindow returns a boolean if a field has been set. @@ -440,8 +498,6 @@ func (o *KubernetesNodePoolProperties) HasMaintenanceWindow() bool { return false } - - // GetAutoScaling returns the AutoScaling field value // If the value is explicit nil, the zero value for KubernetesAutoScaling will be returned func (o *KubernetesNodePoolProperties) GetAutoScaling() *KubernetesAutoScaling { @@ -450,6 +506,7 @@ func (o *KubernetesNodePoolProperties) GetAutoScaling() *KubernetesAutoScaling { } return o.AutoScaling + } // GetAutoScalingOk returns a tuple with the AutoScaling field value @@ -459,12 +516,15 @@ func (o *KubernetesNodePoolProperties) GetAutoScalingOk() (*KubernetesAutoScalin if o == nil { return nil, false } + return o.AutoScaling, true } // SetAutoScaling sets field value func (o *KubernetesNodePoolProperties) SetAutoScaling(v KubernetesAutoScaling) { + o.AutoScaling = &v + } // HasAutoScaling returns a boolean if a field has been set. @@ -476,8 +536,6 @@ func (o *KubernetesNodePoolProperties) HasAutoScaling() bool { return false } - - // GetLans returns the Lans field value // If the value is explicit nil, the zero value for []KubernetesNodePoolLan will be returned func (o *KubernetesNodePoolProperties) GetLans() *[]KubernetesNodePoolLan { @@ -486,6 +544,7 @@ func (o *KubernetesNodePoolProperties) GetLans() *[]KubernetesNodePoolLan { } return o.Lans + } // GetLansOk returns a tuple with the Lans field value @@ -495,12 +554,15 @@ func (o *KubernetesNodePoolProperties) GetLansOk() (*[]KubernetesNodePoolLan, bo if o == nil { return nil, false } + return o.Lans, true } // SetLans sets field value func (o *KubernetesNodePoolProperties) SetLans(v []KubernetesNodePoolLan) { + o.Lans = &v + } // HasLans returns a boolean if a field has been set. @@ -512,31 +574,33 @@ func (o *KubernetesNodePoolProperties) HasLans() bool { return false } - - // GetLabels returns the Labels field value -// If the value is explicit nil, the zero value for KubernetesNodePoolLabel will be returned -func (o *KubernetesNodePoolProperties) GetLabels() *KubernetesNodePoolLabel { +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolProperties) GetLabels() *map[string]string { if o == nil { return nil } return o.Labels + } // GetLabelsOk returns a tuple with the Labels 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 *KubernetesNodePoolProperties) GetLabelsOk() (*KubernetesNodePoolLabel, bool) { +func (o *KubernetesNodePoolProperties) GetLabelsOk() (*map[string]string, bool) { if o == nil { return nil, false } + return o.Labels, true } // SetLabels sets field value -func (o *KubernetesNodePoolProperties) SetLabels(v KubernetesNodePoolLabel) { +func (o *KubernetesNodePoolProperties) SetLabels(v map[string]string) { + o.Labels = &v + } // HasLabels returns a boolean if a field has been set. @@ -548,31 +612,33 @@ func (o *KubernetesNodePoolProperties) HasLabels() bool { return false } - - // GetAnnotations returns the Annotations field value -// If the value is explicit nil, the zero value for KubernetesNodePoolAnnotation will be returned -func (o *KubernetesNodePoolProperties) GetAnnotations() *KubernetesNodePoolAnnotation { +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolProperties) GetAnnotations() *map[string]string { if o == nil { return nil } return o.Annotations + } // GetAnnotationsOk returns a tuple with the Annotations 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 *KubernetesNodePoolProperties) GetAnnotationsOk() (*KubernetesNodePoolAnnotation, bool) { +func (o *KubernetesNodePoolProperties) GetAnnotationsOk() (*map[string]string, bool) { if o == nil { return nil, false } + return o.Annotations, true } // SetAnnotations sets field value -func (o *KubernetesNodePoolProperties) SetAnnotations(v KubernetesNodePoolAnnotation) { +func (o *KubernetesNodePoolProperties) SetAnnotations(v map[string]string) { + o.Annotations = &v + } // HasAnnotations returns a boolean if a field has been set. @@ -584,84 +650,176 @@ func (o *KubernetesNodePoolProperties) HasAnnotations() bool { return false } +// GetPublicIps returns the PublicIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesNodePoolProperties) GetPublicIps() *[]string { + if o == nil { + return nil + } + + return o.PublicIps + +} + +// GetPublicIpsOk returns a tuple with the PublicIps 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 *KubernetesNodePoolProperties) GetPublicIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *KubernetesNodePoolProperties) SetPublicIps(v []string) { + + o.PublicIps = &v + +} + +// HasPublicIps returns a boolean if a field has been set. +func (o *KubernetesNodePoolProperties) HasPublicIps() bool { + if o != nil && o.PublicIps != nil { + return true + } + + return false +} + +// GetAvailableUpgradeVersions returns the AvailableUpgradeVersions field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesNodePoolProperties) GetAvailableUpgradeVersions() *[]string { + if o == nil { + return nil + } + + return o.AvailableUpgradeVersions + +} + +// GetAvailableUpgradeVersionsOk returns a tuple with the AvailableUpgradeVersions 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 *KubernetesNodePoolProperties) GetAvailableUpgradeVersionsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.AvailableUpgradeVersions, true +} + +// SetAvailableUpgradeVersions sets field value +func (o *KubernetesNodePoolProperties) SetAvailableUpgradeVersions(v []string) { + + o.AvailableUpgradeVersions = &v + +} + +// HasAvailableUpgradeVersions returns a boolean if a field has been set. +func (o *KubernetesNodePoolProperties) HasAvailableUpgradeVersions() bool { + if o != nil && o.AvailableUpgradeVersions != nil { + return true + } + + return false +} + +// GetGatewayIp returns the GatewayIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolProperties) GetGatewayIp() *string { + if o == nil { + return nil + } + + return o.GatewayIp + +} + +// GetGatewayIpOk returns a tuple with the GatewayIp 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 *KubernetesNodePoolProperties) GetGatewayIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.GatewayIp, true +} + +// SetGatewayIp sets field value +func (o *KubernetesNodePoolProperties) SetGatewayIp(v string) { + + o.GatewayIp = &v + +} + +// HasGatewayIp returns a boolean if a field has been set. +func (o *KubernetesNodePoolProperties) HasGatewayIp() bool { + if o != nil && o.GatewayIp != nil { + return true + } + + return false +} func (o KubernetesNodePoolProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.DatacenterId != nil { toSerialize["datacenterId"] = o.DatacenterId } - - if o.NodeCount != nil { toSerialize["nodeCount"] = o.NodeCount } - - if o.CpuFamily != nil { toSerialize["cpuFamily"] = o.CpuFamily } - - if o.CoresCount != nil { toSerialize["coresCount"] = o.CoresCount } - - if o.RamSize != nil { toSerialize["ramSize"] = o.RamSize } - - if o.AvailabilityZone != nil { toSerialize["availabilityZone"] = o.AvailabilityZone } - - if o.StorageType != nil { toSerialize["storageType"] = o.StorageType } - - if o.StorageSize != nil { toSerialize["storageSize"] = o.StorageSize } - - if o.K8sVersion != nil { toSerialize["k8sVersion"] = o.K8sVersion } - - if o.MaintenanceWindow != nil { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - - if o.AutoScaling != nil { toSerialize["autoScaling"] = o.AutoScaling } - - if o.Lans != nil { toSerialize["lans"] = o.Lans } - - if o.Labels != nil { toSerialize["labels"] = o.Labels } - - if o.Annotations != nil { toSerialize["annotations"] = o.Annotations } - + if o.PublicIps != nil { + toSerialize["publicIps"] = o.PublicIps + } + if o.AvailableUpgradeVersions != nil { + toSerialize["availableUpgradeVersions"] = o.AvailableUpgradeVersions + } + if o.GatewayIp != nil { + toSerialize["gatewayIp"] = o.GatewayIp + } return json.Marshal(toSerialize) } @@ -700,5 +858,3 @@ func (v *NullableKubernetesNodePoolProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_post.go new file mode 100644 index 000000000000..fe4062e813d3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_post.go @@ -0,0 +1,817 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// KubernetesNodePoolPropertiesForPost struct for KubernetesNodePoolPropertiesForPost +type KubernetesNodePoolPropertiesForPost struct { + // A Kubernetes node pool name. Valid Kubernetes node pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + Name *string `json:"name"` + // A valid ID of the data center, to which the user has access. + DatacenterId *string `json:"datacenterId"` + // The number of nodes that make up the node pool. + NodeCount *int32 `json:"nodeCount"` + // A valid CPU family name. + CpuFamily *string `json:"cpuFamily"` + // The number of cores for the node. + CoresCount *int32 `json:"coresCount"` + // The RAM size for the node. Must be set in multiples of 1024 MB, with minimum size is of 2048 MB. + RamSize *int32 `json:"ramSize"` + // The availability zone in which the target VM should be provisioned. + AvailabilityZone *string `json:"availabilityZone"` + // The type of hardware for the volume. + StorageType *string `json:"storageType"` + // The size of the volume in GB. The size should be greater than 10GB. + StorageSize *int32 `json:"storageSize"` + // The Kubernetes version the nodepool is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` + MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` + AutoScaling *KubernetesAutoScaling `json:"autoScaling,omitempty"` + // array of additional LANs attached to worker nodes + Lans *[]KubernetesNodePoolLan `json:"lans,omitempty"` + // map of labels attached to node pool. + Labels *map[string]string `json:"labels,omitempty"` + // map of annotations attached to node pool. + Annotations *map[string]string `json:"annotations,omitempty"` + // Optional array of reserved public IP addresses to be used by the nodes. IPs must be from same location as the data center used for the node pool. The array must contain one more IP than the maximum possible number of nodes (nodeCount+1 for fixed number of nodes or maxNodeCount+1 when auto scaling is used). The extra IP is used when the nodes are rebuilt. + PublicIps *[]string `json:"publicIps,omitempty"` + // Public IP address for the gateway performing source NAT for the node pool's nodes belonging to a private cluster. Required only if the node pool belongs to a private cluster. + GatewayIp *string `json:"gatewayIp,omitempty"` +} + +// NewKubernetesNodePoolPropertiesForPost instantiates a new KubernetesNodePoolPropertiesForPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolPropertiesForPost(name string, datacenterId string, nodeCount int32, cpuFamily string, coresCount int32, ramSize int32, availabilityZone string, storageType string, storageSize int32) *KubernetesNodePoolPropertiesForPost { + this := KubernetesNodePoolPropertiesForPost{} + + this.Name = &name + this.DatacenterId = &datacenterId + this.NodeCount = &nodeCount + this.CpuFamily = &cpuFamily + this.CoresCount = &coresCount + this.RamSize = &ramSize + this.AvailabilityZone = &availabilityZone + this.StorageType = &storageType + this.StorageSize = &storageSize + + return &this +} + +// NewKubernetesNodePoolPropertiesForPostWithDefaults instantiates a new KubernetesNodePoolPropertiesForPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolPropertiesForPostWithDefaults() *KubernetesNodePoolPropertiesForPost { + this := KubernetesNodePoolPropertiesForPost{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetDatacenterId returns the DatacenterId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetDatacenterId() *string { + if o == nil { + return nil + } + + 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 *KubernetesNodePoolPropertiesForPost) GetDatacenterIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.DatacenterId, true +} + +// SetDatacenterId sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetDatacenterId(v string) { + + o.DatacenterId = &v + +} + +// HasDatacenterId returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasDatacenterId() bool { + if o != nil && o.DatacenterId != nil { + return true + } + + return false +} + +// GetNodeCount returns the NodeCount field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetNodeCount() *int32 { + if o == nil { + return nil + } + + return o.NodeCount + +} + +// GetNodeCountOk returns a tuple with the NodeCount 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 *KubernetesNodePoolPropertiesForPost) GetNodeCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.NodeCount, true +} + +// SetNodeCount sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetNodeCount(v int32) { + + o.NodeCount = &v + +} + +// HasNodeCount returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasNodeCount() bool { + if o != nil && o.NodeCount != nil { + return true + } + + return false +} + +// GetCpuFamily returns the CpuFamily field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetCpuFamily() *string { + if o == nil { + return nil + } + + return o.CpuFamily + +} + +// GetCpuFamilyOk returns a tuple with the CpuFamily 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 *KubernetesNodePoolPropertiesForPost) GetCpuFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.CpuFamily, true +} + +// SetCpuFamily sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetCpuFamily(v string) { + + o.CpuFamily = &v + +} + +// HasCpuFamily returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasCpuFamily() bool { + if o != nil && o.CpuFamily != nil { + return true + } + + return false +} + +// GetCoresCount returns the CoresCount field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetCoresCount() *int32 { + if o == nil { + return nil + } + + return o.CoresCount + +} + +// GetCoresCountOk returns a tuple with the CoresCount 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 *KubernetesNodePoolPropertiesForPost) GetCoresCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.CoresCount, true +} + +// SetCoresCount sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetCoresCount(v int32) { + + o.CoresCount = &v + +} + +// HasCoresCount returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasCoresCount() bool { + if o != nil && o.CoresCount != nil { + return true + } + + return false +} + +// GetRamSize returns the RamSize field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetRamSize() *int32 { + if o == nil { + return nil + } + + return o.RamSize + +} + +// GetRamSizeOk returns a tuple with the RamSize 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 *KubernetesNodePoolPropertiesForPost) GetRamSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.RamSize, true +} + +// SetRamSize sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetRamSize(v int32) { + + o.RamSize = &v + +} + +// HasRamSize returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasRamSize() bool { + if o != nil && o.RamSize != nil { + return true + } + + return false +} + +// GetAvailabilityZone returns the AvailabilityZone field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetAvailabilityZone() *string { + if o == nil { + return nil + } + + return o.AvailabilityZone + +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone 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 *KubernetesNodePoolPropertiesForPost) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetAvailabilityZone(v string) { + + o.AvailabilityZone = &v + +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasAvailabilityZone() bool { + if o != nil && o.AvailabilityZone != nil { + return true + } + + return false +} + +// GetStorageType returns the StorageType field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetStorageType() *string { + if o == nil { + return nil + } + + return o.StorageType + +} + +// GetStorageTypeOk returns a tuple with the StorageType 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 *KubernetesNodePoolPropertiesForPost) GetStorageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.StorageType, true +} + +// SetStorageType sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetStorageType(v string) { + + o.StorageType = &v + +} + +// HasStorageType returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasStorageType() bool { + if o != nil && o.StorageType != nil { + 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 *KubernetesNodePoolPropertiesForPost) GetStorageSize() *int32 { + if o == nil { + return nil + } + + 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 *KubernetesNodePoolPropertiesForPost) GetStorageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.StorageSize, true +} + +// SetStorageSize sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetStorageSize(v int32) { + + o.StorageSize = &v + +} + +// HasStorageSize returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasStorageSize() bool { + if o != nil && o.StorageSize != nil { + return true + } + + return false +} + +// GetK8sVersion returns the K8sVersion field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetK8sVersion() *string { + if o == nil { + return nil + } + + return o.K8sVersion + +} + +// GetK8sVersionOk returns a tuple with the K8sVersion 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 *KubernetesNodePoolPropertiesForPost) GetK8sVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.K8sVersion, true +} + +// SetK8sVersion sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetK8sVersion(v string) { + + o.K8sVersion = &v + +} + +// HasK8sVersion returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasK8sVersion() bool { + if o != nil && o.K8sVersion != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetMaintenanceWindow() *KubernetesMaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *KubernetesNodePoolPropertiesForPost) GetMaintenanceWindowOk() (*KubernetesMaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +// GetAutoScaling returns the AutoScaling field value +// If the value is explicit nil, the zero value for KubernetesAutoScaling will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetAutoScaling() *KubernetesAutoScaling { + if o == nil { + return nil + } + + return o.AutoScaling + +} + +// GetAutoScalingOk returns a tuple with the AutoScaling 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 *KubernetesNodePoolPropertiesForPost) GetAutoScalingOk() (*KubernetesAutoScaling, bool) { + if o == nil { + return nil, false + } + + return o.AutoScaling, true +} + +// SetAutoScaling sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetAutoScaling(v KubernetesAutoScaling) { + + o.AutoScaling = &v + +} + +// HasAutoScaling returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasAutoScaling() bool { + if o != nil && o.AutoScaling != nil { + return true + } + + return false +} + +// GetLans returns the Lans field value +// If the value is explicit nil, the zero value for []KubernetesNodePoolLan will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetLans() *[]KubernetesNodePoolLan { + if o == nil { + return nil + } + + return o.Lans + +} + +// GetLansOk returns a tuple with the Lans 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 *KubernetesNodePoolPropertiesForPost) GetLansOk() (*[]KubernetesNodePoolLan, bool) { + if o == nil { + return nil, false + } + + return o.Lans, true +} + +// SetLans sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetLans(v []KubernetesNodePoolLan) { + + o.Lans = &v + +} + +// HasLans returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasLans() bool { + if o != nil && o.Lans != nil { + return true + } + + return false +} + +// GetLabels returns the Labels field value +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetLabels() *map[string]string { + if o == nil { + return nil + } + + return o.Labels + +} + +// GetLabelsOk returns a tuple with the Labels 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 *KubernetesNodePoolPropertiesForPost) GetLabelsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + + return o.Labels, true +} + +// SetLabels sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetLabels(v map[string]string) { + + o.Labels = &v + +} + +// HasLabels returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasLabels() bool { + if o != nil && o.Labels != nil { + return true + } + + return false +} + +// GetAnnotations returns the Annotations field value +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetAnnotations() *map[string]string { + if o == nil { + return nil + } + + return o.Annotations + +} + +// GetAnnotationsOk returns a tuple with the Annotations 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 *KubernetesNodePoolPropertiesForPost) GetAnnotationsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + + return o.Annotations, true +} + +// SetAnnotations sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetAnnotations(v map[string]string) { + + o.Annotations = &v + +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasAnnotations() bool { + if o != nil && o.Annotations != nil { + return true + } + + return false +} + +// GetPublicIps returns the PublicIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetPublicIps() *[]string { + if o == nil { + return nil + } + + return o.PublicIps + +} + +// GetPublicIpsOk returns a tuple with the PublicIps 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 *KubernetesNodePoolPropertiesForPost) GetPublicIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetPublicIps(v []string) { + + o.PublicIps = &v + +} + +// HasPublicIps returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasPublicIps() bool { + if o != nil && o.PublicIps != nil { + return true + } + + return false +} + +// GetGatewayIp returns the GatewayIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodePoolPropertiesForPost) GetGatewayIp() *string { + if o == nil { + return nil + } + + return o.GatewayIp + +} + +// GetGatewayIpOk returns a tuple with the GatewayIp 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 *KubernetesNodePoolPropertiesForPost) GetGatewayIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.GatewayIp, true +} + +// SetGatewayIp sets field value +func (o *KubernetesNodePoolPropertiesForPost) SetGatewayIp(v string) { + + o.GatewayIp = &v + +} + +// HasGatewayIp returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPost) HasGatewayIp() bool { + if o != nil && o.GatewayIp != nil { + return true + } + + return false +} + +func (o KubernetesNodePoolPropertiesForPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.DatacenterId != nil { + toSerialize["datacenterId"] = o.DatacenterId + } + if o.NodeCount != nil { + toSerialize["nodeCount"] = o.NodeCount + } + if o.CpuFamily != nil { + toSerialize["cpuFamily"] = o.CpuFamily + } + if o.CoresCount != nil { + toSerialize["coresCount"] = o.CoresCount + } + if o.RamSize != nil { + toSerialize["ramSize"] = o.RamSize + } + if o.AvailabilityZone != nil { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if o.StorageType != nil { + toSerialize["storageType"] = o.StorageType + } + if o.StorageSize != nil { + toSerialize["storageSize"] = o.StorageSize + } + if o.K8sVersion != nil { + toSerialize["k8sVersion"] = o.K8sVersion + } + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if o.AutoScaling != nil { + toSerialize["autoScaling"] = o.AutoScaling + } + if o.Lans != nil { + toSerialize["lans"] = o.Lans + } + if o.Labels != nil { + toSerialize["labels"] = o.Labels + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.PublicIps != nil { + toSerialize["publicIps"] = o.PublicIps + } + if o.GatewayIp != nil { + toSerialize["gatewayIp"] = o.GatewayIp + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesNodePoolPropertiesForPost struct { + value *KubernetesNodePoolPropertiesForPost + isSet bool +} + +func (v NullableKubernetesNodePoolPropertiesForPost) Get() *KubernetesNodePoolPropertiesForPost { + return v.value +} + +func (v *NullableKubernetesNodePoolPropertiesForPost) Set(val *KubernetesNodePoolPropertiesForPost) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesNodePoolPropertiesForPost) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesNodePoolPropertiesForPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesNodePoolPropertiesForPost(val *KubernetesNodePoolPropertiesForPost) *NullableKubernetesNodePoolPropertiesForPost { + return &NullableKubernetesNodePoolPropertiesForPost{value: val, isSet: true} +} + +func (v NullableKubernetesNodePoolPropertiesForPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesNodePoolPropertiesForPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_put.go index fc0a091a110e..3b0081c3e2f7 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_put.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pool_properties_for_put.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,33 +16,43 @@ import ( // KubernetesNodePoolPropertiesForPut struct for KubernetesNodePoolPropertiesForPut type KubernetesNodePoolPropertiesForPut struct { - // A Kubernetes Node Pool Name. Valid Kubernetes Node Pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. - Name *string `json:"name"` - // A valid uuid of the datacenter on which user has access - DatacenterId *string `json:"datacenterId"` - // Number of nodes part of the Node Pool + // A Kubernetes node pool name. Valid Kubernetes node pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. + Name *string `json:"name,omitempty"` + // The number of nodes that make up the node pool. NodeCount *int32 `json:"nodeCount"` - // A valid cpu family name - CpuFamily *string `json:"cpuFamily"` - // Number of cores for node - CoresCount *int32 `json:"coresCount"` - // RAM size for node, minimum size 2048MB is recommended. Ram size must be set to multiple of 1024MB. - RamSize *int32 `json:"ramSize"` - // The availability zone in which the server should exist - AvailabilityZone *string `json:"availabilityZone"` - // Hardware type of the volume - StorageType *string `json:"storageType"` - // The size of the volume in GB. The size should be greater than 10GB. - StorageSize *int32 `json:"storageSize"` - // The kubernetes version in which a nodepool is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions. - K8sVersion *string `json:"k8sVersion,omitempty"` + // The Kubernetes version the nodepool is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. + K8sVersion *string `json:"k8sVersion,omitempty"` MaintenanceWindow *KubernetesMaintenanceWindow `json:"maintenanceWindow,omitempty"` - AutoScaling *KubernetesAutoScaling `json:"autoScaling,omitempty"` + AutoScaling *KubernetesAutoScaling `json:"autoScaling,omitempty"` // array of additional LANs attached to worker nodes Lans *[]KubernetesNodePoolLan `json:"lans,omitempty"` + // map of labels attached to node pool. + Labels *map[string]string `json:"labels,omitempty"` + // map of annotations attached to node pool. + Annotations *map[string]string `json:"annotations,omitempty"` + // Optional array of reserved public IP addresses to be used by the nodes. IPs must be from same location as the data center used for the node pool. The array must contain one more IP than the maximum possible number of nodes (nodeCount+1 for fixed number of nodes or maxNodeCount+1 when auto scaling is used). The extra IP is used when the nodes are rebuilt. + PublicIps *[]string `json:"publicIps,omitempty"` } +// NewKubernetesNodePoolPropertiesForPut instantiates a new KubernetesNodePoolPropertiesForPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePoolPropertiesForPut(nodeCount int32) *KubernetesNodePoolPropertiesForPut { + this := KubernetesNodePoolPropertiesForPut{} + this.NodeCount = &nodeCount + + return &this +} + +// NewKubernetesNodePoolPropertiesForPutWithDefaults instantiates a new KubernetesNodePoolPropertiesForPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolPropertiesForPutWithDefaults() *KubernetesNodePoolPropertiesForPut { + this := KubernetesNodePoolPropertiesForPut{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -52,6 +62,7 @@ func (o *KubernetesNodePoolPropertiesForPut) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -61,12 +72,15 @@ func (o *KubernetesNodePoolPropertiesForPut) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *KubernetesNodePoolPropertiesForPut) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -78,44 +92,6 @@ func (o *KubernetesNodePoolPropertiesForPut) HasName() bool { return false } - - -// GetDatacenterId returns the DatacenterId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetDatacenterId() *string { - if o == nil { - return nil - } - - 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 *KubernetesNodePoolPropertiesForPut) GetDatacenterIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DatacenterId, true -} - -// SetDatacenterId sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetDatacenterId(v string) { - o.DatacenterId = &v -} - -// HasDatacenterId returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasDatacenterId() bool { - if o != nil && o.DatacenterId != nil { - return true - } - - return false -} - - - // GetNodeCount returns the NodeCount field value // If the value is explicit nil, the zero value for int32 will be returned func (o *KubernetesNodePoolPropertiesForPut) GetNodeCount() *int32 { @@ -124,6 +100,7 @@ func (o *KubernetesNodePoolPropertiesForPut) GetNodeCount() *int32 { } return o.NodeCount + } // GetNodeCountOk returns a tuple with the NodeCount field value @@ -133,12 +110,15 @@ func (o *KubernetesNodePoolPropertiesForPut) GetNodeCountOk() (*int32, bool) { if o == nil { return nil, false } + return o.NodeCount, true } // SetNodeCount sets field value func (o *KubernetesNodePoolPropertiesForPut) SetNodeCount(v int32) { + o.NodeCount = &v + } // HasNodeCount returns a boolean if a field has been set. @@ -150,434 +130,301 @@ func (o *KubernetesNodePoolPropertiesForPut) HasNodeCount() bool { return false } - - -// GetCpuFamily returns the CpuFamily field value +// GetK8sVersion returns the K8sVersion field value // If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetCpuFamily() *string { +func (o *KubernetesNodePoolPropertiesForPut) GetK8sVersion() *string { if o == nil { return nil } - return o.CpuFamily + return o.K8sVersion + } -// GetCpuFamilyOk returns a tuple with the CpuFamily field value +// GetK8sVersionOk returns a tuple with the K8sVersion 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 *KubernetesNodePoolPropertiesForPut) GetCpuFamilyOk() (*string, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetK8sVersionOk() (*string, bool) { if o == nil { return nil, false } - return o.CpuFamily, true -} -// SetCpuFamily sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetCpuFamily(v string) { - o.CpuFamily = &v -} - -// HasCpuFamily returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasCpuFamily() bool { - if o != nil && o.CpuFamily != nil { - return true - } - - return false + return o.K8sVersion, true } +// SetK8sVersion sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetK8sVersion(v string) { + o.K8sVersion = &v -// GetCoresCount returns the CoresCount field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetCoresCount() *int32 { - if o == nil { - return nil - } - - return o.CoresCount -} - -// GetCoresCountOk returns a tuple with the CoresCount 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 *KubernetesNodePoolPropertiesForPut) GetCoresCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.CoresCount, true -} - -// SetCoresCount sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetCoresCount(v int32) { - o.CoresCount = &v } -// HasCoresCount returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasCoresCount() bool { - if o != nil && o.CoresCount != nil { +// HasK8sVersion returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasK8sVersion() bool { + if o != nil && o.K8sVersion != nil { return true } return false } - - -// GetRamSize returns the RamSize field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetRamSize() *int32 { +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetMaintenanceWindow() *KubernetesMaintenanceWindow { if o == nil { return nil } - return o.RamSize + return o.MaintenanceWindow + } -// GetRamSizeOk returns a tuple with the RamSize field value +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow 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 *KubernetesNodePoolPropertiesForPut) GetRamSizeOk() (*int32, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetMaintenanceWindowOk() (*KubernetesMaintenanceWindow, bool) { if o == nil { return nil, false } - return o.RamSize, true -} - -// SetRamSize sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetRamSize(v int32) { - o.RamSize = &v -} - -// HasRamSize returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasRamSize() bool { - if o != nil && o.RamSize != nil { - return true - } - return false + return o.MaintenanceWindow, true } +// SetMaintenanceWindow sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { + o.MaintenanceWindow = &v -// GetAvailabilityZone returns the AvailabilityZone field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetAvailabilityZone() *string { - if o == nil { - return nil - } - - return o.AvailabilityZone -} - -// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone 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 *KubernetesNodePoolPropertiesForPut) GetAvailabilityZoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.AvailabilityZone, true -} - -// SetAvailabilityZone sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetAvailabilityZone(v string) { - o.AvailabilityZone = &v } -// HasAvailabilityZone returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasAvailabilityZone() bool { - if o != nil && o.AvailabilityZone != nil { +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { return true } return false } - - -// GetStorageType returns the StorageType field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetStorageType() *string { +// GetAutoScaling returns the AutoScaling field value +// If the value is explicit nil, the zero value for KubernetesAutoScaling will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetAutoScaling() *KubernetesAutoScaling { if o == nil { return nil } - return o.StorageType + return o.AutoScaling + } -// GetStorageTypeOk returns a tuple with the StorageType field value +// GetAutoScalingOk returns a tuple with the AutoScaling 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 *KubernetesNodePoolPropertiesForPut) GetStorageTypeOk() (*string, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetAutoScalingOk() (*KubernetesAutoScaling, bool) { if o == nil { return nil, false } - return o.StorageType, true -} - -// SetStorageType sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetStorageType(v string) { - o.StorageType = &v -} - -// HasStorageType returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasStorageType() bool { - if o != nil && o.StorageType != nil { - return true - } - return false + return o.AutoScaling, true } +// SetAutoScaling sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetAutoScaling(v KubernetesAutoScaling) { + o.AutoScaling = &v -// GetStorageSize returns the StorageSize field value -// If the value is explicit nil, the zero value for int32 will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetStorageSize() *int32 { - if o == nil { - return nil - } - - 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 *KubernetesNodePoolPropertiesForPut) GetStorageSizeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.StorageSize, true -} - -// SetStorageSize sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetStorageSize(v int32) { - o.StorageSize = &v } -// HasStorageSize returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasStorageSize() bool { - if o != nil && o.StorageSize != nil { +// HasAutoScaling returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasAutoScaling() bool { + if o != nil && o.AutoScaling != nil { return true } return false } - - -// GetK8sVersion returns the K8sVersion field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetK8sVersion() *string { +// GetLans returns the Lans field value +// If the value is explicit nil, the zero value for []KubernetesNodePoolLan will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetLans() *[]KubernetesNodePoolLan { if o == nil { return nil } - return o.K8sVersion + return o.Lans + } -// GetK8sVersionOk returns a tuple with the K8sVersion field value +// GetLansOk returns a tuple with the Lans 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 *KubernetesNodePoolPropertiesForPut) GetK8sVersionOk() (*string, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetLansOk() (*[]KubernetesNodePoolLan, bool) { if o == nil { return nil, false } - return o.K8sVersion, true + + return o.Lans, true } -// SetK8sVersion sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetK8sVersion(v string) { - o.K8sVersion = &v +// SetLans sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetLans(v []KubernetesNodePoolLan) { + + o.Lans = &v + } -// HasK8sVersion returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasK8sVersion() bool { - if o != nil && o.K8sVersion != nil { +// HasLans returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasLans() bool { + if o != nil && o.Lans != nil { return true } return false } - - -// GetMaintenanceWindow returns the MaintenanceWindow field value -// If the value is explicit nil, the zero value for KubernetesMaintenanceWindow will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetMaintenanceWindow() *KubernetesMaintenanceWindow { +// GetLabels returns the Labels field value +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetLabels() *map[string]string { if o == nil { return nil } - return o.MaintenanceWindow + return o.Labels + } -// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// GetLabelsOk returns a tuple with the Labels 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 *KubernetesNodePoolPropertiesForPut) GetMaintenanceWindowOk() (*KubernetesMaintenanceWindow, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetLabelsOk() (*map[string]string, bool) { if o == nil { return nil, false } - return o.MaintenanceWindow, true + + return o.Labels, true } -// SetMaintenanceWindow sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetMaintenanceWindow(v KubernetesMaintenanceWindow) { - o.MaintenanceWindow = &v +// SetLabels sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetLabels(v map[string]string) { + + o.Labels = &v + } -// HasMaintenanceWindow returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasMaintenanceWindow() bool { - if o != nil && o.MaintenanceWindow != nil { +// HasLabels returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasLabels() bool { + if o != nil && o.Labels != nil { return true } return false } - - -// GetAutoScaling returns the AutoScaling field value -// If the value is explicit nil, the zero value for KubernetesAutoScaling will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetAutoScaling() *KubernetesAutoScaling { +// GetAnnotations returns the Annotations field value +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetAnnotations() *map[string]string { if o == nil { return nil } - return o.AutoScaling + return o.Annotations + } -// GetAutoScalingOk returns a tuple with the AutoScaling field value +// GetAnnotationsOk returns a tuple with the Annotations 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 *KubernetesNodePoolPropertiesForPut) GetAutoScalingOk() (*KubernetesAutoScaling, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetAnnotationsOk() (*map[string]string, bool) { if o == nil { return nil, false } - return o.AutoScaling, true + + return o.Annotations, true } -// SetAutoScaling sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetAutoScaling(v KubernetesAutoScaling) { - o.AutoScaling = &v +// SetAnnotations sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetAnnotations(v map[string]string) { + + o.Annotations = &v + } -// HasAutoScaling returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasAutoScaling() bool { - if o != nil && o.AutoScaling != nil { +// HasAnnotations returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasAnnotations() bool { + if o != nil && o.Annotations != nil { return true } return false } - - -// GetLans returns the Lans field value -// If the value is explicit nil, the zero value for []KubernetesNodePoolLan will be returned -func (o *KubernetesNodePoolPropertiesForPut) GetLans() *[]KubernetesNodePoolLan { +// GetPublicIps returns the PublicIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *KubernetesNodePoolPropertiesForPut) GetPublicIps() *[]string { if o == nil { return nil } - return o.Lans + return o.PublicIps + } -// GetLansOk returns a tuple with the Lans field value +// GetPublicIpsOk returns a tuple with the PublicIps 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 *KubernetesNodePoolPropertiesForPut) GetLansOk() (*[]KubernetesNodePoolLan, bool) { +func (o *KubernetesNodePoolPropertiesForPut) GetPublicIpsOk() (*[]string, bool) { if o == nil { return nil, false } - return o.Lans, true + + return o.PublicIps, true } -// SetLans sets field value -func (o *KubernetesNodePoolPropertiesForPut) SetLans(v []KubernetesNodePoolLan) { - o.Lans = &v +// SetPublicIps sets field value +func (o *KubernetesNodePoolPropertiesForPut) SetPublicIps(v []string) { + + o.PublicIps = &v + } -// HasLans returns a boolean if a field has been set. -func (o *KubernetesNodePoolPropertiesForPut) HasLans() bool { - if o != nil && o.Lans != nil { +// HasPublicIps returns a boolean if a field has been set. +func (o *KubernetesNodePoolPropertiesForPut) HasPublicIps() bool { + if o != nil && o.PublicIps != nil { return true } return false } - func (o KubernetesNodePoolPropertiesForPut) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - - if o.DatacenterId != nil { - toSerialize["datacenterId"] = o.DatacenterId - } - - if o.NodeCount != nil { toSerialize["nodeCount"] = o.NodeCount } - - - if o.CpuFamily != nil { - toSerialize["cpuFamily"] = o.CpuFamily - } - - - if o.CoresCount != nil { - toSerialize["coresCount"] = o.CoresCount - } - - - if o.RamSize != nil { - toSerialize["ramSize"] = o.RamSize - } - - - if o.AvailabilityZone != nil { - toSerialize["availabilityZone"] = o.AvailabilityZone - } - - - if o.StorageType != nil { - toSerialize["storageType"] = o.StorageType - } - - - if o.StorageSize != nil { - toSerialize["storageSize"] = o.StorageSize - } - - if o.K8sVersion != nil { toSerialize["k8sVersion"] = o.K8sVersion } - - if o.MaintenanceWindow != nil { toSerialize["maintenanceWindow"] = o.MaintenanceWindow } - - if o.AutoScaling != nil { toSerialize["autoScaling"] = o.AutoScaling } - - if o.Lans != nil { toSerialize["lans"] = o.Lans } - + if o.Labels != nil { + toSerialize["labels"] = o.Labels + } + if o.Annotations != nil { + toSerialize["annotations"] = o.Annotations + } + if o.PublicIps != nil { + toSerialize["publicIps"] = o.PublicIps + } return json.Marshal(toSerialize) } @@ -616,5 +463,3 @@ func (v *NullableKubernetesNodePoolPropertiesForPut) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pools.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pools.go index 7496854f1df6..9e9d8d80e433 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pools.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_pools.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // KubernetesNodePools struct for KubernetesNodePools type KubernetesNodePools struct { - // Unique representation for Kubernetes Node Pool as a collection on a resource. + // A unique representation of the Kubernetes node pool as a resource collection. Id *string `json:"id,omitempty"` - // The type of resource within a collection + // The type of resource within a collection. Type *string `json:"type,omitempty"` - // URL to the collection representation (absolute path) + // URL to the collection representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]KubernetesNodePool `json:"items,omitempty"` } +// NewKubernetesNodePools instantiates a new KubernetesNodePools object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodePools() *KubernetesNodePools { + this := KubernetesNodePools{} + return &this +} + +// NewKubernetesNodePoolsWithDefaults instantiates a new KubernetesNodePools object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePoolsWithDefaults() *KubernetesNodePools { + this := KubernetesNodePools{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *KubernetesNodePools) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *KubernetesNodePools) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNodePools) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *KubernetesNodePools) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePools) GetType() *string { @@ -72,6 +90,7 @@ func (o *KubernetesNodePools) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *KubernetesNodePools) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesNodePools) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *KubernetesNodePools) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodePools) GetHref() *string { @@ -108,6 +128,7 @@ func (o *KubernetesNodePools) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *KubernetesNodePools) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesNodePools) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *KubernetesNodePools) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []KubernetesNodePool will be returned func (o *KubernetesNodePools) GetItems() *[]KubernetesNodePool { @@ -144,6 +166,7 @@ func (o *KubernetesNodePools) GetItems() *[]KubernetesNodePool { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *KubernetesNodePools) GetItemsOk() (*[]KubernetesNodePool, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *KubernetesNodePools) SetItems(v []KubernetesNodePool) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *KubernetesNodePools) HasItems() bool { return false } - func (o KubernetesNodePools) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableKubernetesNodePools) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_properties.go index 0c3181da4b3b..eee05965c629 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_node_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,15 +16,36 @@ import ( // KubernetesNodeProperties struct for KubernetesNodeProperties type KubernetesNodeProperties struct { - // A Kubernetes Node Name. + // A Kubernetes node name. Name *string `json:"name"` // A valid public IP. - PublicIP *string `json:"publicIP"` - // The kubernetes version in which a nodepool is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions. + PublicIP *string `json:"publicIP,omitempty"` + // A valid private IP. + PrivateIP *string `json:"privateIP,omitempty"` + // The Kubernetes version the nodepool is running. This imposes restrictions on what Kubernetes versions can be run in a cluster's nodepools. Additionally, not all Kubernetes versions are viable upgrade targets for all prior versions. K8sVersion *string `json:"k8sVersion"` } +// NewKubernetesNodeProperties instantiates a new KubernetesNodeProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodeProperties(name string, k8sVersion string) *KubernetesNodeProperties { + this := KubernetesNodeProperties{} + this.Name = &name + this.K8sVersion = &k8sVersion + + return &this +} + +// NewKubernetesNodePropertiesWithDefaults instantiates a new KubernetesNodeProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodePropertiesWithDefaults() *KubernetesNodeProperties { + this := KubernetesNodeProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +55,7 @@ func (o *KubernetesNodeProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -43,12 +65,15 @@ func (o *KubernetesNodeProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *KubernetesNodeProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -60,8 +85,6 @@ func (o *KubernetesNodeProperties) HasName() bool { return false } - - // GetPublicIP returns the PublicIP field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodeProperties) GetPublicIP() *string { @@ -70,6 +93,7 @@ func (o *KubernetesNodeProperties) GetPublicIP() *string { } return o.PublicIP + } // GetPublicIPOk returns a tuple with the PublicIP field value @@ -79,12 +103,15 @@ func (o *KubernetesNodeProperties) GetPublicIPOk() (*string, bool) { if o == nil { return nil, false } + return o.PublicIP, true } // SetPublicIP sets field value func (o *KubernetesNodeProperties) SetPublicIP(v string) { + o.PublicIP = &v + } // HasPublicIP returns a boolean if a field has been set. @@ -96,7 +123,43 @@ func (o *KubernetesNodeProperties) HasPublicIP() bool { return false } +// GetPrivateIP returns the PrivateIP field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KubernetesNodeProperties) GetPrivateIP() *string { + if o == nil { + return nil + } + + return o.PrivateIP +} + +// GetPrivateIPOk returns a tuple with the PrivateIP 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 *KubernetesNodeProperties) GetPrivateIPOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.PrivateIP, true +} + +// SetPrivateIP sets field value +func (o *KubernetesNodeProperties) SetPrivateIP(v string) { + + o.PrivateIP = &v + +} + +// HasPrivateIP returns a boolean if a field has been set. +func (o *KubernetesNodeProperties) HasPrivateIP() bool { + if o != nil && o.PrivateIP != nil { + return true + } + + return false +} // GetK8sVersion returns the K8sVersion field value // If the value is explicit nil, the zero value for string will be returned @@ -106,6 +169,7 @@ func (o *KubernetesNodeProperties) GetK8sVersion() *string { } return o.K8sVersion + } // GetK8sVersionOk returns a tuple with the K8sVersion field value @@ -115,12 +179,15 @@ func (o *KubernetesNodeProperties) GetK8sVersionOk() (*string, bool) { if o == nil { return nil, false } + return o.K8sVersion, true } // SetK8sVersion sets field value func (o *KubernetesNodeProperties) SetK8sVersion(v string) { + o.K8sVersion = &v + } // HasK8sVersion returns a boolean if a field has been set. @@ -132,24 +199,20 @@ func (o *KubernetesNodeProperties) HasK8sVersion() bool { return false } - func (o KubernetesNodeProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.PublicIP != nil { toSerialize["publicIP"] = o.PublicIP } - - + if o.PrivateIP != nil { + toSerialize["privateIP"] = o.PrivateIP + } if o.K8sVersion != nil { toSerialize["k8sVersion"] = o.K8sVersion } - return json.Marshal(toSerialize) } @@ -188,5 +251,3 @@ func (v *NullableKubernetesNodeProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_nodes.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_nodes.go index 0c5cf8a41232..8381bf4ccd9f 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_nodes.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_nodes.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // KubernetesNodes struct for KubernetesNodes type KubernetesNodes struct { - // Unique representation for Kubernetes Node Pool as a collection on a resource. + // A unique representation of the Kubernetes node pool as a resource collection. Id *string `json:"id,omitempty"` - // The type of resource within a collection + // The type of resource within a collection. Type *string `json:"type,omitempty"` - // URL to the collection representation (absolute path) + // URL to the collection representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]KubernetesNode `json:"items,omitempty"` } +// NewKubernetesNodes instantiates a new KubernetesNodes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesNodes() *KubernetesNodes { + this := KubernetesNodes{} + return &this +} + +// NewKubernetesNodesWithDefaults instantiates a new KubernetesNodes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesNodesWithDefaults() *KubernetesNodes { + this := KubernetesNodes{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *KubernetesNodes) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *KubernetesNodes) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *KubernetesNodes) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *KubernetesNodes) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodes) GetType() *string { @@ -72,6 +90,7 @@ func (o *KubernetesNodes) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *KubernetesNodes) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *KubernetesNodes) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *KubernetesNodes) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *KubernetesNodes) GetHref() *string { @@ -108,6 +128,7 @@ func (o *KubernetesNodes) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *KubernetesNodes) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *KubernetesNodes) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *KubernetesNodes) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []KubernetesNode will be returned func (o *KubernetesNodes) GetItems() *[]KubernetesNode { @@ -144,6 +166,7 @@ func (o *KubernetesNodes) GetItems() *[]KubernetesNode { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *KubernetesNodes) GetItemsOk() (*[]KubernetesNode, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *KubernetesNodes) SetItems(v []KubernetesNode) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *KubernetesNodes) HasItems() bool { return false } - func (o KubernetesNodes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableKubernetesNodes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label.go index 7e1af0509267..c162e6763347 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,15 +18,33 @@ import ( type Label struct { // Label is identified using standard URN. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *NoStateMetaData `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *NoStateMetaData `json:"metadata,omitempty"` Properties *LabelProperties `json:"properties"` } +// NewLabel instantiates a new Label object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabel(properties LabelProperties) *Label { + this := Label{} + this.Properties = &properties + + return &this +} + +// NewLabelWithDefaults instantiates a new Label object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelWithDefaults() *Label { + this := Label{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Label) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Label) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Label) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Label) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *Label) GetType() *string { @@ -72,6 +92,7 @@ func (o *Label) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Label) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Label) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Label) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Label) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Label) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Label) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Label) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Label) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for NoStateMetaData will be returned func (o *Label) GetMetadata() *NoStateMetaData { @@ -144,6 +168,7 @@ func (o *Label) GetMetadata() *NoStateMetaData { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Label) GetMetadataOk() (*NoStateMetaData, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Label) SetMetadata(v NoStateMetaData) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Label) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LabelProperties will be returned func (o *Label) GetProperties() *LabelProperties { @@ -180,6 +206,7 @@ func (o *Label) GetProperties() *LabelProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Label) GetPropertiesOk() (*LabelProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Label) SetProperties(v LabelProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Label) HasProperties() bool { return false } - func (o Label) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableLabel) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_properties.go index 58c84024f641..a7a0d794cf57 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,11 +16,11 @@ import ( // LabelProperties struct for LabelProperties type LabelProperties struct { - // A Label Key + // A label key Key *string `json:"key,omitempty"` - // A Label Value + // A label value Value *string `json:"value,omitempty"` - // The id of the resource + // The ID of the resource. ResourceId *string `json:"resourceId,omitempty"` // The type of the resource on which the label is applied. ResourceType *string `json:"resourceType,omitempty"` @@ -28,7 +28,23 @@ type LabelProperties struct { ResourceHref *string `json:"resourceHref,omitempty"` } +// NewLabelProperties instantiates a new LabelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabelProperties() *LabelProperties { + this := LabelProperties{} + return &this +} + +// NewLabelPropertiesWithDefaults instantiates a new LabelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelPropertiesWithDefaults() *LabelProperties { + this := LabelProperties{} + return &this +} // GetKey returns the Key field value // If the value is explicit nil, the zero value for string will be returned @@ -38,6 +54,7 @@ func (o *LabelProperties) GetKey() *string { } return o.Key + } // GetKeyOk returns a tuple with the Key field value @@ -47,12 +64,15 @@ func (o *LabelProperties) GetKeyOk() (*string, bool) { if o == nil { return nil, false } + return o.Key, true } // SetKey sets field value func (o *LabelProperties) SetKey(v string) { + o.Key = &v + } // HasKey returns a boolean if a field has been set. @@ -64,8 +84,6 @@ func (o *LabelProperties) HasKey() bool { return false } - - // GetValue returns the Value field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelProperties) GetValue() *string { @@ -74,6 +92,7 @@ func (o *LabelProperties) GetValue() *string { } return o.Value + } // GetValueOk returns a tuple with the Value field value @@ -83,12 +102,15 @@ func (o *LabelProperties) GetValueOk() (*string, bool) { if o == nil { return nil, false } + return o.Value, true } // SetValue sets field value func (o *LabelProperties) SetValue(v string) { + o.Value = &v + } // HasValue returns a boolean if a field has been set. @@ -100,8 +122,6 @@ func (o *LabelProperties) HasValue() bool { return false } - - // GetResourceId returns the ResourceId field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelProperties) GetResourceId() *string { @@ -110,6 +130,7 @@ func (o *LabelProperties) GetResourceId() *string { } return o.ResourceId + } // GetResourceIdOk returns a tuple with the ResourceId field value @@ -119,12 +140,15 @@ func (o *LabelProperties) GetResourceIdOk() (*string, bool) { if o == nil { return nil, false } + return o.ResourceId, true } // SetResourceId sets field value func (o *LabelProperties) SetResourceId(v string) { + o.ResourceId = &v + } // HasResourceId returns a boolean if a field has been set. @@ -136,8 +160,6 @@ func (o *LabelProperties) HasResourceId() bool { return false } - - // GetResourceType returns the ResourceType field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelProperties) GetResourceType() *string { @@ -146,6 +168,7 @@ func (o *LabelProperties) GetResourceType() *string { } return o.ResourceType + } // GetResourceTypeOk returns a tuple with the ResourceType field value @@ -155,12 +178,15 @@ func (o *LabelProperties) GetResourceTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.ResourceType, true } // SetResourceType sets field value func (o *LabelProperties) SetResourceType(v string) { + o.ResourceType = &v + } // HasResourceType returns a boolean if a field has been set. @@ -172,8 +198,6 @@ func (o *LabelProperties) HasResourceType() bool { return false } - - // GetResourceHref returns the ResourceHref field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelProperties) GetResourceHref() *string { @@ -182,6 +206,7 @@ func (o *LabelProperties) GetResourceHref() *string { } return o.ResourceHref + } // GetResourceHrefOk returns a tuple with the ResourceHref field value @@ -191,12 +216,15 @@ func (o *LabelProperties) GetResourceHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.ResourceHref, true } // SetResourceHref sets field value func (o *LabelProperties) SetResourceHref(v string) { + o.ResourceHref = &v + } // HasResourceHref returns a boolean if a field has been set. @@ -208,34 +236,23 @@ func (o *LabelProperties) HasResourceHref() bool { return false } - func (o LabelProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { toSerialize["key"] = o.Key } - - if o.Value != nil { toSerialize["value"] = o.Value } - - if o.ResourceId != nil { toSerialize["resourceId"] = o.ResourceId } - - if o.ResourceType != nil { toSerialize["resourceType"] = o.ResourceType } - - if o.ResourceHref != nil { toSerialize["resourceHref"] = o.ResourceHref } - return json.Marshal(toSerialize) } @@ -274,5 +291,3 @@ func (v *NullableLabelProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource.go index 34d7e10160a3..29ebef96dfe6 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -18,15 +18,33 @@ import ( type LabelResource struct { // Label on a resource is identified using label key. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *NoStateMetaData `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *NoStateMetaData `json:"metadata,omitempty"` Properties *LabelResourceProperties `json:"properties"` } +// NewLabelResource instantiates a new LabelResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabelResource(properties LabelResourceProperties) *LabelResource { + this := LabelResource{} + this.Properties = &properties + + return &this +} + +// NewLabelResourceWithDefaults instantiates a new LabelResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelResourceWithDefaults() *LabelResource { + this := LabelResource{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *LabelResource) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *LabelResource) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *LabelResource) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *LabelResource) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelResource) GetType() *string { @@ -72,6 +92,7 @@ func (o *LabelResource) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *LabelResource) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *LabelResource) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *LabelResource) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelResource) GetHref() *string { @@ -108,6 +130,7 @@ func (o *LabelResource) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *LabelResource) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *LabelResource) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *LabelResource) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for NoStateMetaData will be returned func (o *LabelResource) GetMetadata() *NoStateMetaData { @@ -144,6 +168,7 @@ func (o *LabelResource) GetMetadata() *NoStateMetaData { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *LabelResource) GetMetadataOk() (*NoStateMetaData, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *LabelResource) SetMetadata(v NoStateMetaData) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *LabelResource) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LabelResourceProperties will be returned func (o *LabelResource) GetProperties() *LabelResourceProperties { @@ -180,6 +206,7 @@ func (o *LabelResource) GetProperties() *LabelResourceProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *LabelResource) GetPropertiesOk() (*LabelResourceProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *LabelResource) SetProperties(v LabelResourceProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *LabelResource) HasProperties() bool { return false } - func (o LabelResource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableLabelResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource_properties.go index 27ca1ff7734b..ef0836dff593 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resource_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,29 @@ import ( // LabelResourceProperties struct for LabelResourceProperties type LabelResourceProperties struct { - // A Label Key + // A label key Key *string `json:"key,omitempty"` - // A Label Value + // A label value Value *string `json:"value,omitempty"` } +// NewLabelResourceProperties instantiates a new LabelResourceProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabelResourceProperties() *LabelResourceProperties { + this := LabelResourceProperties{} + return &this +} + +// NewLabelResourcePropertiesWithDefaults instantiates a new LabelResourceProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelResourcePropertiesWithDefaults() *LabelResourceProperties { + this := LabelResourceProperties{} + return &this +} // GetKey returns the Key field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +48,7 @@ func (o *LabelResourceProperties) GetKey() *string { } return o.Key + } // GetKeyOk returns a tuple with the Key field value @@ -41,12 +58,15 @@ func (o *LabelResourceProperties) GetKeyOk() (*string, bool) { if o == nil { return nil, false } + return o.Key, true } // SetKey sets field value func (o *LabelResourceProperties) SetKey(v string) { + o.Key = &v + } // HasKey returns a boolean if a field has been set. @@ -58,8 +78,6 @@ func (o *LabelResourceProperties) HasKey() bool { return false } - - // GetValue returns the Value field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelResourceProperties) GetValue() *string { @@ -68,6 +86,7 @@ func (o *LabelResourceProperties) GetValue() *string { } return o.Value + } // GetValueOk returns a tuple with the Value field value @@ -77,12 +96,15 @@ func (o *LabelResourceProperties) GetValueOk() (*string, bool) { if o == nil { return nil, false } + return o.Value, true } // SetValue sets field value func (o *LabelResourceProperties) SetValue(v string) { + o.Value = &v + } // HasValue returns a boolean if a field has been set. @@ -94,19 +116,14 @@ func (o *LabelResourceProperties) HasValue() bool { return false } - func (o LabelResourceProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { toSerialize["key"] = o.Key } - - if o.Value != nil { toSerialize["value"] = o.Value } - return json.Marshal(toSerialize) } @@ -145,5 +162,3 @@ func (v *NullableLabelResourceProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resources.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resources.go index 43367e1de08a..673f4f3283f8 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resources.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_label_resources.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // LabelResources struct for LabelResources type LabelResources struct { - // Unique representation for Label as a collection on a resource. + // A unique representation of the label as a resource collection. Id *string `json:"id,omitempty"` - // The type of resource within a collection + // The type of resource within a collection. Type *string `json:"type,omitempty"` - // URL to the collection representation (absolute path) + // URL to the collection representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]LabelResource `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewLabelResources instantiates a new LabelResources object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabelResources() *LabelResources { + this := LabelResources{} + return &this +} + +// NewLabelResourcesWithDefaults instantiates a new LabelResources object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelResourcesWithDefaults() *LabelResources { + this := LabelResources{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *LabelResources) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *LabelResources) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *LabelResources) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *LabelResources) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelResources) GetType() *string { @@ -72,6 +95,7 @@ func (o *LabelResources) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *LabelResources) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *LabelResources) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *LabelResources) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *LabelResources) GetHref() *string { @@ -108,6 +133,7 @@ func (o *LabelResources) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *LabelResources) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *LabelResources) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *LabelResources) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []LabelResource will be returned func (o *LabelResources) GetItems() *[]LabelResource { @@ -144,6 +171,7 @@ func (o *LabelResources) GetItems() *[]LabelResource { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *LabelResources) GetItemsOk() (*[]LabelResource, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *LabelResources) SetItems(v []LabelResource) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *LabelResources) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *LabelResources) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LabelResources) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *LabelResources) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *LabelResources) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *LabelResources) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LabelResources) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *LabelResources) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *LabelResources) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *LabelResources) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LabelResources) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *LabelResources) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *LabelResources) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o LabelResources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableLabelResources) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_labels.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_labels.go index 72ac151e2854..d83bdbcfcd44 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_labels.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_labels.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // Labels struct for Labels type Labels struct { - // Unique representation for Label as a collection of resource. + // A unique representation of the label as a resource collection. Id *string `json:"id,omitempty"` - // The type of resource within a collection + // The type of resource within a collection. Type *string `json:"type,omitempty"` - // URL to the collection representation (absolute path) + // URL to the collection representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Label `json:"items,omitempty"` } +// NewLabels instantiates a new Labels object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLabels() *Labels { + this := Labels{} + return &this +} + +// NewLabelsWithDefaults instantiates a new Labels object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLabelsWithDefaults() *Labels { + this := Labels{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Labels) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Labels) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Labels) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Labels) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *Labels) GetType() *string { @@ -72,6 +90,7 @@ func (o *Labels) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Labels) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Labels) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Labels) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Labels) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Labels) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Labels) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Labels) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Labels) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Label will be returned func (o *Labels) GetItems() *[]Label { @@ -144,6 +166,7 @@ func (o *Labels) GetItems() *[]Label { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Labels) GetItemsOk() (*[]Label, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Labels) SetItems(v []Label) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Labels) HasItems() bool { return false } - func (o Labels) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableLabels) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan.go index 8edc04fc9781..120c2f17f535 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // Lan struct for Lan type Lan struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *LanProperties `json:"properties"` - Entities *LanEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *LanProperties `json:"properties"` + Entities *LanEntities `json:"entities,omitempty"` } +// NewLan instantiates a new Lan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLan(properties LanProperties) *Lan { + this := Lan{} + this.Properties = &properties + + return &this +} + +// NewLanWithDefaults instantiates a new Lan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanWithDefaults() *Lan { + this := Lan{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *Lan) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *Lan) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Lan) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *Lan) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Lan) GetType() *Type { @@ -73,6 +93,7 @@ func (o *Lan) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *Lan) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Lan) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *Lan) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Lan) GetHref() *string { @@ -109,6 +131,7 @@ func (o *Lan) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *Lan) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Lan) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *Lan) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Lan) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *Lan) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *Lan) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Lan) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *Lan) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LanProperties will be returned func (o *Lan) GetProperties() *LanProperties { @@ -181,6 +207,7 @@ func (o *Lan) GetProperties() *LanProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *Lan) GetPropertiesOk() (*LanProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Lan) SetProperties(v LanProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *Lan) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for LanEntities will be returned func (o *Lan) GetEntities() *LanEntities { @@ -217,6 +245,7 @@ func (o *Lan) GetEntities() *LanEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *Lan) GetEntitiesOk() (*LanEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Lan) SetEntities(v LanEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *Lan) HasEntities() bool { return false } - func (o Lan) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableLan) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_entities.go index 4fdf1c664380..f4d242ac8118 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -19,7 +19,23 @@ type LanEntities struct { Nics *LanNics `json:"nics,omitempty"` } +// NewLanEntities instantiates a new LanEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLanEntities() *LanEntities { + this := LanEntities{} + return &this +} + +// NewLanEntitiesWithDefaults instantiates a new LanEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanEntitiesWithDefaults() *LanEntities { + this := LanEntities{} + return &this +} // GetNics returns the Nics field value // If the value is explicit nil, the zero value for LanNics will be returned @@ -29,6 +45,7 @@ func (o *LanEntities) GetNics() *LanNics { } return o.Nics + } // GetNicsOk returns a tuple with the Nics field value @@ -38,12 +55,15 @@ func (o *LanEntities) GetNicsOk() (*LanNics, bool) { if o == nil { return nil, false } + return o.Nics, true } // SetNics sets field value func (o *LanEntities) SetNics(v LanNics) { + o.Nics = &v + } // HasNics returns a boolean if a field has been set. @@ -55,14 +75,11 @@ func (o *LanEntities) HasNics() bool { return false } - func (o LanEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Nics != nil { toSerialize["nics"] = o.Nics } - return json.Marshal(toSerialize) } @@ -101,5 +118,3 @@ func (v *NullableLanEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_nics.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_nics.go index a13c06b9a56b..f348c1458a45 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_nics.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_nics.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // LanNics struct for LanNics type LanNics struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Nic `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewLanNics instantiates a new LanNics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLanNics() *LanNics { + this := LanNics{} + return &this +} + +// NewLanNicsWithDefaults instantiates a new LanNics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanNicsWithDefaults() *LanNics { + this := LanNics{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *LanNics) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *LanNics) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *LanNics) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *LanNics) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *LanNics) GetType() *Type { @@ -72,6 +95,7 @@ func (o *LanNics) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *LanNics) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *LanNics) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *LanNics) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *LanNics) GetHref() *string { @@ -108,6 +133,7 @@ func (o *LanNics) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *LanNics) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *LanNics) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *LanNics) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Nic will be returned func (o *LanNics) GetItems() *[]Nic { @@ -144,6 +171,7 @@ func (o *LanNics) GetItems() *[]Nic { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *LanNics) GetItemsOk() (*[]Nic, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *LanNics) SetItems(v []Nic) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *LanNics) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *LanNics) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LanNics) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *LanNics) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *LanNics) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *LanNics) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LanNics) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *LanNics) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *LanNics) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *LanNics) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LanNics) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *LanNics) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *LanNics) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o LanNics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableLanNics) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_post.go index 122fe8721548..3af870c67363 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_post.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_post.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // LanPost struct for LanPost type LanPost struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Entities *LanEntities `json:"entities,omitempty"` - Properties *LanPropertiesPost `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Entities *LanEntities `json:"entities,omitempty"` + Properties *LanPropertiesPost `json:"properties"` } +// NewLanPost instantiates a new LanPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLanPost(properties LanPropertiesPost) *LanPost { + this := LanPost{} + this.Properties = &properties + + return &this +} + +// NewLanPostWithDefaults instantiates a new LanPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanPostWithDefaults() *LanPost { + this := LanPost{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *LanPost) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *LanPost) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *LanPost) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *LanPost) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *LanPost) GetType() *Type { @@ -73,6 +93,7 @@ func (o *LanPost) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *LanPost) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *LanPost) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *LanPost) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *LanPost) GetHref() *string { @@ -109,6 +131,7 @@ func (o *LanPost) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *LanPost) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *LanPost) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *LanPost) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *LanPost) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *LanPost) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *LanPost) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *LanPost) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *LanPost) HasMetadata() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for LanEntities will be returned func (o *LanPost) GetEntities() *LanEntities { @@ -181,6 +207,7 @@ func (o *LanPost) GetEntities() *LanEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -190,12 +217,15 @@ func (o *LanPost) GetEntitiesOk() (*LanEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *LanPost) SetEntities(v LanEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *LanPost) HasEntities() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LanPropertiesPost will be returned func (o *LanPost) GetProperties() *LanPropertiesPost { @@ -217,6 +245,7 @@ func (o *LanPost) GetProperties() *LanPropertiesPost { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -226,12 +255,15 @@ func (o *LanPost) GetPropertiesOk() (*LanPropertiesPost, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *LanPost) SetProperties(v LanPropertiesPost) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *LanPost) HasProperties() bool { return false } - func (o LanPost) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableLanPost) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties.go index 0b6e35290da5..763ced62b1d3 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // LanProperties struct for LanProperties type LanProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` // IP failover configurations for lan IpFailover *[]IPFailover `json:"ipFailover,omitempty"` - // Unique identifier of the private cross connect the given LAN is connected to if any + // The unique identifier of the private Cross-Connect the LAN is connected to, if any. Pcc *string `json:"pcc,omitempty"` - // Does this LAN faces the public Internet or not + // This LAN faces the public Internet. Public *bool `json:"public,omitempty"` } +// NewLanProperties instantiates a new LanProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLanProperties() *LanProperties { + this := LanProperties{} + return &this +} + +// NewLanPropertiesWithDefaults instantiates a new LanProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanPropertiesWithDefaults() *LanProperties { + this := LanProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *LanProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -45,12 +62,15 @@ func (o *LanProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *LanProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *LanProperties) HasName() bool { return false } - - // GetIpFailover returns the IpFailover field value // If the value is explicit nil, the zero value for []IPFailover will be returned func (o *LanProperties) GetIpFailover() *[]IPFailover { @@ -72,6 +90,7 @@ func (o *LanProperties) GetIpFailover() *[]IPFailover { } return o.IpFailover + } // GetIpFailoverOk returns a tuple with the IpFailover field value @@ -81,12 +100,15 @@ func (o *LanProperties) GetIpFailoverOk() (*[]IPFailover, bool) { if o == nil { return nil, false } + return o.IpFailover, true } // SetIpFailover sets field value func (o *LanProperties) SetIpFailover(v []IPFailover) { + o.IpFailover = &v + } // HasIpFailover returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *LanProperties) HasIpFailover() bool { return false } - - // GetPcc returns the Pcc field value // If the value is explicit nil, the zero value for string will be returned func (o *LanProperties) GetPcc() *string { @@ -108,6 +128,7 @@ func (o *LanProperties) GetPcc() *string { } return o.Pcc + } // GetPccOk returns a tuple with the Pcc field value @@ -117,12 +138,15 @@ func (o *LanProperties) GetPccOk() (*string, bool) { if o == nil { return nil, false } + return o.Pcc, true } // SetPcc sets field value func (o *LanProperties) SetPcc(v string) { + o.Pcc = &v + } // HasPcc returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *LanProperties) HasPcc() bool { return false } - - // GetPublic returns the Public field value // If the value is explicit nil, the zero value for bool will be returned func (o *LanProperties) GetPublic() *bool { @@ -144,6 +166,7 @@ func (o *LanProperties) GetPublic() *bool { } return o.Public + } // GetPublicOk returns a tuple with the Public field value @@ -153,12 +176,15 @@ func (o *LanProperties) GetPublicOk() (*bool, bool) { if o == nil { return nil, false } + return o.Public, true } // SetPublic sets field value func (o *LanProperties) SetPublic(v bool) { + o.Public = &v + } // HasPublic returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *LanProperties) HasPublic() bool { return false } - func (o LanProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.IpFailover != nil { toSerialize["ipFailover"] = o.IpFailover } - - if o.Pcc != nil { toSerialize["pcc"] = o.Pcc } - - if o.Public != nil { toSerialize["public"] = o.Public } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableLanProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties_post.go index 6636bfffcc4e..3492c2079ae0 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties_post.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lan_properties_post.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,33 @@ import ( // LanPropertiesPost struct for LanPropertiesPost type LanPropertiesPost struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Does this LAN faces the public Internet or not + // IP failover configurations for lan + IpFailover *[]IPFailover `json:"ipFailover,omitempty"` + // The unique identifier of the private Cross-Connect the LAN is connected to, if any. + Pcc *string `json:"pcc,omitempty"` + // This LAN faces the public Internet. Public *bool `json:"public,omitempty"` } +// NewLanPropertiesPost instantiates a new LanPropertiesPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLanPropertiesPost() *LanPropertiesPost { + this := LanPropertiesPost{} + return &this +} + +// NewLanPropertiesPostWithDefaults instantiates a new LanPropertiesPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLanPropertiesPostWithDefaults() *LanPropertiesPost { + this := LanPropertiesPost{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +52,7 @@ func (o *LanPropertiesPost) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -41,12 +62,15 @@ func (o *LanPropertiesPost) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *LanPropertiesPost) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -58,7 +82,81 @@ func (o *LanPropertiesPost) HasName() bool { return false } +// GetIpFailover returns the IpFailover field value +// If the value is explicit nil, the zero value for []IPFailover will be returned +func (o *LanPropertiesPost) GetIpFailover() *[]IPFailover { + if o == nil { + return nil + } + + return o.IpFailover + +} + +// GetIpFailoverOk returns a tuple with the IpFailover 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 *LanPropertiesPost) GetIpFailoverOk() (*[]IPFailover, bool) { + if o == nil { + return nil, false + } + + return o.IpFailover, true +} + +// SetIpFailover sets field value +func (o *LanPropertiesPost) SetIpFailover(v []IPFailover) { + o.IpFailover = &v + +} + +// HasIpFailover returns a boolean if a field has been set. +func (o *LanPropertiesPost) HasIpFailover() bool { + if o != nil && o.IpFailover != nil { + return true + } + + return false +} + +// GetPcc returns the Pcc field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LanPropertiesPost) GetPcc() *string { + if o == nil { + return nil + } + + return o.Pcc + +} + +// GetPccOk returns a tuple with the Pcc 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 *LanPropertiesPost) GetPccOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Pcc, true +} + +// SetPcc sets field value +func (o *LanPropertiesPost) SetPcc(v string) { + + o.Pcc = &v + +} + +// HasPcc returns a boolean if a field has been set. +func (o *LanPropertiesPost) HasPcc() bool { + if o != nil && o.Pcc != nil { + return true + } + + return false +} // GetPublic returns the Public field value // If the value is explicit nil, the zero value for bool will be returned @@ -68,6 +166,7 @@ func (o *LanPropertiesPost) GetPublic() *bool { } return o.Public + } // GetPublicOk returns a tuple with the Public field value @@ -77,12 +176,15 @@ func (o *LanPropertiesPost) GetPublicOk() (*bool, bool) { if o == nil { return nil, false } + return o.Public, true } // SetPublic sets field value func (o *LanPropertiesPost) SetPublic(v bool) { + o.Public = &v + } // HasPublic returns a boolean if a field has been set. @@ -94,19 +196,20 @@ func (o *LanPropertiesPost) HasPublic() bool { return false } - func (o LanPropertiesPost) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - + if o.IpFailover != nil { + toSerialize["ipFailover"] = o.IpFailover + } + if o.Pcc != nil { + toSerialize["pcc"] = o.Pcc + } if o.Public != nil { toSerialize["public"] = o.Public } - return json.Marshal(toSerialize) } @@ -145,5 +248,3 @@ func (v *NullableLanPropertiesPost) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lans.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lans.go index ec2aeb3330c4..361b3809f924 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lans.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_lans.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Lans struct for Lans type Lans struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Lan `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewLans instantiates a new Lans object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLans() *Lans { + this := Lans{} + return &this +} + +// NewLansWithDefaults instantiates a new Lans object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLansWithDefaults() *Lans { + this := Lans{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Lans) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Lans) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Lans) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Lans) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Lans) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Lans) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Lans) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Lans) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Lans) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Lans) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Lans) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Lans) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Lans) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Lans) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Lan will be returned func (o *Lans) GetItems() *[]Lan { @@ -144,6 +171,7 @@ func (o *Lans) GetItems() *[]Lan { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Lans) GetItemsOk() (*[]Lan, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Lans) SetItems(v []Lan) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Lans) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Lans) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Lans) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Lans) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Lans) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Lans) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Lans) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Lans) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Lans) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Lans) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Lans) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Lans) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Lans) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Lans) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableLans) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer.go index 47a0adf82097..822d7f1c38e2 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // Loadbalancer struct for Loadbalancer type Loadbalancer struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *LoadbalancerProperties `json:"properties"` - Entities *LoadbalancerEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *LoadbalancerProperties `json:"properties"` + Entities *LoadbalancerEntities `json:"entities,omitempty"` } +// NewLoadbalancer instantiates a new Loadbalancer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancer(properties LoadbalancerProperties) *Loadbalancer { + this := Loadbalancer{} + this.Properties = &properties + + return &this +} + +// NewLoadbalancerWithDefaults instantiates a new Loadbalancer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerWithDefaults() *Loadbalancer { + this := Loadbalancer{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *Loadbalancer) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *Loadbalancer) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Loadbalancer) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *Loadbalancer) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Loadbalancer) GetType() *Type { @@ -73,6 +93,7 @@ func (o *Loadbalancer) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *Loadbalancer) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Loadbalancer) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *Loadbalancer) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Loadbalancer) GetHref() *string { @@ -109,6 +131,7 @@ func (o *Loadbalancer) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *Loadbalancer) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Loadbalancer) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *Loadbalancer) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Loadbalancer) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *Loadbalancer) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *Loadbalancer) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Loadbalancer) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *Loadbalancer) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LoadbalancerProperties will be returned func (o *Loadbalancer) GetProperties() *LoadbalancerProperties { @@ -181,6 +207,7 @@ func (o *Loadbalancer) GetProperties() *LoadbalancerProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *Loadbalancer) GetPropertiesOk() (*LoadbalancerProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Loadbalancer) SetProperties(v LoadbalancerProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *Loadbalancer) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for LoadbalancerEntities will be returned func (o *Loadbalancer) GetEntities() *LoadbalancerEntities { @@ -217,6 +245,7 @@ func (o *Loadbalancer) GetEntities() *LoadbalancerEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *Loadbalancer) GetEntitiesOk() (*LoadbalancerEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Loadbalancer) SetEntities(v LoadbalancerEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *Loadbalancer) HasEntities() bool { return false } - func (o Loadbalancer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableLoadbalancer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_entities.go index 69538781e24d..129844dcbd88 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -19,7 +19,23 @@ type LoadbalancerEntities struct { Balancednics *BalancedNics `json:"balancednics,omitempty"` } +// NewLoadbalancerEntities instantiates a new LoadbalancerEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerEntities() *LoadbalancerEntities { + this := LoadbalancerEntities{} + return &this +} + +// NewLoadbalancerEntitiesWithDefaults instantiates a new LoadbalancerEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerEntitiesWithDefaults() *LoadbalancerEntities { + this := LoadbalancerEntities{} + return &this +} // GetBalancednics returns the Balancednics field value // If the value is explicit nil, the zero value for BalancedNics will be returned @@ -29,6 +45,7 @@ func (o *LoadbalancerEntities) GetBalancednics() *BalancedNics { } return o.Balancednics + } // GetBalancednicsOk returns a tuple with the Balancednics field value @@ -38,12 +55,15 @@ func (o *LoadbalancerEntities) GetBalancednicsOk() (*BalancedNics, bool) { if o == nil { return nil, false } + return o.Balancednics, true } // SetBalancednics sets field value func (o *LoadbalancerEntities) SetBalancednics(v BalancedNics) { + o.Balancednics = &v + } // HasBalancednics returns a boolean if a field has been set. @@ -55,14 +75,11 @@ func (o *LoadbalancerEntities) HasBalancednics() bool { return false } - func (o LoadbalancerEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Balancednics != nil { toSerialize["balancednics"] = o.Balancednics } - return json.Marshal(toSerialize) } @@ -101,5 +118,3 @@ func (v *NullableLoadbalancerEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_properties.go index 61a6d83d7bdf..e6b9b02fb282 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancer_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,15 +16,31 @@ import ( // LoadbalancerProperties struct for LoadbalancerProperties type LoadbalancerProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // IPv4 address of the loadbalancer. All attached NICs will inherit this IP. Leaving value null will assign IP automatically + // IPv4 address of the loadbalancer. All attached NICs will inherit this IP. Leaving value null will assign IP automatically. Ip *string `json:"ip,omitempty"` - // Indicates if the loadbalancer will reserve an IP using DHCP + // Indicates if the loadbalancer will reserve an IP using DHCP. Dhcp *bool `json:"dhcp,omitempty"` } +// NewLoadbalancerProperties instantiates a new LoadbalancerProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancerProperties() *LoadbalancerProperties { + this := LoadbalancerProperties{} + return &this +} + +// NewLoadbalancerPropertiesWithDefaults instantiates a new LoadbalancerProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancerPropertiesWithDefaults() *LoadbalancerProperties { + this := LoadbalancerProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +50,7 @@ func (o *LoadbalancerProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -43,12 +60,15 @@ func (o *LoadbalancerProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *LoadbalancerProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -60,8 +80,6 @@ func (o *LoadbalancerProperties) HasName() bool { return false } - - // GetIp returns the Ip field value // If the value is explicit nil, the zero value for string will be returned func (o *LoadbalancerProperties) GetIp() *string { @@ -70,6 +88,7 @@ func (o *LoadbalancerProperties) GetIp() *string { } return o.Ip + } // GetIpOk returns a tuple with the Ip field value @@ -79,12 +98,15 @@ func (o *LoadbalancerProperties) GetIpOk() (*string, bool) { if o == nil { return nil, false } + return o.Ip, true } // SetIp sets field value func (o *LoadbalancerProperties) SetIp(v string) { + o.Ip = &v + } // HasIp returns a boolean if a field has been set. @@ -96,8 +118,6 @@ func (o *LoadbalancerProperties) HasIp() bool { return false } - - // GetDhcp returns the Dhcp field value // If the value is explicit nil, the zero value for bool will be returned func (o *LoadbalancerProperties) GetDhcp() *bool { @@ -106,6 +126,7 @@ func (o *LoadbalancerProperties) GetDhcp() *bool { } return o.Dhcp + } // GetDhcpOk returns a tuple with the Dhcp field value @@ -115,12 +136,15 @@ func (o *LoadbalancerProperties) GetDhcpOk() (*bool, bool) { if o == nil { return nil, false } + return o.Dhcp, true } // SetDhcp sets field value func (o *LoadbalancerProperties) SetDhcp(v bool) { + o.Dhcp = &v + } // HasDhcp returns a boolean if a field has been set. @@ -132,24 +156,15 @@ func (o *LoadbalancerProperties) HasDhcp() bool { return false } - func (o LoadbalancerProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - - if o.Ip != nil { - toSerialize["ip"] = o.Ip - } - - + toSerialize["ip"] = o.Ip if o.Dhcp != nil { toSerialize["dhcp"] = o.Dhcp } - return json.Marshal(toSerialize) } @@ -188,5 +203,3 @@ func (v *NullableLoadbalancerProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancers.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancers.go index 718b6fa6398f..166560f99b09 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancers.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_loadbalancers.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Loadbalancers struct for Loadbalancers type Loadbalancers struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Loadbalancer `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewLoadbalancers instantiates a new Loadbalancers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoadbalancers() *Loadbalancers { + this := Loadbalancers{} + return &this +} + +// NewLoadbalancersWithDefaults instantiates a new Loadbalancers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoadbalancersWithDefaults() *Loadbalancers { + this := Loadbalancers{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Loadbalancers) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Loadbalancers) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Loadbalancers) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Loadbalancers) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Loadbalancers) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Loadbalancers) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Loadbalancers) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Loadbalancers) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Loadbalancers) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Loadbalancers) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Loadbalancers) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Loadbalancers) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Loadbalancers) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Loadbalancers) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Loadbalancer will be returned func (o *Loadbalancers) GetItems() *[]Loadbalancer { @@ -144,6 +171,7 @@ func (o *Loadbalancers) GetItems() *[]Loadbalancer { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Loadbalancers) GetItemsOk() (*[]Loadbalancer, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Loadbalancers) SetItems(v []Loadbalancer) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Loadbalancers) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Loadbalancers) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Loadbalancers) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Loadbalancers) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Loadbalancers) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Loadbalancers) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Loadbalancers) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Loadbalancers) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Loadbalancers) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Loadbalancers) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Loadbalancers) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Loadbalancers) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Loadbalancers) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Loadbalancers) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableLoadbalancers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location.go index ece6e03b3980..59a250d45297 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Location struct for Location type Location struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *LocationProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *LocationProperties `json:"properties"` } +// NewLocation instantiates a new Location object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocation(properties LocationProperties) *Location { + this := Location{} + this.Properties = &properties + + return &this +} + +// NewLocationWithDefaults instantiates a new Location object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationWithDefaults() *Location { + this := Location{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Location) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Location) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Location) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Location) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Location) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Location) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Location) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Location) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Location) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Location) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Location) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Location) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Location) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Location) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Location) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *Location) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Location) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Location) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Location) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for LocationProperties will be returned func (o *Location) GetProperties() *LocationProperties { @@ -180,6 +206,7 @@ func (o *Location) GetProperties() *LocationProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Location) GetPropertiesOk() (*LocationProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Location) SetProperties(v LocationProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Location) HasProperties() bool { return false } - func (o Location) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location_properties.go index 8401e5d67a89..15326ccabd3c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_location_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,15 +16,33 @@ import ( // LocationProperties struct for LocationProperties type LocationProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` // List of features supported by the location Features *[]string `json:"features,omitempty"` // List of image aliases available for the location ImageAliases *[]string `json:"imageAliases,omitempty"` + // Array of features and CPU families available in a location + CpuArchitecture *[]CpuArchitectureProperties `json:"cpuArchitecture,omitempty"` } +// NewLocationProperties instantiates a new LocationProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocationProperties() *LocationProperties { + this := LocationProperties{} + return &this +} + +// NewLocationPropertiesWithDefaults instantiates a new LocationProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationPropertiesWithDefaults() *LocationProperties { + this := LocationProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +52,7 @@ func (o *LocationProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -43,12 +62,15 @@ func (o *LocationProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *LocationProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -60,8 +82,6 @@ func (o *LocationProperties) HasName() bool { return false } - - // GetFeatures returns the Features field value // If the value is explicit nil, the zero value for []string will be returned func (o *LocationProperties) GetFeatures() *[]string { @@ -70,6 +90,7 @@ func (o *LocationProperties) GetFeatures() *[]string { } return o.Features + } // GetFeaturesOk returns a tuple with the Features field value @@ -79,12 +100,15 @@ func (o *LocationProperties) GetFeaturesOk() (*[]string, bool) { if o == nil { return nil, false } + return o.Features, true } // SetFeatures sets field value func (o *LocationProperties) SetFeatures(v []string) { + o.Features = &v + } // HasFeatures returns a boolean if a field has been set. @@ -96,8 +120,6 @@ func (o *LocationProperties) HasFeatures() bool { return false } - - // GetImageAliases returns the ImageAliases field value // If the value is explicit nil, the zero value for []string will be returned func (o *LocationProperties) GetImageAliases() *[]string { @@ -106,6 +128,7 @@ func (o *LocationProperties) GetImageAliases() *[]string { } return o.ImageAliases + } // GetImageAliasesOk returns a tuple with the ImageAliases field value @@ -115,12 +138,15 @@ func (o *LocationProperties) GetImageAliasesOk() (*[]string, bool) { if o == nil { return nil, false } + return o.ImageAliases, true } // SetImageAliases sets field value func (o *LocationProperties) SetImageAliases(v []string) { + o.ImageAliases = &v + } // HasImageAliases returns a boolean if a field has been set. @@ -132,24 +158,58 @@ func (o *LocationProperties) HasImageAliases() bool { return false } +// GetCpuArchitecture returns the CpuArchitecture field value +// If the value is explicit nil, the zero value for []CpuArchitectureProperties will be returned +func (o *LocationProperties) GetCpuArchitecture() *[]CpuArchitectureProperties { + if o == nil { + return nil + } + + return o.CpuArchitecture + +} + +// GetCpuArchitectureOk returns a tuple with the CpuArchitecture 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 *LocationProperties) GetCpuArchitectureOk() (*[]CpuArchitectureProperties, bool) { + if o == nil { + return nil, false + } + + return o.CpuArchitecture, true +} + +// SetCpuArchitecture sets field value +func (o *LocationProperties) SetCpuArchitecture(v []CpuArchitectureProperties) { + + o.CpuArchitecture = &v + +} + +// HasCpuArchitecture returns a boolean if a field has been set. +func (o *LocationProperties) HasCpuArchitecture() bool { + if o != nil && o.CpuArchitecture != nil { + return true + } + + return false +} func (o LocationProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Features != nil { toSerialize["features"] = o.Features } - - if o.ImageAliases != nil { toSerialize["imageAliases"] = o.ImageAliases } - + if o.CpuArchitecture != nil { + toSerialize["cpuArchitecture"] = o.CpuArchitecture + } return json.Marshal(toSerialize) } @@ -188,5 +248,3 @@ func (v *NullableLocationProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_locations.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_locations.go index f3e7abaf6902..ba9354acec7b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_locations.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_locations.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // Locations struct for Locations type Locations struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Location `json:"items,omitempty"` } +// NewLocations instantiates a new Locations object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocations() *Locations { + this := Locations{} + return &this +} + +// NewLocationsWithDefaults instantiates a new Locations object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationsWithDefaults() *Locations { + this := Locations{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Locations) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Locations) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Locations) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Locations) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Locations) GetType() *Type { @@ -72,6 +90,7 @@ func (o *Locations) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Locations) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Locations) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Locations) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Locations) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Locations) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Locations) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Locations) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Locations) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Location will be returned func (o *Locations) GetItems() *[]Location { @@ -144,6 +166,7 @@ func (o *Locations) GetItems() *[]Location { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Locations) GetItemsOk() (*[]Location, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Locations) SetItems(v []Location) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Locations) HasItems() bool { return false } - func (o Locations) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableLocations) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway.go new file mode 100644 index 000000000000..70f8e92a9bda --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway.go @@ -0,0 +1,335 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGateway struct for NatGateway +type NatGateway struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *NatGatewayProperties `json:"properties"` + Entities *NatGatewayEntities `json:"entities,omitempty"` +} + +// NewNatGateway instantiates a new NatGateway object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGateway(properties NatGatewayProperties) *NatGateway { + this := NatGateway{} + + this.Properties = &properties + + return &this +} + +// NewNatGatewayWithDefaults instantiates a new NatGateway object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayWithDefaults() *NatGateway { + this := NatGateway{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGateway) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateway) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGateway) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGateway) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGateway) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateway) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGateway) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGateway) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGateway) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateway) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGateway) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGateway) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *NatGateway) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateway) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *NatGateway) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *NatGateway) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NatGatewayProperties will be returned +func (o *NatGateway) GetProperties() *NatGatewayProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateway) GetPropertiesOk() (*NatGatewayProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NatGateway) SetProperties(v NatGatewayProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NatGateway) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// GetEntities returns the Entities field value +// If the value is explicit nil, the zero value for NatGatewayEntities will be returned +func (o *NatGateway) GetEntities() *NatGatewayEntities { + if o == nil { + return nil + } + + return o.Entities + +} + +// GetEntitiesOk returns a tuple with the Entities 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 *NatGateway) GetEntitiesOk() (*NatGatewayEntities, bool) { + if o == nil { + return nil, false + } + + return o.Entities, true +} + +// SetEntities sets field value +func (o *NatGateway) SetEntities(v NatGatewayEntities) { + + o.Entities = &v + +} + +// HasEntities returns a boolean if a field has been set. +func (o *NatGateway) HasEntities() bool { + if o != nil && o.Entities != nil { + return true + } + + return false +} + +func (o NatGateway) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.Entities != nil { + toSerialize["entities"] = o.Entities + } + return json.Marshal(toSerialize) +} + +type NullableNatGateway struct { + value *NatGateway + isSet bool +} + +func (v NullableNatGateway) Get() *NatGateway { + return v.value +} + +func (v *NullableNatGateway) Set(val *NatGateway) { + v.value = val + v.isSet = true +} + +func (v NullableNatGateway) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGateway) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGateway(val *NatGateway) *NullableNatGateway { + return &NullableNatGateway{value: val, isSet: true} +} + +func (v NullableNatGateway) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGateway) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_entities.go new file mode 100644 index 000000000000..d51cb9543ce1 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_entities.go @@ -0,0 +1,162 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayEntities struct for NatGatewayEntities +type NatGatewayEntities struct { + Rules *NatGatewayRules `json:"rules,omitempty"` + Flowlogs *FlowLogs `json:"flowlogs,omitempty"` +} + +// NewNatGatewayEntities instantiates a new NatGatewayEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayEntities() *NatGatewayEntities { + this := NatGatewayEntities{} + + return &this +} + +// NewNatGatewayEntitiesWithDefaults instantiates a new NatGatewayEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayEntitiesWithDefaults() *NatGatewayEntities { + this := NatGatewayEntities{} + return &this +} + +// GetRules returns the Rules field value +// If the value is explicit nil, the zero value for NatGatewayRules will be returned +func (o *NatGatewayEntities) GetRules() *NatGatewayRules { + if o == nil { + return nil + } + + return o.Rules + +} + +// GetRulesOk returns a tuple with the Rules 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 *NatGatewayEntities) GetRulesOk() (*NatGatewayRules, bool) { + if o == nil { + return nil, false + } + + return o.Rules, true +} + +// SetRules sets field value +func (o *NatGatewayEntities) SetRules(v NatGatewayRules) { + + o.Rules = &v + +} + +// HasRules returns a boolean if a field has been set. +func (o *NatGatewayEntities) HasRules() bool { + if o != nil && o.Rules != nil { + return true + } + + return false +} + +// GetFlowlogs returns the Flowlogs field value +// If the value is explicit nil, the zero value for FlowLogs will be returned +func (o *NatGatewayEntities) GetFlowlogs() *FlowLogs { + if o == nil { + return nil + } + + return o.Flowlogs + +} + +// GetFlowlogsOk returns a tuple with the Flowlogs 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 *NatGatewayEntities) GetFlowlogsOk() (*FlowLogs, bool) { + if o == nil { + return nil, false + } + + return o.Flowlogs, true +} + +// SetFlowlogs sets field value +func (o *NatGatewayEntities) SetFlowlogs(v FlowLogs) { + + o.Flowlogs = &v + +} + +// HasFlowlogs returns a boolean if a field has been set. +func (o *NatGatewayEntities) HasFlowlogs() bool { + if o != nil && o.Flowlogs != nil { + return true + } + + return false +} + +func (o NatGatewayEntities) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Rules != nil { + toSerialize["rules"] = o.Rules + } + if o.Flowlogs != nil { + toSerialize["flowlogs"] = o.Flowlogs + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayEntities struct { + value *NatGatewayEntities + isSet bool +} + +func (v NullableNatGatewayEntities) Get() *NatGatewayEntities { + return v.value +} + +func (v *NullableNatGatewayEntities) Set(val *NatGatewayEntities) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayEntities) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayEntities) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayEntities(val *NatGatewayEntities) *NullableNatGatewayEntities { + return &NullableNatGatewayEntities{value: val, isSet: true} +} + +func (v NullableNatGatewayEntities) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayEntities) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_lan_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_lan_properties.go new file mode 100644 index 000000000000..007a57d69036 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_lan_properties.go @@ -0,0 +1,166 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayLanProperties struct for NatGatewayLanProperties +type NatGatewayLanProperties struct { + // Id for the LAN connected to the NAT Gateway + Id *int32 `json:"id"` + // Collection of gateway IP addresses of the NAT Gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN + GatewayIps *[]string `json:"gatewayIps,omitempty"` +} + +// NewNatGatewayLanProperties instantiates a new NatGatewayLanProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayLanProperties(id int32) *NatGatewayLanProperties { + this := NatGatewayLanProperties{} + + this.Id = &id + + return &this +} + +// NewNatGatewayLanPropertiesWithDefaults instantiates a new NatGatewayLanProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayLanPropertiesWithDefaults() *NatGatewayLanProperties { + this := NatGatewayLanProperties{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NatGatewayLanProperties) GetId() *int32 { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayLanProperties) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGatewayLanProperties) SetId(v int32) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGatewayLanProperties) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetGatewayIps returns the GatewayIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *NatGatewayLanProperties) GetGatewayIps() *[]string { + if o == nil { + return nil + } + + return o.GatewayIps + +} + +// GetGatewayIpsOk returns a tuple with the GatewayIps 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 *NatGatewayLanProperties) GetGatewayIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.GatewayIps, true +} + +// SetGatewayIps sets field value +func (o *NatGatewayLanProperties) SetGatewayIps(v []string) { + + o.GatewayIps = &v + +} + +// HasGatewayIps returns a boolean if a field has been set. +func (o *NatGatewayLanProperties) HasGatewayIps() bool { + if o != nil && o.GatewayIps != nil { + return true + } + + return false +} + +func (o NatGatewayLanProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.GatewayIps != nil { + toSerialize["gatewayIps"] = o.GatewayIps + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayLanProperties struct { + value *NatGatewayLanProperties + isSet bool +} + +func (v NullableNatGatewayLanProperties) Get() *NatGatewayLanProperties { + return v.value +} + +func (v *NullableNatGatewayLanProperties) Set(val *NatGatewayLanProperties) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayLanProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayLanProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayLanProperties(val *NatGatewayLanProperties) *NullableNatGatewayLanProperties { + return &NullableNatGatewayLanProperties{value: val, isSet: true} +} + +func (v NullableNatGatewayLanProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayLanProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_properties.go new file mode 100644 index 000000000000..6eea997ef315 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_properties.go @@ -0,0 +1,210 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayProperties struct for NatGatewayProperties +type NatGatewayProperties struct { + // Name of the NAT Gateway. + Name *string `json:"name"` + // Collection of public IP addresses of the NAT Gateway. Should be customer reserved IP addresses in that location. + PublicIps *[]string `json:"publicIps"` + // Collection of LANs connected to the NAT Gateway. IPs must contain a valid subnet mask. If no IP is provided, the system will generate an IP with /24 subnet. + Lans *[]NatGatewayLanProperties `json:"lans,omitempty"` +} + +// NewNatGatewayProperties instantiates a new NatGatewayProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayProperties(name string, publicIps []string) *NatGatewayProperties { + this := NatGatewayProperties{} + + this.Name = &name + this.PublicIps = &publicIps + + return &this +} + +// NewNatGatewayPropertiesWithDefaults instantiates a new NatGatewayProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayPropertiesWithDefaults() *NatGatewayProperties { + this := NatGatewayProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *NatGatewayProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *NatGatewayProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetPublicIps returns the PublicIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *NatGatewayProperties) GetPublicIps() *[]string { + if o == nil { + return nil + } + + return o.PublicIps + +} + +// GetPublicIpsOk returns a tuple with the PublicIps 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 *NatGatewayProperties) GetPublicIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *NatGatewayProperties) SetPublicIps(v []string) { + + o.PublicIps = &v + +} + +// HasPublicIps returns a boolean if a field has been set. +func (o *NatGatewayProperties) HasPublicIps() bool { + if o != nil && o.PublicIps != nil { + return true + } + + return false +} + +// GetLans returns the Lans field value +// If the value is explicit nil, the zero value for []NatGatewayLanProperties will be returned +func (o *NatGatewayProperties) GetLans() *[]NatGatewayLanProperties { + if o == nil { + return nil + } + + return o.Lans + +} + +// GetLansOk returns a tuple with the Lans 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 *NatGatewayProperties) GetLansOk() (*[]NatGatewayLanProperties, bool) { + if o == nil { + return nil, false + } + + return o.Lans, true +} + +// SetLans sets field value +func (o *NatGatewayProperties) SetLans(v []NatGatewayLanProperties) { + + o.Lans = &v + +} + +// HasLans returns a boolean if a field has been set. +func (o *NatGatewayProperties) HasLans() bool { + if o != nil && o.Lans != nil { + return true + } + + return false +} + +func (o NatGatewayProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.PublicIps != nil { + toSerialize["publicIps"] = o.PublicIps + } + if o.Lans != nil { + toSerialize["lans"] = o.Lans + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayProperties struct { + value *NatGatewayProperties + isSet bool +} + +func (v NullableNatGatewayProperties) Get() *NatGatewayProperties { + return v.value +} + +func (v *NullableNatGatewayProperties) Set(val *NatGatewayProperties) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayProperties(val *NatGatewayProperties) *NullableNatGatewayProperties { + return &NullableNatGatewayProperties{value: val, isSet: true} +} + +func (v NullableNatGatewayProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_put.go new file mode 100644 index 000000000000..cf9a8a0486ff --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_put.go @@ -0,0 +1,251 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayPut struct for NatGatewayPut +type NatGatewayPut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *NatGatewayProperties `json:"properties"` +} + +// NewNatGatewayPut instantiates a new NatGatewayPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayPut(properties NatGatewayProperties) *NatGatewayPut { + this := NatGatewayPut{} + + this.Properties = &properties + + return &this +} + +// NewNatGatewayPutWithDefaults instantiates a new NatGatewayPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayPutWithDefaults() *NatGatewayPut { + this := NatGatewayPut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayPut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayPut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGatewayPut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGatewayPut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGatewayPut) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayPut) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGatewayPut) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGatewayPut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayPut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayPut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGatewayPut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGatewayPut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NatGatewayProperties will be returned +func (o *NatGatewayPut) GetProperties() *NatGatewayProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayPut) GetPropertiesOk() (*NatGatewayProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NatGatewayPut) SetProperties(v NatGatewayProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NatGatewayPut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NatGatewayPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayPut struct { + value *NatGatewayPut + isSet bool +} + +func (v NullableNatGatewayPut) Get() *NatGatewayPut { + return v.value +} + +func (v *NullableNatGatewayPut) Set(val *NatGatewayPut) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayPut) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayPut(val *NatGatewayPut) *NullableNatGatewayPut { + return &NullableNatGatewayPut{value: val, isSet: true} +} + +func (v NullableNatGatewayPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule.go new file mode 100644 index 000000000000..42d20aac8918 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule.go @@ -0,0 +1,293 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayRule struct for NatGatewayRule +type NatGatewayRule struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *NatGatewayRuleProperties `json:"properties"` +} + +// NewNatGatewayRule instantiates a new NatGatewayRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayRule(properties NatGatewayRuleProperties) *NatGatewayRule { + this := NatGatewayRule{} + + this.Properties = &properties + + return &this +} + +// NewNatGatewayRuleWithDefaults instantiates a new NatGatewayRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayRuleWithDefaults() *NatGatewayRule { + this := NatGatewayRule{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRule) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGatewayRule) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGatewayRule) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGatewayRule) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRule) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGatewayRule) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGatewayRule) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRule) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRule) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGatewayRule) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGatewayRule) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *NatGatewayRule) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRule) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *NatGatewayRule) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *NatGatewayRule) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NatGatewayRuleProperties will be returned +func (o *NatGatewayRule) GetProperties() *NatGatewayRuleProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRule) GetPropertiesOk() (*NatGatewayRuleProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NatGatewayRule) SetProperties(v NatGatewayRuleProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NatGatewayRule) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NatGatewayRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayRule struct { + value *NatGatewayRule + isSet bool +} + +func (v NullableNatGatewayRule) Get() *NatGatewayRule { + return v.value +} + +func (v *NullableNatGatewayRule) Set(val *NatGatewayRule) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRule) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRule(val *NatGatewayRule) *NullableNatGatewayRule { + return &NullableNatGatewayRule{value: val, isSet: true} +} + +func (v NullableNatGatewayRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_properties.go new file mode 100644 index 000000000000..8b3da441e6c3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_properties.go @@ -0,0 +1,382 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayRuleProperties struct for NatGatewayRuleProperties +type NatGatewayRuleProperties struct { + // The name of the NAT Gateway rule. + Name *string `json:"name"` + // Type of the NAT Gateway rule. + Type *NatGatewayRuleType `json:"type,omitempty"` + // Protocol of the NAT Gateway rule. Defaults to ALL. If protocol is 'ICMP' then targetPortRange start and end cannot be set. + Protocol *NatGatewayRuleProtocol `json:"protocol,omitempty"` + // Source subnet of the NAT Gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets source IP address. + SourceSubnet *string `json:"sourceSubnet"` + // Public IP address of the NAT Gateway rule. Specifies the address used for masking outgoing packets source address field. Should be one of the customer reserved IP address already configured on the NAT Gateway resource + PublicIp *string `json:"publicIp"` + // Target or destination subnet of the NAT Gateway rule. For SNAT rules it specifies which packets this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address. + TargetSubnet *string `json:"targetSubnet,omitempty"` + TargetPortRange *TargetPortRange `json:"targetPortRange,omitempty"` +} + +// NewNatGatewayRuleProperties instantiates a new NatGatewayRuleProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayRuleProperties(name string, sourceSubnet string, publicIp string) *NatGatewayRuleProperties { + this := NatGatewayRuleProperties{} + + this.Name = &name + this.SourceSubnet = &sourceSubnet + this.PublicIp = &publicIp + + return &this +} + +// NewNatGatewayRulePropertiesWithDefaults instantiates a new NatGatewayRuleProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayRulePropertiesWithDefaults() *NatGatewayRuleProperties { + this := NatGatewayRuleProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRuleProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRuleProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *NatGatewayRuleProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for NatGatewayRuleType will be returned +func (o *NatGatewayRuleProperties) GetType() *NatGatewayRuleType { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRuleProperties) GetTypeOk() (*NatGatewayRuleType, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGatewayRuleProperties) SetType(v NatGatewayRuleType) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetProtocol returns the Protocol field value +// If the value is explicit nil, the zero value for NatGatewayRuleProtocol will be returned +func (o *NatGatewayRuleProperties) GetProtocol() *NatGatewayRuleProtocol { + if o == nil { + return nil + } + + return o.Protocol + +} + +// GetProtocolOk returns a tuple with the Protocol 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 *NatGatewayRuleProperties) GetProtocolOk() (*NatGatewayRuleProtocol, bool) { + if o == nil { + return nil, false + } + + return o.Protocol, true +} + +// SetProtocol sets field value +func (o *NatGatewayRuleProperties) SetProtocol(v NatGatewayRuleProtocol) { + + o.Protocol = &v + +} + +// HasProtocol returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasProtocol() bool { + if o != nil && o.Protocol != nil { + return true + } + + return false +} + +// GetSourceSubnet returns the SourceSubnet field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRuleProperties) GetSourceSubnet() *string { + if o == nil { + return nil + } + + return o.SourceSubnet + +} + +// GetSourceSubnetOk returns a tuple with the SourceSubnet 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 *NatGatewayRuleProperties) GetSourceSubnetOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.SourceSubnet, true +} + +// SetSourceSubnet sets field value +func (o *NatGatewayRuleProperties) SetSourceSubnet(v string) { + + o.SourceSubnet = &v + +} + +// HasSourceSubnet returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasSourceSubnet() bool { + if o != nil && o.SourceSubnet != nil { + return true + } + + return false +} + +// GetPublicIp returns the PublicIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRuleProperties) GetPublicIp() *string { + if o == nil { + return nil + } + + return o.PublicIp + +} + +// GetPublicIpOk returns a tuple with the PublicIp 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 *NatGatewayRuleProperties) GetPublicIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.PublicIp, true +} + +// SetPublicIp sets field value +func (o *NatGatewayRuleProperties) SetPublicIp(v string) { + + o.PublicIp = &v + +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasPublicIp() bool { + if o != nil && o.PublicIp != nil { + return true + } + + return false +} + +// GetTargetSubnet returns the TargetSubnet field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRuleProperties) GetTargetSubnet() *string { + if o == nil { + return nil + } + + return o.TargetSubnet + +} + +// GetTargetSubnetOk returns a tuple with the TargetSubnet 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 *NatGatewayRuleProperties) GetTargetSubnetOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.TargetSubnet, true +} + +// SetTargetSubnet sets field value +func (o *NatGatewayRuleProperties) SetTargetSubnet(v string) { + + o.TargetSubnet = &v + +} + +// HasTargetSubnet returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasTargetSubnet() bool { + if o != nil && o.TargetSubnet != nil { + return true + } + + return false +} + +// GetTargetPortRange returns the TargetPortRange field value +// If the value is explicit nil, the zero value for TargetPortRange will be returned +func (o *NatGatewayRuleProperties) GetTargetPortRange() *TargetPortRange { + if o == nil { + return nil + } + + return o.TargetPortRange + +} + +// GetTargetPortRangeOk returns a tuple with the TargetPortRange 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 *NatGatewayRuleProperties) GetTargetPortRangeOk() (*TargetPortRange, bool) { + if o == nil { + return nil, false + } + + return o.TargetPortRange, true +} + +// SetTargetPortRange sets field value +func (o *NatGatewayRuleProperties) SetTargetPortRange(v TargetPortRange) { + + o.TargetPortRange = &v + +} + +// HasTargetPortRange returns a boolean if a field has been set. +func (o *NatGatewayRuleProperties) HasTargetPortRange() bool { + if o != nil && o.TargetPortRange != nil { + return true + } + + return false +} + +func (o NatGatewayRuleProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Protocol != nil { + toSerialize["protocol"] = o.Protocol + } + if o.SourceSubnet != nil { + toSerialize["sourceSubnet"] = o.SourceSubnet + } + if o.PublicIp != nil { + toSerialize["publicIp"] = o.PublicIp + } + if o.TargetSubnet != nil { + toSerialize["targetSubnet"] = o.TargetSubnet + } + if o.TargetPortRange != nil { + toSerialize["targetPortRange"] = o.TargetPortRange + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayRuleProperties struct { + value *NatGatewayRuleProperties + isSet bool +} + +func (v NullableNatGatewayRuleProperties) Get() *NatGatewayRuleProperties { + return v.value +} + +func (v *NullableNatGatewayRuleProperties) Set(val *NatGatewayRuleProperties) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRuleProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRuleProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRuleProperties(val *NatGatewayRuleProperties) *NullableNatGatewayRuleProperties { + return &NullableNatGatewayRuleProperties{value: val, isSet: true} +} + +func (v NullableNatGatewayRuleProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRuleProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_protocol.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_protocol.go new file mode 100644 index 000000000000..c0f23132644a --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_protocol.go @@ -0,0 +1,85 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "fmt" +) + +// NatGatewayRuleProtocol the model 'NatGatewayRuleProtocol' +type NatGatewayRuleProtocol string + +// List of NatGatewayRuleProtocol +const ( + TCP NatGatewayRuleProtocol = "TCP" + UDP NatGatewayRuleProtocol = "UDP" + ICMP NatGatewayRuleProtocol = "ICMP" + ALL NatGatewayRuleProtocol = "ALL" +) + +func (v *NatGatewayRuleProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NatGatewayRuleProtocol(value) + for _, existing := range []NatGatewayRuleProtocol{"TCP", "UDP", "ICMP", "ALL"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NatGatewayRuleProtocol", value) +} + +// Ptr returns reference to NatGatewayRuleProtocol value +func (v NatGatewayRuleProtocol) Ptr() *NatGatewayRuleProtocol { + return &v +} + +type NullableNatGatewayRuleProtocol struct { + value *NatGatewayRuleProtocol + isSet bool +} + +func (v NullableNatGatewayRuleProtocol) Get() *NatGatewayRuleProtocol { + return v.value +} + +func (v *NullableNatGatewayRuleProtocol) Set(val *NatGatewayRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRuleProtocol(val *NatGatewayRuleProtocol) *NullableNatGatewayRuleProtocol { + return &NullableNatGatewayRuleProtocol{value: val, isSet: true} +} + +func (v NullableNatGatewayRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_put.go new file mode 100644 index 000000000000..2f709351b0f7 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_put.go @@ -0,0 +1,251 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayRulePut struct for NatGatewayRulePut +type NatGatewayRulePut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *NatGatewayRuleProperties `json:"properties"` +} + +// NewNatGatewayRulePut instantiates a new NatGatewayRulePut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayRulePut(properties NatGatewayRuleProperties) *NatGatewayRulePut { + this := NatGatewayRulePut{} + + this.Properties = &properties + + return &this +} + +// NewNatGatewayRulePutWithDefaults instantiates a new NatGatewayRulePut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayRulePutWithDefaults() *NatGatewayRulePut { + this := NatGatewayRulePut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRulePut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRulePut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGatewayRulePut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGatewayRulePut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGatewayRulePut) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRulePut) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGatewayRulePut) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGatewayRulePut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRulePut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRulePut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGatewayRulePut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGatewayRulePut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NatGatewayRuleProperties will be returned +func (o *NatGatewayRulePut) GetProperties() *NatGatewayRuleProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRulePut) GetPropertiesOk() (*NatGatewayRuleProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NatGatewayRulePut) SetProperties(v NatGatewayRuleProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NatGatewayRulePut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NatGatewayRulePut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayRulePut struct { + value *NatGatewayRulePut + isSet bool +} + +func (v NullableNatGatewayRulePut) Get() *NatGatewayRulePut { + return v.value +} + +func (v *NullableNatGatewayRulePut) Set(val *NatGatewayRulePut) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRulePut) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRulePut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRulePut(val *NatGatewayRulePut) *NullableNatGatewayRulePut { + return &NullableNatGatewayRulePut{value: val, isSet: true} +} + +func (v NullableNatGatewayRulePut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRulePut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_type.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_type.go new file mode 100644 index 000000000000..b52a2d2497ac --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rule_type.go @@ -0,0 +1,82 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "fmt" +) + +// NatGatewayRuleType the model 'NatGatewayRuleType' +type NatGatewayRuleType string + +// List of NatGatewayRuleType +const ( + SNAT NatGatewayRuleType = "SNAT" +) + +func (v *NatGatewayRuleType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NatGatewayRuleType(value) + for _, existing := range []NatGatewayRuleType{"SNAT"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NatGatewayRuleType", value) +} + +// Ptr returns reference to NatGatewayRuleType value +func (v NatGatewayRuleType) Ptr() *NatGatewayRuleType { + return &v +} + +type NullableNatGatewayRuleType struct { + value *NatGatewayRuleType + isSet bool +} + +func (v NullableNatGatewayRuleType) Get() *NatGatewayRuleType { + return v.value +} + +func (v *NullableNatGatewayRuleType) Set(val *NatGatewayRuleType) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRuleType) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRuleType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRuleType(val *NatGatewayRuleType) *NullableNatGatewayRuleType { + return &NullableNatGatewayRuleType{value: val, isSet: true} +} + +func (v NullableNatGatewayRuleType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRuleType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rules.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rules.go new file mode 100644 index 000000000000..780bef1f9d85 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateway_rules.go @@ -0,0 +1,250 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGatewayRules struct for NatGatewayRules +type NatGatewayRules struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]NatGatewayRule `json:"items,omitempty"` +} + +// NewNatGatewayRules instantiates a new NatGatewayRules object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGatewayRules() *NatGatewayRules { + this := NatGatewayRules{} + + return &this +} + +// NewNatGatewayRulesWithDefaults instantiates a new NatGatewayRules object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewayRulesWithDefaults() *NatGatewayRules { + this := NatGatewayRules{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRules) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRules) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGatewayRules) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGatewayRules) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGatewayRules) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRules) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGatewayRules) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGatewayRules) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGatewayRules) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGatewayRules) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGatewayRules) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGatewayRules) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []NatGatewayRule will be returned +func (o *NatGatewayRules) GetItems() *[]NatGatewayRule { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *NatGatewayRules) GetItemsOk() (*[]NatGatewayRule, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *NatGatewayRules) SetItems(v []NatGatewayRule) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *NatGatewayRules) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o NatGatewayRules) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + return json.Marshal(toSerialize) +} + +type NullableNatGatewayRules struct { + value *NatGatewayRules + isSet bool +} + +func (v NullableNatGatewayRules) Get() *NatGatewayRules { + return v.value +} + +func (v *NullableNatGatewayRules) Set(val *NatGatewayRules) { + v.value = val + v.isSet = true +} + +func (v NullableNatGatewayRules) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGatewayRules) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGatewayRules(val *NatGatewayRules) *NullableNatGatewayRules { + return &NullableNatGatewayRules{value: val, isSet: true} +} + +func (v NullableNatGatewayRules) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGatewayRules) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateways.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateways.go new file mode 100644 index 000000000000..ea80671fe875 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nat_gateways.go @@ -0,0 +1,378 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NatGateways struct for NatGateways +type NatGateways struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]NatGateway `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewNatGateways instantiates a new NatGateways object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNatGateways() *NatGateways { + this := NatGateways{} + + return &this +} + +// NewNatGatewaysWithDefaults instantiates a new NatGateways object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNatGatewaysWithDefaults() *NatGateways { + this := NatGateways{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGateways) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NatGateways) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NatGateways) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NatGateways) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NatGateways) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NatGateways) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NatGateways) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NatGateways) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NatGateways) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []NatGateway will be returned +func (o *NatGateways) GetItems() *[]NatGateway { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *NatGateways) GetItemsOk() (*[]NatGateway, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *NatGateways) SetItems(v []NatGateway) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *NatGateways) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NatGateways) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *NatGateways) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *NatGateways) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NatGateways) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *NatGateways) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *NatGateways) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *NatGateways) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NatGateways) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *NatGateways) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *NatGateways) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o NatGateways) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableNatGateways struct { + value *NatGateways + isSet bool +} + +func (v NullableNatGateways) Get() *NatGateways { + return v.value +} + +func (v *NullableNatGateways) Set(val *NatGateways) { + v.value = val + v.isSet = true +} + +func (v NullableNatGateways) IsSet() bool { + return v.isSet +} + +func (v *NullableNatGateways) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNatGateways(val *NatGateways) *NullableNatGateways { + return &NullableNatGateways{value: val, isSet: true} +} + +func (v NullableNatGateways) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNatGateways) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer.go new file mode 100644 index 000000000000..265e075faa27 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer.go @@ -0,0 +1,335 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancer struct for NetworkLoadBalancer +type NetworkLoadBalancer struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *NetworkLoadBalancerProperties `json:"properties"` + Entities *NetworkLoadBalancerEntities `json:"entities,omitempty"` +} + +// NewNetworkLoadBalancer instantiates a new NetworkLoadBalancer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancer(properties NetworkLoadBalancerProperties) *NetworkLoadBalancer { + this := NetworkLoadBalancer{} + + this.Properties = &properties + + return &this +} + +// NewNetworkLoadBalancerWithDefaults instantiates a new NetworkLoadBalancer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerWithDefaults() *NetworkLoadBalancer { + this := NetworkLoadBalancer{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancer) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancer) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancer) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancer) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancer) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancer) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancer) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancer) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancer) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *NetworkLoadBalancer) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancer) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *NetworkLoadBalancer) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerProperties will be returned +func (o *NetworkLoadBalancer) GetProperties() *NetworkLoadBalancerProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancer) GetPropertiesOk() (*NetworkLoadBalancerProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NetworkLoadBalancer) SetProperties(v NetworkLoadBalancerProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// GetEntities returns the Entities field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerEntities will be returned +func (o *NetworkLoadBalancer) GetEntities() *NetworkLoadBalancerEntities { + if o == nil { + return nil + } + + return o.Entities + +} + +// GetEntitiesOk returns a tuple with the Entities 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 *NetworkLoadBalancer) GetEntitiesOk() (*NetworkLoadBalancerEntities, bool) { + if o == nil { + return nil, false + } + + return o.Entities, true +} + +// SetEntities sets field value +func (o *NetworkLoadBalancer) SetEntities(v NetworkLoadBalancerEntities) { + + o.Entities = &v + +} + +// HasEntities returns a boolean if a field has been set. +func (o *NetworkLoadBalancer) HasEntities() bool { + if o != nil && o.Entities != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancer) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.Entities != nil { + toSerialize["entities"] = o.Entities + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancer struct { + value *NetworkLoadBalancer + isSet bool +} + +func (v NullableNetworkLoadBalancer) Get() *NetworkLoadBalancer { + return v.value +} + +func (v *NullableNetworkLoadBalancer) Set(val *NetworkLoadBalancer) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancer) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancer(val *NetworkLoadBalancer) *NullableNetworkLoadBalancer { + return &NullableNetworkLoadBalancer{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_entities.go new file mode 100644 index 000000000000..85dd3bbd6bed --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_entities.go @@ -0,0 +1,162 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerEntities struct for NetworkLoadBalancerEntities +type NetworkLoadBalancerEntities struct { + Flowlogs *FlowLogs `json:"flowlogs,omitempty"` + Forwardingrules *NetworkLoadBalancerForwardingRules `json:"forwardingrules,omitempty"` +} + +// NewNetworkLoadBalancerEntities instantiates a new NetworkLoadBalancerEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerEntities() *NetworkLoadBalancerEntities { + this := NetworkLoadBalancerEntities{} + + return &this +} + +// NewNetworkLoadBalancerEntitiesWithDefaults instantiates a new NetworkLoadBalancerEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerEntitiesWithDefaults() *NetworkLoadBalancerEntities { + this := NetworkLoadBalancerEntities{} + return &this +} + +// GetFlowlogs returns the Flowlogs field value +// If the value is explicit nil, the zero value for FlowLogs will be returned +func (o *NetworkLoadBalancerEntities) GetFlowlogs() *FlowLogs { + if o == nil { + return nil + } + + return o.Flowlogs + +} + +// GetFlowlogsOk returns a tuple with the Flowlogs 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 *NetworkLoadBalancerEntities) GetFlowlogsOk() (*FlowLogs, bool) { + if o == nil { + return nil, false + } + + return o.Flowlogs, true +} + +// SetFlowlogs sets field value +func (o *NetworkLoadBalancerEntities) SetFlowlogs(v FlowLogs) { + + o.Flowlogs = &v + +} + +// HasFlowlogs returns a boolean if a field has been set. +func (o *NetworkLoadBalancerEntities) HasFlowlogs() bool { + if o != nil && o.Flowlogs != nil { + return true + } + + return false +} + +// GetForwardingrules returns the Forwardingrules field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerForwardingRules will be returned +func (o *NetworkLoadBalancerEntities) GetForwardingrules() *NetworkLoadBalancerForwardingRules { + if o == nil { + return nil + } + + return o.Forwardingrules + +} + +// GetForwardingrulesOk returns a tuple with the Forwardingrules 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 *NetworkLoadBalancerEntities) GetForwardingrulesOk() (*NetworkLoadBalancerForwardingRules, bool) { + if o == nil { + return nil, false + } + + return o.Forwardingrules, true +} + +// SetForwardingrules sets field value +func (o *NetworkLoadBalancerEntities) SetForwardingrules(v NetworkLoadBalancerForwardingRules) { + + o.Forwardingrules = &v + +} + +// HasForwardingrules returns a boolean if a field has been set. +func (o *NetworkLoadBalancerEntities) HasForwardingrules() bool { + if o != nil && o.Forwardingrules != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerEntities) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Flowlogs != nil { + toSerialize["flowlogs"] = o.Flowlogs + } + if o.Forwardingrules != nil { + toSerialize["forwardingrules"] = o.Forwardingrules + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerEntities struct { + value *NetworkLoadBalancerEntities + isSet bool +} + +func (v NullableNetworkLoadBalancerEntities) Get() *NetworkLoadBalancerEntities { + return v.value +} + +func (v *NullableNetworkLoadBalancerEntities) Set(val *NetworkLoadBalancerEntities) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerEntities) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerEntities) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerEntities(val *NetworkLoadBalancerEntities) *NullableNetworkLoadBalancerEntities { + return &NullableNetworkLoadBalancerEntities{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerEntities) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerEntities) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule.go new file mode 100644 index 000000000000..8f054c8855a3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule.go @@ -0,0 +1,293 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRule struct for NetworkLoadBalancerForwardingRule +type NetworkLoadBalancerForwardingRule struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *NetworkLoadBalancerForwardingRuleProperties `json:"properties"` +} + +// NewNetworkLoadBalancerForwardingRule instantiates a new NetworkLoadBalancerForwardingRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRule(properties NetworkLoadBalancerForwardingRuleProperties) *NetworkLoadBalancerForwardingRule { + this := NetworkLoadBalancerForwardingRule{} + + this.Properties = &properties + + return &this +} + +// NewNetworkLoadBalancerForwardingRuleWithDefaults instantiates a new NetworkLoadBalancerForwardingRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRuleWithDefaults() *NetworkLoadBalancerForwardingRule { + this := NetworkLoadBalancerForwardingRule{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRule) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancerForwardingRule) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRule) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancerForwardingRule) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRule) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancerForwardingRule) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRule) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRule) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRule) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancerForwardingRule) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRule) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *NetworkLoadBalancerForwardingRule) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRule) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *NetworkLoadBalancerForwardingRule) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRule) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerForwardingRuleProperties will be returned +func (o *NetworkLoadBalancerForwardingRule) GetProperties() *NetworkLoadBalancerForwardingRuleProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRule) GetPropertiesOk() (*NetworkLoadBalancerForwardingRuleProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NetworkLoadBalancerForwardingRule) SetProperties(v NetworkLoadBalancerForwardingRuleProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRule) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRule struct { + value *NetworkLoadBalancerForwardingRule + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRule) Get() *NetworkLoadBalancerForwardingRule { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRule) Set(val *NetworkLoadBalancerForwardingRule) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRule) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRule(val *NetworkLoadBalancerForwardingRule) *NullableNetworkLoadBalancerForwardingRule { + return &NullableNetworkLoadBalancerForwardingRule{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_health_check.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_health_check.go new file mode 100644 index 000000000000..3fa9df4f4b42 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_health_check.go @@ -0,0 +1,250 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRuleHealthCheck struct for NetworkLoadBalancerForwardingRuleHealthCheck +type NetworkLoadBalancerForwardingRuleHealthCheck struct { + // The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds). + ClientTimeout *int32 `json:"clientTimeout,omitempty"` + // The maximum time in milliseconds to wait for a connection attempt to a target to succeed; default is 5000 (five seconds). + ConnectTimeout *int32 `json:"connectTimeout,omitempty"` + // The maximum time in milliseconds that a target can remain inactive; default is 50,000 (50 seconds). + TargetTimeout *int32 `json:"targetTimeout,omitempty"` + // The maximum number of attempts to reconnect to a target after a connection failure. Valid range is 0 to 65535 and default is three reconnection attempts. + Retries *int32 `json:"retries,omitempty"` +} + +// NewNetworkLoadBalancerForwardingRuleHealthCheck instantiates a new NetworkLoadBalancerForwardingRuleHealthCheck object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRuleHealthCheck() *NetworkLoadBalancerForwardingRuleHealthCheck { + this := NetworkLoadBalancerForwardingRuleHealthCheck{} + + return &this +} + +// NewNetworkLoadBalancerForwardingRuleHealthCheckWithDefaults instantiates a new NetworkLoadBalancerForwardingRuleHealthCheck object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRuleHealthCheckWithDefaults() *NetworkLoadBalancerForwardingRuleHealthCheck { + this := NetworkLoadBalancerForwardingRuleHealthCheck{} + return &this +} + +// GetClientTimeout returns the ClientTimeout field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) GetClientTimeout() *int32 { + if o == nil { + return nil + } + + return o.ClientTimeout + +} + +// GetClientTimeoutOk returns a tuple with the ClientTimeout 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 *NetworkLoadBalancerForwardingRuleHealthCheck) GetClientTimeoutOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.ClientTimeout, true +} + +// SetClientTimeout sets field value +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) SetClientTimeout(v int32) { + + o.ClientTimeout = &v + +} + +// HasClientTimeout returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) HasClientTimeout() bool { + if o != nil && o.ClientTimeout != nil { + return true + } + + return false +} + +// GetConnectTimeout returns the ConnectTimeout field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) GetConnectTimeout() *int32 { + if o == nil { + return nil + } + + return o.ConnectTimeout + +} + +// GetConnectTimeoutOk returns a tuple with the ConnectTimeout 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 *NetworkLoadBalancerForwardingRuleHealthCheck) GetConnectTimeoutOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.ConnectTimeout, true +} + +// SetConnectTimeout sets field value +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) SetConnectTimeout(v int32) { + + o.ConnectTimeout = &v + +} + +// HasConnectTimeout returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) HasConnectTimeout() bool { + if o != nil && o.ConnectTimeout != nil { + return true + } + + return false +} + +// GetTargetTimeout returns the TargetTimeout field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) GetTargetTimeout() *int32 { + if o == nil { + return nil + } + + return o.TargetTimeout + +} + +// GetTargetTimeoutOk returns a tuple with the TargetTimeout 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 *NetworkLoadBalancerForwardingRuleHealthCheck) GetTargetTimeoutOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.TargetTimeout, true +} + +// SetTargetTimeout sets field value +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) SetTargetTimeout(v int32) { + + o.TargetTimeout = &v + +} + +// HasTargetTimeout returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) HasTargetTimeout() bool { + if o != nil && o.TargetTimeout != nil { + return true + } + + return false +} + +// GetRetries returns the Retries field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) GetRetries() *int32 { + if o == nil { + return nil + } + + return o.Retries + +} + +// GetRetriesOk returns a tuple with the Retries 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 *NetworkLoadBalancerForwardingRuleHealthCheck) GetRetriesOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Retries, true +} + +// SetRetries sets field value +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) SetRetries(v int32) { + + o.Retries = &v + +} + +// HasRetries returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleHealthCheck) HasRetries() bool { + if o != nil && o.Retries != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRuleHealthCheck) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClientTimeout != nil { + toSerialize["clientTimeout"] = o.ClientTimeout + } + if o.ConnectTimeout != nil { + toSerialize["connectTimeout"] = o.ConnectTimeout + } + if o.TargetTimeout != nil { + toSerialize["targetTimeout"] = o.TargetTimeout + } + if o.Retries != nil { + toSerialize["retries"] = o.Retries + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRuleHealthCheck struct { + value *NetworkLoadBalancerForwardingRuleHealthCheck + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRuleHealthCheck) Get() *NetworkLoadBalancerForwardingRuleHealthCheck { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRuleHealthCheck) Set(val *NetworkLoadBalancerForwardingRuleHealthCheck) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRuleHealthCheck) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRuleHealthCheck) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRuleHealthCheck(val *NetworkLoadBalancerForwardingRuleHealthCheck) *NullableNetworkLoadBalancerForwardingRuleHealthCheck { + return &NullableNetworkLoadBalancerForwardingRuleHealthCheck{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRuleHealthCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRuleHealthCheck) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_properties.go new file mode 100644 index 000000000000..d8ba812ab77f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_properties.go @@ -0,0 +1,385 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRuleProperties struct for NetworkLoadBalancerForwardingRuleProperties +type NetworkLoadBalancerForwardingRuleProperties struct { + // The name of the Network Load Balancer forwarding rule. + Name *string `json:"name"` + // Balancing algorithm + Algorithm *string `json:"algorithm"` + // Balancing protocol + Protocol *string `json:"protocol"` + // Listening (inbound) IP + ListenerIp *string `json:"listenerIp"` + // Listening (inbound) port number; valid range is 1 to 65535. + ListenerPort *int32 `json:"listenerPort"` + HealthCheck *NetworkLoadBalancerForwardingRuleHealthCheck `json:"healthCheck,omitempty"` + // Array of items in the collection. + Targets *[]NetworkLoadBalancerForwardingRuleTarget `json:"targets"` +} + +// NewNetworkLoadBalancerForwardingRuleProperties instantiates a new NetworkLoadBalancerForwardingRuleProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRuleProperties(name string, algorithm string, protocol string, listenerIp string, listenerPort int32, targets []NetworkLoadBalancerForwardingRuleTarget) *NetworkLoadBalancerForwardingRuleProperties { + this := NetworkLoadBalancerForwardingRuleProperties{} + + this.Name = &name + this.Algorithm = &algorithm + this.Protocol = &protocol + this.ListenerIp = &listenerIp + this.ListenerPort = &listenerPort + this.Targets = &targets + + return &this +} + +// NewNetworkLoadBalancerForwardingRulePropertiesWithDefaults instantiates a new NetworkLoadBalancerForwardingRuleProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRulePropertiesWithDefaults() *NetworkLoadBalancerForwardingRuleProperties { + this := NetworkLoadBalancerForwardingRuleProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetAlgorithm returns the Algorithm field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetAlgorithm() *string { + if o == nil { + return nil + } + + return o.Algorithm + +} + +// GetAlgorithmOk returns a tuple with the Algorithm 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 *NetworkLoadBalancerForwardingRuleProperties) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetAlgorithm(v string) { + + o.Algorithm = &v + +} + +// HasAlgorithm returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasAlgorithm() bool { + if o != nil && o.Algorithm != nil { + return true + } + + return false +} + +// GetProtocol returns the Protocol field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetProtocol() *string { + if o == nil { + return nil + } + + return o.Protocol + +} + +// GetProtocolOk returns a tuple with the Protocol 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 *NetworkLoadBalancerForwardingRuleProperties) GetProtocolOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Protocol, true +} + +// SetProtocol sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetProtocol(v string) { + + o.Protocol = &v + +} + +// HasProtocol returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasProtocol() bool { + if o != nil && o.Protocol != nil { + return true + } + + return false +} + +// GetListenerIp returns the ListenerIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetListenerIp() *string { + if o == nil { + return nil + } + + return o.ListenerIp + +} + +// GetListenerIpOk returns a tuple with the ListenerIp 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 *NetworkLoadBalancerForwardingRuleProperties) GetListenerIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.ListenerIp, true +} + +// SetListenerIp sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetListenerIp(v string) { + + o.ListenerIp = &v + +} + +// HasListenerIp returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasListenerIp() bool { + if o != nil && o.ListenerIp != nil { + return true + } + + return false +} + +// GetListenerPort returns the ListenerPort field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetListenerPort() *int32 { + if o == nil { + return nil + } + + return o.ListenerPort + +} + +// GetListenerPortOk returns a tuple with the ListenerPort 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 *NetworkLoadBalancerForwardingRuleProperties) GetListenerPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.ListenerPort, true +} + +// SetListenerPort sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetListenerPort(v int32) { + + o.ListenerPort = &v + +} + +// HasListenerPort returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasListenerPort() bool { + if o != nil && o.ListenerPort != nil { + return true + } + + return false +} + +// GetHealthCheck returns the HealthCheck field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerForwardingRuleHealthCheck will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetHealthCheck() *NetworkLoadBalancerForwardingRuleHealthCheck { + if o == nil { + return nil + } + + return o.HealthCheck + +} + +// GetHealthCheckOk returns a tuple with the HealthCheck 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 *NetworkLoadBalancerForwardingRuleProperties) GetHealthCheckOk() (*NetworkLoadBalancerForwardingRuleHealthCheck, bool) { + if o == nil { + return nil, false + } + + return o.HealthCheck, true +} + +// SetHealthCheck sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetHealthCheck(v NetworkLoadBalancerForwardingRuleHealthCheck) { + + o.HealthCheck = &v + +} + +// HasHealthCheck returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasHealthCheck() bool { + if o != nil && o.HealthCheck != nil { + return true + } + + return false +} + +// GetTargets returns the Targets field value +// If the value is explicit nil, the zero value for []NetworkLoadBalancerForwardingRuleTarget will be returned +func (o *NetworkLoadBalancerForwardingRuleProperties) GetTargets() *[]NetworkLoadBalancerForwardingRuleTarget { + if o == nil { + return nil + } + + return o.Targets + +} + +// GetTargetsOk returns a tuple with the Targets 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 *NetworkLoadBalancerForwardingRuleProperties) GetTargetsOk() (*[]NetworkLoadBalancerForwardingRuleTarget, bool) { + if o == nil { + return nil, false + } + + return o.Targets, true +} + +// SetTargets sets field value +func (o *NetworkLoadBalancerForwardingRuleProperties) SetTargets(v []NetworkLoadBalancerForwardingRuleTarget) { + + o.Targets = &v + +} + +// HasTargets returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleProperties) HasTargets() bool { + if o != nil && o.Targets != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRuleProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Algorithm != nil { + toSerialize["algorithm"] = o.Algorithm + } + if o.Protocol != nil { + toSerialize["protocol"] = o.Protocol + } + if o.ListenerIp != nil { + toSerialize["listenerIp"] = o.ListenerIp + } + if o.ListenerPort != nil { + toSerialize["listenerPort"] = o.ListenerPort + } + if o.HealthCheck != nil { + toSerialize["healthCheck"] = o.HealthCheck + } + if o.Targets != nil { + toSerialize["targets"] = o.Targets + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRuleProperties struct { + value *NetworkLoadBalancerForwardingRuleProperties + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRuleProperties) Get() *NetworkLoadBalancerForwardingRuleProperties { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRuleProperties) Set(val *NetworkLoadBalancerForwardingRuleProperties) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRuleProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRuleProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRuleProperties(val *NetworkLoadBalancerForwardingRuleProperties) *NullableNetworkLoadBalancerForwardingRuleProperties { + return &NullableNetworkLoadBalancerForwardingRuleProperties{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRuleProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRuleProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_put.go new file mode 100644 index 000000000000..ee8f95aeae74 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_put.go @@ -0,0 +1,251 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRulePut struct for NetworkLoadBalancerForwardingRulePut +type NetworkLoadBalancerForwardingRulePut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *NetworkLoadBalancerForwardingRuleProperties `json:"properties"` +} + +// NewNetworkLoadBalancerForwardingRulePut instantiates a new NetworkLoadBalancerForwardingRulePut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRulePut(properties NetworkLoadBalancerForwardingRuleProperties) *NetworkLoadBalancerForwardingRulePut { + this := NetworkLoadBalancerForwardingRulePut{} + + this.Properties = &properties + + return &this +} + +// NewNetworkLoadBalancerForwardingRulePutWithDefaults instantiates a new NetworkLoadBalancerForwardingRulePut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRulePutWithDefaults() *NetworkLoadBalancerForwardingRulePut { + this := NetworkLoadBalancerForwardingRulePut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancerForwardingRulePut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRulePut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancerForwardingRulePut) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRulePut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancerForwardingRulePut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRulePut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerForwardingRuleProperties will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetProperties() *NetworkLoadBalancerForwardingRuleProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRulePut) GetPropertiesOk() (*NetworkLoadBalancerForwardingRuleProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NetworkLoadBalancerForwardingRulePut) SetProperties(v NetworkLoadBalancerForwardingRuleProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRulePut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRulePut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRulePut struct { + value *NetworkLoadBalancerForwardingRulePut + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRulePut) Get() *NetworkLoadBalancerForwardingRulePut { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRulePut) Set(val *NetworkLoadBalancerForwardingRulePut) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRulePut) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRulePut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRulePut(val *NetworkLoadBalancerForwardingRulePut) *NullableNetworkLoadBalancerForwardingRulePut { + return &NullableNetworkLoadBalancerForwardingRulePut{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRulePut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRulePut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target.go new file mode 100644 index 000000000000..502d5bda87b4 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target.go @@ -0,0 +1,253 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRuleTarget struct for NetworkLoadBalancerForwardingRuleTarget +type NetworkLoadBalancerForwardingRuleTarget struct { + // The IP of the balanced target VM. + Ip *string `json:"ip"` + // The port of the balanced target service; valid range is 1 to 65535. + Port *int32 `json:"port"` + // Traffic is distributed in proportion to target weight, relative to the combined weight of all targets. A target with higher weight receives a greater share of traffic. Valid range is 0 to 256 and default is 1. Targets with weight of 0 do not participate in load balancing but still accept persistent connections. It is best to assign weights in the middle of the range to leave room for later adjustments. + Weight *int32 `json:"weight"` + HealthCheck *NetworkLoadBalancerForwardingRuleTargetHealthCheck `json:"healthCheck,omitempty"` +} + +// NewNetworkLoadBalancerForwardingRuleTarget instantiates a new NetworkLoadBalancerForwardingRuleTarget object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRuleTarget(ip string, port int32, weight int32) *NetworkLoadBalancerForwardingRuleTarget { + this := NetworkLoadBalancerForwardingRuleTarget{} + + this.Ip = &ip + this.Port = &port + this.Weight = &weight + + return &this +} + +// NewNetworkLoadBalancerForwardingRuleTargetWithDefaults instantiates a new NetworkLoadBalancerForwardingRuleTarget object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRuleTargetWithDefaults() *NetworkLoadBalancerForwardingRuleTarget { + this := NetworkLoadBalancerForwardingRuleTarget{} + return &this +} + +// GetIp returns the Ip field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRuleTarget) GetIp() *string { + if o == nil { + return nil + } + + return o.Ip + +} + +// GetIpOk returns a tuple with the Ip 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 *NetworkLoadBalancerForwardingRuleTarget) GetIpOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Ip, true +} + +// SetIp sets field value +func (o *NetworkLoadBalancerForwardingRuleTarget) SetIp(v string) { + + o.Ip = &v + +} + +// HasIp returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTarget) HasIp() bool { + if o != nil && o.Ip != nil { + return true + } + + return false +} + +// GetPort returns the Port field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleTarget) GetPort() *int32 { + if o == nil { + return nil + } + + return o.Port + +} + +// GetPortOk returns a tuple with the Port 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 *NetworkLoadBalancerForwardingRuleTarget) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Port, true +} + +// SetPort sets field value +func (o *NetworkLoadBalancerForwardingRuleTarget) SetPort(v int32) { + + o.Port = &v + +} + +// HasPort returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTarget) HasPort() bool { + if o != nil && o.Port != nil { + return true + } + + return false +} + +// GetWeight returns the Weight field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleTarget) GetWeight() *int32 { + if o == nil { + return nil + } + + return o.Weight + +} + +// GetWeightOk returns a tuple with the Weight 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 *NetworkLoadBalancerForwardingRuleTarget) GetWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Weight, true +} + +// SetWeight sets field value +func (o *NetworkLoadBalancerForwardingRuleTarget) SetWeight(v int32) { + + o.Weight = &v + +} + +// HasWeight returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTarget) HasWeight() bool { + if o != nil && o.Weight != nil { + return true + } + + return false +} + +// GetHealthCheck returns the HealthCheck field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerForwardingRuleTargetHealthCheck will be returned +func (o *NetworkLoadBalancerForwardingRuleTarget) GetHealthCheck() *NetworkLoadBalancerForwardingRuleTargetHealthCheck { + if o == nil { + return nil + } + + return o.HealthCheck + +} + +// GetHealthCheckOk returns a tuple with the HealthCheck 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 *NetworkLoadBalancerForwardingRuleTarget) GetHealthCheckOk() (*NetworkLoadBalancerForwardingRuleTargetHealthCheck, bool) { + if o == nil { + return nil, false + } + + return o.HealthCheck, true +} + +// SetHealthCheck sets field value +func (o *NetworkLoadBalancerForwardingRuleTarget) SetHealthCheck(v NetworkLoadBalancerForwardingRuleTargetHealthCheck) { + + o.HealthCheck = &v + +} + +// HasHealthCheck returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTarget) HasHealthCheck() bool { + if o != nil && o.HealthCheck != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRuleTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Ip != nil { + toSerialize["ip"] = o.Ip + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + if o.Weight != nil { + toSerialize["weight"] = o.Weight + } + if o.HealthCheck != nil { + toSerialize["healthCheck"] = o.HealthCheck + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRuleTarget struct { + value *NetworkLoadBalancerForwardingRuleTarget + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRuleTarget) Get() *NetworkLoadBalancerForwardingRuleTarget { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTarget) Set(val *NetworkLoadBalancerForwardingRuleTarget) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRuleTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRuleTarget(val *NetworkLoadBalancerForwardingRuleTarget) *NullableNetworkLoadBalancerForwardingRuleTarget { + return &NullableNetworkLoadBalancerForwardingRuleTarget{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRuleTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target_health_check.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target_health_check.go new file mode 100644 index 000000000000..8fac2b6dbd0d --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rule_target_health_check.go @@ -0,0 +1,207 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRuleTargetHealthCheck struct for NetworkLoadBalancerForwardingRuleTargetHealthCheck +type NetworkLoadBalancerForwardingRuleTargetHealthCheck struct { + // Makes the target available only if it accepts periodic health check TCP connection attempts; when turned off, the target is considered always available. The health check only consists of a connection attempt to the address and port of the target. + Check *bool `json:"check,omitempty"` + // The interval in milliseconds between consecutive health checks; default is 2000. + CheckInterval *int32 `json:"checkInterval,omitempty"` + // Maintenance mode prevents the target from receiving balanced traffic. + Maintenance *bool `json:"maintenance,omitempty"` +} + +// NewNetworkLoadBalancerForwardingRuleTargetHealthCheck instantiates a new NetworkLoadBalancerForwardingRuleTargetHealthCheck object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRuleTargetHealthCheck() *NetworkLoadBalancerForwardingRuleTargetHealthCheck { + this := NetworkLoadBalancerForwardingRuleTargetHealthCheck{} + + return &this +} + +// NewNetworkLoadBalancerForwardingRuleTargetHealthCheckWithDefaults instantiates a new NetworkLoadBalancerForwardingRuleTargetHealthCheck object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRuleTargetHealthCheckWithDefaults() *NetworkLoadBalancerForwardingRuleTargetHealthCheck { + this := NetworkLoadBalancerForwardingRuleTargetHealthCheck{} + return &this +} + +// GetCheck returns the Check field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetCheck() *bool { + if o == nil { + return nil + } + + return o.Check + +} + +// GetCheckOk returns a tuple with the Check 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 *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetCheckOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Check, true +} + +// SetCheck sets field value +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) SetCheck(v bool) { + + o.Check = &v + +} + +// HasCheck returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) HasCheck() bool { + if o != nil && o.Check != nil { + return true + } + + return false +} + +// GetCheckInterval returns the CheckInterval field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetCheckInterval() *int32 { + if o == nil { + return nil + } + + return o.CheckInterval + +} + +// GetCheckIntervalOk returns a tuple with the CheckInterval 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 *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetCheckIntervalOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.CheckInterval, true +} + +// SetCheckInterval sets field value +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) SetCheckInterval(v int32) { + + o.CheckInterval = &v + +} + +// HasCheckInterval returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) HasCheckInterval() bool { + if o != nil && o.CheckInterval != nil { + return true + } + + return false +} + +// GetMaintenance returns the Maintenance field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetMaintenance() *bool { + if o == nil { + return nil + } + + return o.Maintenance + +} + +// GetMaintenanceOk returns a tuple with the Maintenance 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 *NetworkLoadBalancerForwardingRuleTargetHealthCheck) GetMaintenanceOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Maintenance, true +} + +// SetMaintenance sets field value +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) SetMaintenance(v bool) { + + o.Maintenance = &v + +} + +// HasMaintenance returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRuleTargetHealthCheck) HasMaintenance() bool { + if o != nil && o.Maintenance != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRuleTargetHealthCheck) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Check != nil { + toSerialize["check"] = o.Check + } + if o.CheckInterval != nil { + toSerialize["checkInterval"] = o.CheckInterval + } + if o.Maintenance != nil { + toSerialize["maintenance"] = o.Maintenance + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck struct { + value *NetworkLoadBalancerForwardingRuleTargetHealthCheck + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) Get() *NetworkLoadBalancerForwardingRuleTargetHealthCheck { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) Set(val *NetworkLoadBalancerForwardingRuleTargetHealthCheck) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRuleTargetHealthCheck(val *NetworkLoadBalancerForwardingRuleTargetHealthCheck) *NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck { + return &NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRuleTargetHealthCheck) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rules.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rules.go new file mode 100644 index 000000000000..a23c77408257 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_forwarding_rules.go @@ -0,0 +1,378 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerForwardingRules struct for NetworkLoadBalancerForwardingRules +type NetworkLoadBalancerForwardingRules struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]NetworkLoadBalancerForwardingRule `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewNetworkLoadBalancerForwardingRules instantiates a new NetworkLoadBalancerForwardingRules object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerForwardingRules() *NetworkLoadBalancerForwardingRules { + this := NetworkLoadBalancerForwardingRules{} + + return &this +} + +// NewNetworkLoadBalancerForwardingRulesWithDefaults instantiates a new NetworkLoadBalancerForwardingRules object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerForwardingRulesWithDefaults() *NetworkLoadBalancerForwardingRules { + this := NetworkLoadBalancerForwardingRules{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRules) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancerForwardingRules) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancerForwardingRules) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancerForwardingRules) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerForwardingRules) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancerForwardingRules) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []NetworkLoadBalancerForwardingRule will be returned +func (o *NetworkLoadBalancerForwardingRules) GetItems() *[]NetworkLoadBalancerForwardingRule { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *NetworkLoadBalancerForwardingRules) GetItemsOk() (*[]NetworkLoadBalancerForwardingRule, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkLoadBalancerForwardingRules) SetItems(v []NetworkLoadBalancerForwardingRule) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NetworkLoadBalancerForwardingRules) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *NetworkLoadBalancerForwardingRules) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NetworkLoadBalancerForwardingRules) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *NetworkLoadBalancerForwardingRules) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *NetworkLoadBalancerForwardingRules) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerForwardingRules) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *NetworkLoadBalancerForwardingRules) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *NetworkLoadBalancerForwardingRules) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerForwardingRules) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerForwardingRules struct { + value *NetworkLoadBalancerForwardingRules + isSet bool +} + +func (v NullableNetworkLoadBalancerForwardingRules) Get() *NetworkLoadBalancerForwardingRules { + return v.value +} + +func (v *NullableNetworkLoadBalancerForwardingRules) Set(val *NetworkLoadBalancerForwardingRules) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerForwardingRules) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerForwardingRules) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerForwardingRules(val *NetworkLoadBalancerForwardingRules) *NullableNetworkLoadBalancerForwardingRules { + return &NullableNetworkLoadBalancerForwardingRules{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerForwardingRules) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerForwardingRules) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_properties.go new file mode 100644 index 000000000000..94170d456e05 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_properties.go @@ -0,0 +1,297 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerProperties struct for NetworkLoadBalancerProperties +type NetworkLoadBalancerProperties struct { + // The name of the Network Load Balancer. + Name *string `json:"name"` + // ID of the listening LAN (inbound). + ListenerLan *int32 `json:"listenerLan"` + // Collection of the Network Load Balancer IP addresses. (Inbound and outbound) IPs of the listenerLan must be customer-reserved IPs for public Load Balancers, and private IPs for private Load Balancers. + Ips *[]string `json:"ips,omitempty"` + // ID of the balanced private target LAN (outbound). + TargetLan *int32 `json:"targetLan"` + // Collection of private IP addresses with subnet mask of the Network Load Balancer. IPs must contain a valid subnet mask. If no IP is provided, the system will generate an IP with /24 subnet. + LbPrivateIps *[]string `json:"lbPrivateIps,omitempty"` +} + +// NewNetworkLoadBalancerProperties instantiates a new NetworkLoadBalancerProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerProperties(name string, listenerLan int32, targetLan int32) *NetworkLoadBalancerProperties { + this := NetworkLoadBalancerProperties{} + + this.Name = &name + this.ListenerLan = &listenerLan + this.TargetLan = &targetLan + + return &this +} + +// NewNetworkLoadBalancerPropertiesWithDefaults instantiates a new NetworkLoadBalancerProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerPropertiesWithDefaults() *NetworkLoadBalancerProperties { + this := NetworkLoadBalancerProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *NetworkLoadBalancerProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *NetworkLoadBalancerProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetListenerLan returns the ListenerLan field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerProperties) GetListenerLan() *int32 { + if o == nil { + return nil + } + + return o.ListenerLan + +} + +// GetListenerLanOk returns a tuple with the ListenerLan 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 *NetworkLoadBalancerProperties) GetListenerLanOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.ListenerLan, true +} + +// SetListenerLan sets field value +func (o *NetworkLoadBalancerProperties) SetListenerLan(v int32) { + + o.ListenerLan = &v + +} + +// HasListenerLan returns a boolean if a field has been set. +func (o *NetworkLoadBalancerProperties) HasListenerLan() bool { + if o != nil && o.ListenerLan != nil { + return true + } + + return false +} + +// GetIps returns the Ips field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *NetworkLoadBalancerProperties) GetIps() *[]string { + if o == nil { + return nil + } + + return o.Ips + +} + +// GetIpsOk returns a tuple with the Ips 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 *NetworkLoadBalancerProperties) GetIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.Ips, true +} + +// SetIps sets field value +func (o *NetworkLoadBalancerProperties) SetIps(v []string) { + + o.Ips = &v + +} + +// HasIps returns a boolean if a field has been set. +func (o *NetworkLoadBalancerProperties) HasIps() bool { + if o != nil && o.Ips != nil { + return true + } + + return false +} + +// GetTargetLan returns the TargetLan field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NetworkLoadBalancerProperties) GetTargetLan() *int32 { + if o == nil { + return nil + } + + return o.TargetLan + +} + +// GetTargetLanOk returns a tuple with the TargetLan 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 *NetworkLoadBalancerProperties) GetTargetLanOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.TargetLan, true +} + +// SetTargetLan sets field value +func (o *NetworkLoadBalancerProperties) SetTargetLan(v int32) { + + o.TargetLan = &v + +} + +// HasTargetLan returns a boolean if a field has been set. +func (o *NetworkLoadBalancerProperties) HasTargetLan() bool { + if o != nil && o.TargetLan != nil { + return true + } + + return false +} + +// GetLbPrivateIps returns the LbPrivateIps field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *NetworkLoadBalancerProperties) GetLbPrivateIps() *[]string { + if o == nil { + return nil + } + + return o.LbPrivateIps + +} + +// GetLbPrivateIpsOk returns a tuple with the LbPrivateIps 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 *NetworkLoadBalancerProperties) GetLbPrivateIpsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + + return o.LbPrivateIps, true +} + +// SetLbPrivateIps sets field value +func (o *NetworkLoadBalancerProperties) SetLbPrivateIps(v []string) { + + o.LbPrivateIps = &v + +} + +// HasLbPrivateIps returns a boolean if a field has been set. +func (o *NetworkLoadBalancerProperties) HasLbPrivateIps() bool { + if o != nil && o.LbPrivateIps != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ListenerLan != nil { + toSerialize["listenerLan"] = o.ListenerLan + } + if o.Ips != nil { + toSerialize["ips"] = o.Ips + } + if o.TargetLan != nil { + toSerialize["targetLan"] = o.TargetLan + } + if o.LbPrivateIps != nil { + toSerialize["lbPrivateIps"] = o.LbPrivateIps + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerProperties struct { + value *NetworkLoadBalancerProperties + isSet bool +} + +func (v NullableNetworkLoadBalancerProperties) Get() *NetworkLoadBalancerProperties { + return v.value +} + +func (v *NullableNetworkLoadBalancerProperties) Set(val *NetworkLoadBalancerProperties) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerProperties(val *NetworkLoadBalancerProperties) *NullableNetworkLoadBalancerProperties { + return &NullableNetworkLoadBalancerProperties{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_put.go new file mode 100644 index 000000000000..05bde508cbb5 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancer_put.go @@ -0,0 +1,251 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancerPut struct for NetworkLoadBalancerPut +type NetworkLoadBalancerPut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *NetworkLoadBalancerProperties `json:"properties"` +} + +// NewNetworkLoadBalancerPut instantiates a new NetworkLoadBalancerPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancerPut(properties NetworkLoadBalancerProperties) *NetworkLoadBalancerPut { + this := NetworkLoadBalancerPut{} + + this.Properties = &properties + + return &this +} + +// NewNetworkLoadBalancerPutWithDefaults instantiates a new NetworkLoadBalancerPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancerPutWithDefaults() *NetworkLoadBalancerPut { + this := NetworkLoadBalancerPut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerPut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerPut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancerPut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancerPut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancerPut) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerPut) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancerPut) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancerPut) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancerPut) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerPut) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancerPut) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancerPut) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for NetworkLoadBalancerProperties will be returned +func (o *NetworkLoadBalancerPut) GetProperties() *NetworkLoadBalancerProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancerPut) GetPropertiesOk() (*NetworkLoadBalancerProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *NetworkLoadBalancerPut) SetProperties(v NetworkLoadBalancerProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *NetworkLoadBalancerPut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancerPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancerPut struct { + value *NetworkLoadBalancerPut + isSet bool +} + +func (v NullableNetworkLoadBalancerPut) Get() *NetworkLoadBalancerPut { + return v.value +} + +func (v *NullableNetworkLoadBalancerPut) Set(val *NetworkLoadBalancerPut) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancerPut) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancerPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancerPut(val *NetworkLoadBalancerPut) *NullableNetworkLoadBalancerPut { + return &NullableNetworkLoadBalancerPut{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancerPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancerPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancers.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancers.go new file mode 100644 index 000000000000..91bbe63e1fb3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_network_load_balancers.go @@ -0,0 +1,378 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// NetworkLoadBalancers struct for NetworkLoadBalancers +type NetworkLoadBalancers struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]NetworkLoadBalancer `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` +} + +// NewNetworkLoadBalancers instantiates a new NetworkLoadBalancers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkLoadBalancers() *NetworkLoadBalancers { + this := NetworkLoadBalancers{} + + return &this +} + +// NewNetworkLoadBalancersWithDefaults instantiates a new NetworkLoadBalancers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkLoadBalancersWithDefaults() *NetworkLoadBalancers { + this := NetworkLoadBalancers{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancers) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *NetworkLoadBalancers) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *NetworkLoadBalancers) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *NetworkLoadBalancers) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NetworkLoadBalancers) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *NetworkLoadBalancers) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []NetworkLoadBalancer will be returned +func (o *NetworkLoadBalancers) GetItems() *[]NetworkLoadBalancer { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *NetworkLoadBalancers) GetItemsOk() (*[]NetworkLoadBalancer, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkLoadBalancers) SetItems(v []NetworkLoadBalancer) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NetworkLoadBalancers) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *NetworkLoadBalancers) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *NetworkLoadBalancers) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *NetworkLoadBalancers) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *NetworkLoadBalancers) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkLoadBalancers) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *NetworkLoadBalancers) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *NetworkLoadBalancers) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +func (o NetworkLoadBalancers) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } + return json.Marshal(toSerialize) +} + +type NullableNetworkLoadBalancers struct { + value *NetworkLoadBalancers + isSet bool +} + +func (v NullableNetworkLoadBalancers) Get() *NetworkLoadBalancers { + return v.value +} + +func (v *NullableNetworkLoadBalancers) Set(val *NetworkLoadBalancers) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkLoadBalancers) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkLoadBalancers) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkLoadBalancers(val *NetworkLoadBalancers) *NullableNetworkLoadBalancers { + return &NullableNetworkLoadBalancers{value: val, isSet: true} +} + +func (v NullableNetworkLoadBalancers) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkLoadBalancers) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic.go index 47f61d043df2..9d8378c6f325 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // Nic struct for Nic type Nic struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *NicProperties `json:"properties"` - Entities *NicEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *NicProperties `json:"properties"` + Entities *NicEntities `json:"entities,omitempty"` } +// NewNic instantiates a new Nic object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNic(properties NicProperties) *Nic { + this := Nic{} + this.Properties = &properties + + return &this +} + +// NewNicWithDefaults instantiates a new Nic object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNicWithDefaults() *Nic { + this := Nic{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *Nic) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *Nic) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Nic) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *Nic) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Nic) GetType() *Type { @@ -73,6 +93,7 @@ func (o *Nic) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *Nic) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Nic) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *Nic) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Nic) GetHref() *string { @@ -109,6 +131,7 @@ func (o *Nic) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *Nic) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Nic) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *Nic) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Nic) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *Nic) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *Nic) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Nic) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *Nic) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for NicProperties will be returned func (o *Nic) GetProperties() *NicProperties { @@ -181,6 +207,7 @@ func (o *Nic) GetProperties() *NicProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *Nic) GetPropertiesOk() (*NicProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Nic) SetProperties(v NicProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *Nic) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for NicEntities will be returned func (o *Nic) GetEntities() *NicEntities { @@ -217,6 +245,7 @@ func (o *Nic) GetEntities() *NicEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *Nic) GetEntitiesOk() (*NicEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Nic) SetEntities(v NicEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *Nic) HasEntities() bool { return false } - func (o Nic) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableNic) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_entities.go index db039d0d8e89..b1a5553a7e83 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,10 +16,65 @@ import ( // NicEntities struct for NicEntities type NicEntities struct { + Flowlogs *FlowLogs `json:"flowlogs,omitempty"` Firewallrules *FirewallRules `json:"firewallrules,omitempty"` } +// NewNicEntities instantiates a new NicEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNicEntities() *NicEntities { + this := NicEntities{} + return &this +} + +// NewNicEntitiesWithDefaults instantiates a new NicEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNicEntitiesWithDefaults() *NicEntities { + this := NicEntities{} + return &this +} + +// GetFlowlogs returns the Flowlogs field value +// If the value is explicit nil, the zero value for FlowLogs will be returned +func (o *NicEntities) GetFlowlogs() *FlowLogs { + if o == nil { + return nil + } + + return o.Flowlogs + +} + +// GetFlowlogsOk returns a tuple with the Flowlogs 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 *NicEntities) GetFlowlogsOk() (*FlowLogs, bool) { + if o == nil { + return nil, false + } + + return o.Flowlogs, true +} + +// SetFlowlogs sets field value +func (o *NicEntities) SetFlowlogs(v FlowLogs) { + + o.Flowlogs = &v + +} + +// HasFlowlogs returns a boolean if a field has been set. +func (o *NicEntities) HasFlowlogs() bool { + if o != nil && o.Flowlogs != nil { + return true + } + + return false +} // GetFirewallrules returns the Firewallrules field value // If the value is explicit nil, the zero value for FirewallRules will be returned @@ -29,6 +84,7 @@ func (o *NicEntities) GetFirewallrules() *FirewallRules { } return o.Firewallrules + } // GetFirewallrulesOk returns a tuple with the Firewallrules field value @@ -38,12 +94,15 @@ func (o *NicEntities) GetFirewallrulesOk() (*FirewallRules, bool) { if o == nil { return nil, false } + return o.Firewallrules, true } // SetFirewallrules sets field value func (o *NicEntities) SetFirewallrules(v FirewallRules) { + o.Firewallrules = &v + } // HasFirewallrules returns a boolean if a field has been set. @@ -55,14 +114,14 @@ func (o *NicEntities) HasFirewallrules() bool { return false } - func (o NicEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - + if o.Flowlogs != nil { + toSerialize["flowlogs"] = o.Flowlogs + } if o.Firewallrules != nil { toSerialize["firewallrules"] = o.Firewallrules } - return json.Marshal(toSerialize) } @@ -101,5 +160,3 @@ func (v *NullableNicEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_properties.go index 53b8b6862e39..17feb8a42bb4 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,23 +16,45 @@ import ( // NicProperties struct for NicProperties type NicProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // The MAC address of the NIC + // The MAC address of the NIC. Mac *string `json:"mac,omitempty"` - // Collection of IP addresses assigned to a nic. Explicitly assigned public IPs need to come from reserved IP blocks, Passing value null or empty array will assign an IP address automatically. + // Collection of IP addresses, assigned to the NIC. Explicitly assigned public IPs need to come from reserved IP blocks. Passing value null or empty array will assign an IP address automatically. Ips *[]string `json:"ips,omitempty"` - // Indicates if the nic will reserve an IP using DHCP + // Indicates if the NIC will reserve an IP using DHCP. Dhcp *bool `json:"dhcp,omitempty"` - // The LAN ID the NIC will sit on. If the LAN ID does not exist it will be implicitly created + // The LAN ID the NIC will be on. If the LAN ID does not exist, it will be implicitly created. Lan *int32 `json:"lan"` - // Activate or deactivate the firewall. By default an active firewall without any defined rules will block all incoming network traffic except for the firewall rules that explicitly allows certain protocols, ip addresses and ports. + // Activate or deactivate the firewall. By default, an active firewall without any defined rules will block all incoming network traffic except for the firewall rules that explicitly allows certain protocols, IP addresses and ports. FirewallActive *bool `json:"firewallActive,omitempty"` - // Indicates if NAT is enabled on this NIC - Nat *bool `json:"nat,omitempty"` + // The type of firewall rules that will be allowed on the NIC. If not specified, the default INGRESS value is used. + FirewallType *string `json:"firewallType,omitempty"` + // The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created using Cloud API and no DCD changes were performed on the Datacenter. + DeviceNumber *int32 `json:"deviceNumber,omitempty"` + // The PCI slot number for the NIC. + PciSlot *int32 `json:"pciSlot,omitempty"` } +// NewNicProperties instantiates a new NicProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNicProperties(lan int32) *NicProperties { + this := NicProperties{} + this.Lan = &lan + + return &this +} + +// NewNicPropertiesWithDefaults instantiates a new NicProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNicPropertiesWithDefaults() *NicProperties { + this := NicProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -42,6 +64,7 @@ func (o *NicProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -51,12 +74,15 @@ func (o *NicProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *NicProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -68,8 +94,6 @@ func (o *NicProperties) HasName() bool { return false } - - // GetMac returns the Mac field value // If the value is explicit nil, the zero value for string will be returned func (o *NicProperties) GetMac() *string { @@ -78,6 +102,7 @@ func (o *NicProperties) GetMac() *string { } return o.Mac + } // GetMacOk returns a tuple with the Mac field value @@ -87,12 +112,15 @@ func (o *NicProperties) GetMacOk() (*string, bool) { if o == nil { return nil, false } + return o.Mac, true } // SetMac sets field value func (o *NicProperties) SetMac(v string) { + o.Mac = &v + } // HasMac returns a boolean if a field has been set. @@ -104,8 +132,6 @@ func (o *NicProperties) HasMac() bool { return false } - - // GetIps returns the Ips field value // If the value is explicit nil, the zero value for []string will be returned func (o *NicProperties) GetIps() *[]string { @@ -114,6 +140,7 @@ func (o *NicProperties) GetIps() *[]string { } return o.Ips + } // GetIpsOk returns a tuple with the Ips field value @@ -123,12 +150,15 @@ func (o *NicProperties) GetIpsOk() (*[]string, bool) { if o == nil { return nil, false } + return o.Ips, true } // SetIps sets field value func (o *NicProperties) SetIps(v []string) { + o.Ips = &v + } // HasIps returns a boolean if a field has been set. @@ -140,8 +170,6 @@ func (o *NicProperties) HasIps() bool { return false } - - // GetDhcp returns the Dhcp field value // If the value is explicit nil, the zero value for bool will be returned func (o *NicProperties) GetDhcp() *bool { @@ -150,6 +178,7 @@ func (o *NicProperties) GetDhcp() *bool { } return o.Dhcp + } // GetDhcpOk returns a tuple with the Dhcp field value @@ -159,12 +188,15 @@ func (o *NicProperties) GetDhcpOk() (*bool, bool) { if o == nil { return nil, false } + return o.Dhcp, true } // SetDhcp sets field value func (o *NicProperties) SetDhcp(v bool) { + o.Dhcp = &v + } // HasDhcp returns a boolean if a field has been set. @@ -176,8 +208,6 @@ func (o *NicProperties) HasDhcp() bool { return false } - - // GetLan returns the Lan field value // If the value is explicit nil, the zero value for int32 will be returned func (o *NicProperties) GetLan() *int32 { @@ -186,6 +216,7 @@ func (o *NicProperties) GetLan() *int32 { } return o.Lan + } // GetLanOk returns a tuple with the Lan field value @@ -195,12 +226,15 @@ func (o *NicProperties) GetLanOk() (*int32, bool) { if o == nil { return nil, false } + return o.Lan, true } // SetLan sets field value func (o *NicProperties) SetLan(v int32) { + o.Lan = &v + } // HasLan returns a boolean if a field has been set. @@ -212,8 +246,6 @@ func (o *NicProperties) HasLan() bool { return false } - - // GetFirewallActive returns the FirewallActive field value // If the value is explicit nil, the zero value for bool will be returned func (o *NicProperties) GetFirewallActive() *bool { @@ -222,6 +254,7 @@ func (o *NicProperties) GetFirewallActive() *bool { } return o.FirewallActive + } // GetFirewallActiveOk returns a tuple with the FirewallActive field value @@ -231,12 +264,15 @@ func (o *NicProperties) GetFirewallActiveOk() (*bool, bool) { if o == nil { return nil, false } + return o.FirewallActive, true } // SetFirewallActive sets field value func (o *NicProperties) SetFirewallActive(v bool) { + o.FirewallActive = &v + } // HasFirewallActive returns a boolean if a field has been set. @@ -248,80 +284,147 @@ func (o *NicProperties) HasFirewallActive() bool { return false } +// GetFirewallType returns the FirewallType field value +// If the value is explicit nil, the zero value for string will be returned +func (o *NicProperties) GetFirewallType() *string { + if o == nil { + return nil + } + + return o.FirewallType +} -// GetNat returns the Nat field value -// If the value is explicit nil, the zero value for bool will be returned -func (o *NicProperties) GetNat() *bool { +// GetFirewallTypeOk returns a tuple with the FirewallType 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 *NicProperties) GetFirewallTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.FirewallType, true +} + +// SetFirewallType sets field value +func (o *NicProperties) SetFirewallType(v string) { + + o.FirewallType = &v + +} + +// HasFirewallType returns a boolean if a field has been set. +func (o *NicProperties) HasFirewallType() bool { + if o != nil && o.FirewallType != nil { + return true + } + + return false +} + +// GetDeviceNumber returns the DeviceNumber field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NicProperties) GetDeviceNumber() *int32 { if o == nil { return nil } - return o.Nat + return o.DeviceNumber + } -// GetNatOk returns a tuple with the Nat field value +// GetDeviceNumberOk returns a tuple with the DeviceNumber 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 *NicProperties) GetNatOk() (*bool, bool) { +func (o *NicProperties) GetDeviceNumberOk() (*int32, bool) { if o == nil { return nil, false } - return o.Nat, true + + return o.DeviceNumber, true } -// SetNat sets field value -func (o *NicProperties) SetNat(v bool) { - o.Nat = &v +// SetDeviceNumber sets field value +func (o *NicProperties) SetDeviceNumber(v int32) { + + o.DeviceNumber = &v + } -// HasNat returns a boolean if a field has been set. -func (o *NicProperties) HasNat() bool { - if o != nil && o.Nat != nil { +// HasDeviceNumber returns a boolean if a field has been set. +func (o *NicProperties) HasDeviceNumber() bool { + if o != nil && o.DeviceNumber != nil { return true } return false } +// GetPciSlot returns the PciSlot field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *NicProperties) GetPciSlot() *int32 { + if o == nil { + return nil + } + + return o.PciSlot + +} + +// GetPciSlotOk returns a tuple with the PciSlot 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 *NicProperties) GetPciSlotOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.PciSlot, true +} + +// SetPciSlot sets field value +func (o *NicProperties) SetPciSlot(v int32) { + + o.PciSlot = &v + +} + +// HasPciSlot returns a boolean if a field has been set. +func (o *NicProperties) HasPciSlot() bool { + if o != nil && o.PciSlot != nil { + return true + } + + return false +} func (o NicProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Mac != nil { toSerialize["mac"] = o.Mac } - - - if o.Ips != nil { - toSerialize["ips"] = o.Ips - } - - + toSerialize["ips"] = o.Ips if o.Dhcp != nil { toSerialize["dhcp"] = o.Dhcp } - - if o.Lan != nil { toSerialize["lan"] = o.Lan } - - if o.FirewallActive != nil { toSerialize["firewallActive"] = o.FirewallActive } - - - if o.Nat != nil { - toSerialize["nat"] = o.Nat + if o.FirewallType != nil { + toSerialize["firewallType"] = o.FirewallType + } + if o.DeviceNumber != nil { + toSerialize["deviceNumber"] = o.DeviceNumber + } + if o.PciSlot != nil { + toSerialize["pciSlot"] = o.PciSlot } - return json.Marshal(toSerialize) } @@ -360,5 +463,3 @@ func (v *NullableNicProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_put.go similarity index 52% rename from cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config.go rename to cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_put.go index ac6c54ee634b..e37c81075e96 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_kubernetes_config.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nic_put.go @@ -1,59 +1,81 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" ) -// KubernetesConfig struct for KubernetesConfig -type KubernetesConfig struct { +// NicPut struct for NicPut +type NicPut struct { // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object - Type *string `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Properties *KubernetesConfigProperties `json:"properties"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Properties *NicProperties `json:"properties"` } +// NewNicPut instantiates a new NicPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNicPut(properties NicProperties) *NicPut { + this := NicPut{} + this.Properties = &properties + + return &this +} + +// NewNicPutWithDefaults instantiates a new NicPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNicPutWithDefaults() *NicPut { + this := NicPut{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesConfig) GetId() *string { +func (o *NicPut) GetId() *string { if o == nil { return nil } return o.Id + } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KubernetesConfig) GetIdOk() (*string, bool) { +func (o *NicPut) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value -func (o *KubernetesConfig) SetId(v string) { +func (o *NicPut) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. -func (o *KubernetesConfig) HasId() bool { +func (o *NicPut) HasId() bool { if o != nil && o.Id != nil { return true } @@ -61,35 +83,37 @@ func (o *KubernetesConfig) HasId() bool { return false } - - // GetType returns the Type field value -// If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesConfig) GetType() *string { +// If the value is explicit nil, the zero value for Type will be returned +func (o *NicPut) GetType() *Type { if o == nil { return nil } return o.Type + } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KubernetesConfig) GetTypeOk() (*string, bool) { +func (o *NicPut) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value -func (o *KubernetesConfig) SetType(v string) { +func (o *NicPut) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. -func (o *KubernetesConfig) HasType() bool { +func (o *NicPut) HasType() bool { if o != nil && o.Type != nil { return true } @@ -97,35 +121,37 @@ func (o *KubernetesConfig) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned -func (o *KubernetesConfig) GetHref() *string { +func (o *NicPut) GetHref() *string { if o == nil { return nil } return o.Href + } // GetHrefOk returns a tuple with the Href field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KubernetesConfig) GetHrefOk() (*string, bool) { +func (o *NicPut) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value -func (o *KubernetesConfig) SetHref(v string) { +func (o *NicPut) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. -func (o *KubernetesConfig) HasHref() bool { +func (o *NicPut) HasHref() bool { if o != nil && o.Href != nil { return true } @@ -133,35 +159,37 @@ func (o *KubernetesConfig) HasHref() bool { return false } - - // GetProperties returns the Properties field value -// If the value is explicit nil, the zero value for KubernetesConfigProperties will be returned -func (o *KubernetesConfig) GetProperties() *KubernetesConfigProperties { +// If the value is explicit nil, the zero value for NicProperties will be returned +func (o *NicPut) GetProperties() *NicProperties { if o == nil { return nil } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KubernetesConfig) GetPropertiesOk() (*KubernetesConfigProperties, bool) { +func (o *NicPut) GetPropertiesOk() (*NicProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value -func (o *KubernetesConfig) SetProperties(v KubernetesConfigProperties) { +func (o *NicPut) SetProperties(v NicProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. -func (o *KubernetesConfig) HasProperties() bool { +func (o *NicPut) HasProperties() bool { if o != nil && o.Properties != nil { return true } @@ -169,66 +197,55 @@ func (o *KubernetesConfig) HasProperties() bool { return false } - -func (o KubernetesConfig) MarshalJSON() ([]byte, error) { +func (o NicPut) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } -type NullableKubernetesConfig struct { - value *KubernetesConfig +type NullableNicPut struct { + value *NicPut isSet bool } -func (v NullableKubernetesConfig) Get() *KubernetesConfig { +func (v NullableNicPut) Get() *NicPut { return v.value } -func (v *NullableKubernetesConfig) Set(val *KubernetesConfig) { +func (v *NullableNicPut) Set(val *NicPut) { v.value = val v.isSet = true } -func (v NullableKubernetesConfig) IsSet() bool { +func (v NullableNicPut) IsSet() bool { return v.isSet } -func (v *NullableKubernetesConfig) Unset() { +func (v *NullableNicPut) Unset() { v.value = nil v.isSet = false } -func NewNullableKubernetesConfig(val *KubernetesConfig) *NullableKubernetesConfig { - return &NullableKubernetesConfig{value: val, isSet: true} +func NewNullableNicPut(val *NicPut) *NullableNicPut { + return &NullableNicPut{value: val, isSet: true} } -func (v NullableKubernetesConfig) MarshalJSON() ([]byte, error) { +func (v NullableNicPut) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableKubernetesConfig) UnmarshalJSON(src []byte) error { +func (v *NullableNicPut) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nics.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nics.go index 145d1d701c4e..80ff9957fbbc 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nics.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_nics.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Nics struct for Nics type Nics struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Nic `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewNics instantiates a new Nics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNics() *Nics { + this := Nics{} + return &this +} + +// NewNicsWithDefaults instantiates a new Nics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNicsWithDefaults() *Nics { + this := Nics{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Nics) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Nics) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Nics) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Nics) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Nics) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Nics) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Nics) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Nics) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Nics) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Nics) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Nics) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Nics) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Nics) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Nics) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Nic will be returned func (o *Nics) GetItems() *[]Nic { @@ -144,6 +171,7 @@ func (o *Nics) GetItems() *[]Nic { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Nics) GetItemsOk() (*[]Nic, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Nics) SetItems(v []Nic) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Nics) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Nics) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Nics) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Nics) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Nics) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Nics) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Nics) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Nics) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Nics) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Nics) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Nics) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Nics) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Nics) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Nics) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableNics) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_no_state_meta_data.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_no_state_meta_data.go index bade291e55d7..4d1488a1de22 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_no_state_meta_data.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_no_state_meta_data.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,23 +17,39 @@ import ( // NoStateMetaData struct for NoStateMetaData type NoStateMetaData struct { - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. Etag *string `json:"etag,omitempty"` - // The time the Resource was created - CreatedDate *time.Time `json:"createdDate,omitempty"` + // The time when the resource was created. + CreatedDate *IonosTime // The user who has created the resource. CreatedBy *string `json:"createdBy,omitempty"` - // The user id of the user who has created the resource. + // The unique ID of the user who created the resource. CreatedByUserId *string `json:"createdByUserId,omitempty"` - // The last time the resource has been modified - LastModifiedDate *time.Time `json:"lastModifiedDate,omitempty"` + // The last time the resource was modified. + LastModifiedDate *IonosTime // The user who last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // The user id of the user who has last modified the resource. + // The unique ID of the user who last modified the resource. LastModifiedByUserId *string `json:"lastModifiedByUserId,omitempty"` } +// NewNoStateMetaData instantiates a new NoStateMetaData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNoStateMetaData() *NoStateMetaData { + this := NoStateMetaData{} + return &this +} + +// NewNoStateMetaDataWithDefaults instantiates a new NoStateMetaData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNoStateMetaDataWithDefaults() *NoStateMetaData { + this := NoStateMetaData{} + return &this +} // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned @@ -43,6 +59,7 @@ func (o *NoStateMetaData) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -52,12 +69,15 @@ func (o *NoStateMetaData) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *NoStateMetaData) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -69,8 +89,6 @@ func (o *NoStateMetaData) HasEtag() bool { return false } - - // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *NoStateMetaData) GetCreatedDate() *time.Time { @@ -78,7 +96,11 @@ func (o *NoStateMetaData) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -88,12 +110,19 @@ func (o *NoStateMetaData) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *NoStateMetaData) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -105,8 +134,6 @@ func (o *NoStateMetaData) HasCreatedDate() bool { return false } - - // GetCreatedBy returns the CreatedBy field value // If the value is explicit nil, the zero value for string will be returned func (o *NoStateMetaData) GetCreatedBy() *string { @@ -115,6 +142,7 @@ func (o *NoStateMetaData) GetCreatedBy() *string { } return o.CreatedBy + } // GetCreatedByOk returns a tuple with the CreatedBy field value @@ -124,12 +152,15 @@ func (o *NoStateMetaData) GetCreatedByOk() (*string, bool) { if o == nil { return nil, false } + return o.CreatedBy, true } // SetCreatedBy sets field value func (o *NoStateMetaData) SetCreatedBy(v string) { + o.CreatedBy = &v + } // HasCreatedBy returns a boolean if a field has been set. @@ -141,8 +172,6 @@ func (o *NoStateMetaData) HasCreatedBy() bool { return false } - - // GetCreatedByUserId returns the CreatedByUserId field value // If the value is explicit nil, the zero value for string will be returned func (o *NoStateMetaData) GetCreatedByUserId() *string { @@ -151,6 +180,7 @@ func (o *NoStateMetaData) GetCreatedByUserId() *string { } return o.CreatedByUserId + } // GetCreatedByUserIdOk returns a tuple with the CreatedByUserId field value @@ -160,12 +190,15 @@ func (o *NoStateMetaData) GetCreatedByUserIdOk() (*string, bool) { if o == nil { return nil, false } + return o.CreatedByUserId, true } // SetCreatedByUserId sets field value func (o *NoStateMetaData) SetCreatedByUserId(v string) { + o.CreatedByUserId = &v + } // HasCreatedByUserId returns a boolean if a field has been set. @@ -177,8 +210,6 @@ func (o *NoStateMetaData) HasCreatedByUserId() bool { 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 *NoStateMetaData) GetLastModifiedDate() *time.Time { @@ -186,7 +217,11 @@ func (o *NoStateMetaData) GetLastModifiedDate() *time.Time { return nil } - return o.LastModifiedDate + if o.LastModifiedDate == nil { + return nil + } + return &o.LastModifiedDate.Time + } // GetLastModifiedDateOk returns a tuple with the LastModifiedDate field value @@ -196,12 +231,19 @@ func (o *NoStateMetaData) GetLastModifiedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.LastModifiedDate, true + + if o.LastModifiedDate == nil { + return nil, false + } + return &o.LastModifiedDate.Time, true + } // SetLastModifiedDate sets field value func (o *NoStateMetaData) SetLastModifiedDate(v time.Time) { - o.LastModifiedDate = &v + + o.LastModifiedDate = &IonosTime{v} + } // HasLastModifiedDate returns a boolean if a field has been set. @@ -213,8 +255,6 @@ func (o *NoStateMetaData) HasLastModifiedDate() bool { return false } - - // GetLastModifiedBy returns the LastModifiedBy field value // If the value is explicit nil, the zero value for string will be returned func (o *NoStateMetaData) GetLastModifiedBy() *string { @@ -223,6 +263,7 @@ func (o *NoStateMetaData) GetLastModifiedBy() *string { } return o.LastModifiedBy + } // GetLastModifiedByOk returns a tuple with the LastModifiedBy field value @@ -232,12 +273,15 @@ func (o *NoStateMetaData) GetLastModifiedByOk() (*string, bool) { if o == nil { return nil, false } + return o.LastModifiedBy, true } // SetLastModifiedBy sets field value func (o *NoStateMetaData) SetLastModifiedBy(v string) { + o.LastModifiedBy = &v + } // HasLastModifiedBy returns a boolean if a field has been set. @@ -249,8 +293,6 @@ func (o *NoStateMetaData) HasLastModifiedBy() bool { return false } - - // GetLastModifiedByUserId returns the LastModifiedByUserId field value // If the value is explicit nil, the zero value for string will be returned func (o *NoStateMetaData) GetLastModifiedByUserId() *string { @@ -259,6 +301,7 @@ func (o *NoStateMetaData) GetLastModifiedByUserId() *string { } return o.LastModifiedByUserId + } // GetLastModifiedByUserIdOk returns a tuple with the LastModifiedByUserId field value @@ -268,12 +311,15 @@ func (o *NoStateMetaData) GetLastModifiedByUserIdOk() (*string, bool) { if o == nil { return nil, false } + return o.LastModifiedByUserId, true } // SetLastModifiedByUserId sets field value func (o *NoStateMetaData) SetLastModifiedByUserId(v string) { + o.LastModifiedByUserId = &v + } // HasLastModifiedByUserId returns a boolean if a field has been set. @@ -285,44 +331,29 @@ func (o *NoStateMetaData) HasLastModifiedByUserId() bool { return false } - func (o NoStateMetaData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { toSerialize["createdBy"] = o.CreatedBy } - - if o.CreatedByUserId != nil { toSerialize["createdByUserId"] = o.CreatedByUserId } - - if o.LastModifiedDate != nil { toSerialize["lastModifiedDate"] = o.LastModifiedDate } - - if o.LastModifiedBy != nil { toSerialize["lastModifiedBy"] = o.LastModifiedBy } - - if o.LastModifiedByUserId != nil { toSerialize["lastModifiedByUserId"] = o.LastModifiedByUserId } - return json.Marshal(toSerialize) } @@ -361,5 +392,3 @@ func (v *NullableNoStateMetaData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_pagination_links.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_pagination_links.go new file mode 100644 index 000000000000..fa3c76dee8d4 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_pagination_links.go @@ -0,0 +1,207 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// PaginationLinks struct for PaginationLinks +type PaginationLinks struct { + // URL (with offset and limit parameters) of the previous page; only present if offset is greater than 0. + Prev *string `json:"prev,omitempty"` + // URL (with offset and limit parameters) of the current page. + Self *string `json:"self,omitempty"` + // URL (with offset and limit parameters) of the next page; only present if offset + limit is less than the total number of elements. + Next *string `json:"next,omitempty"` +} + +// NewPaginationLinks instantiates a new PaginationLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginationLinks() *PaginationLinks { + this := PaginationLinks{} + + return &this +} + +// NewPaginationLinksWithDefaults instantiates a new PaginationLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationLinksWithDefaults() *PaginationLinks { + this := 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 + } + + return o.Prev + +} + +// GetPrevOk returns a tuple with the Prev 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 *PaginationLinks) GetPrevOk() (*string, bool) { + if o == nil { + 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 { + 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 + +} + +// GetSelfOk returns a tuple with the Self 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 *PaginationLinks) GetSelfOk() (*string, bool) { + if o == nil { + 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 { + 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 + +} + +// GetNextOk returns a tuple with the Next 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 *PaginationLinks) GetNextOk() (*string, bool) { + if o == nil { + 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 { + return true + } + + return false +} + +func (o PaginationLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Prev != nil { + toSerialize["prev"] = o.Prev + } + if o.Self != nil { + toSerialize["self"] = o.Self + } + if o.Next != nil { + toSerialize["next"] = o.Next + } + return json.Marshal(toSerialize) +} + +type NullablePaginationLinks struct { + value *PaginationLinks + isSet bool +} + +func (v NullablePaginationLinks) Get() *PaginationLinks { + return v.value +} + +func (v *NullablePaginationLinks) Set(val *PaginationLinks) { + v.value = val + v.isSet = true +} + +func (v NullablePaginationLinks) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginationLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginationLinks(val *PaginationLinks) *NullablePaginationLinks { + return &NullablePaginationLinks{value: val, isSet: true} +} + +func (v NullablePaginationLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginationLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_peer.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_peer.go index 590a2bc73aae..db7c562be663 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_peer.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_peer.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,14 +16,30 @@ import ( // Peer struct for Peer type Peer struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - DatacenterId *string `json:"datacenterId,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + DatacenterId *string `json:"datacenterId,omitempty"` DatacenterName *string `json:"datacenterName,omitempty"` - Location *string `json:"location,omitempty"` + Location *string `json:"location,omitempty"` } +// NewPeer instantiates a new Peer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeer() *Peer { + this := Peer{} + return &this +} + +// NewPeerWithDefaults instantiates a new Peer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeerWithDefaults() *Peer { + this := Peer{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -33,6 +49,7 @@ func (o *Peer) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -42,12 +59,15 @@ func (o *Peer) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Peer) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -59,8 +79,6 @@ func (o *Peer) HasId() bool { return false } - - // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned func (o *Peer) GetName() *string { @@ -69,6 +87,7 @@ func (o *Peer) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -78,12 +97,15 @@ func (o *Peer) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *Peer) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -95,8 +117,6 @@ func (o *Peer) HasName() bool { return false } - - // GetDatacenterId returns the DatacenterId field value // If the value is explicit nil, the zero value for string will be returned func (o *Peer) GetDatacenterId() *string { @@ -105,6 +125,7 @@ func (o *Peer) GetDatacenterId() *string { } return o.DatacenterId + } // GetDatacenterIdOk returns a tuple with the DatacenterId field value @@ -114,12 +135,15 @@ func (o *Peer) GetDatacenterIdOk() (*string, bool) { if o == nil { return nil, false } + return o.DatacenterId, true } // SetDatacenterId sets field value func (o *Peer) SetDatacenterId(v string) { + o.DatacenterId = &v + } // HasDatacenterId returns a boolean if a field has been set. @@ -131,8 +155,6 @@ func (o *Peer) HasDatacenterId() bool { return false } - - // GetDatacenterName returns the DatacenterName field value // If the value is explicit nil, the zero value for string will be returned func (o *Peer) GetDatacenterName() *string { @@ -141,6 +163,7 @@ func (o *Peer) GetDatacenterName() *string { } return o.DatacenterName + } // GetDatacenterNameOk returns a tuple with the DatacenterName field value @@ -150,12 +173,15 @@ func (o *Peer) GetDatacenterNameOk() (*string, bool) { if o == nil { return nil, false } + return o.DatacenterName, true } // SetDatacenterName sets field value func (o *Peer) SetDatacenterName(v string) { + o.DatacenterName = &v + } // HasDatacenterName returns a boolean if a field has been set. @@ -167,8 +193,6 @@ func (o *Peer) HasDatacenterName() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *Peer) GetLocation() *string { @@ -177,6 +201,7 @@ func (o *Peer) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -186,12 +211,15 @@ func (o *Peer) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *Peer) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -203,34 +231,23 @@ func (o *Peer) HasLocation() bool { return false } - func (o Peer) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.DatacenterId != nil { toSerialize["datacenterId"] = o.DatacenterId } - - if o.DatacenterName != nil { toSerialize["datacenterName"] = o.DatacenterName } - - if o.Location != nil { toSerialize["location"] = o.Location } - return json.Marshal(toSerialize) } @@ -269,5 +286,3 @@ func (v *NullablePeer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect.go index 4db1183a4e5f..f0aa7eb8f50c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // PrivateCrossConnect struct for PrivateCrossConnect type PrivateCrossConnect struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` Properties *PrivateCrossConnectProperties `json:"properties"` } +// NewPrivateCrossConnect instantiates a new PrivateCrossConnect object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrivateCrossConnect(properties PrivateCrossConnectProperties) *PrivateCrossConnect { + this := PrivateCrossConnect{} + this.Properties = &properties + + return &this +} + +// NewPrivateCrossConnectWithDefaults instantiates a new PrivateCrossConnect object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrivateCrossConnectWithDefaults() *PrivateCrossConnect { + this := PrivateCrossConnect{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *PrivateCrossConnect) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *PrivateCrossConnect) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *PrivateCrossConnect) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *PrivateCrossConnect) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *PrivateCrossConnect) GetType() *Type { @@ -72,6 +92,7 @@ func (o *PrivateCrossConnect) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *PrivateCrossConnect) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *PrivateCrossConnect) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *PrivateCrossConnect) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *PrivateCrossConnect) GetHref() *string { @@ -108,6 +130,7 @@ func (o *PrivateCrossConnect) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *PrivateCrossConnect) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *PrivateCrossConnect) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *PrivateCrossConnect) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *PrivateCrossConnect) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *PrivateCrossConnect) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *PrivateCrossConnect) GetMetadataOk() (*DatacenterElementMetadata, bool) if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *PrivateCrossConnect) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *PrivateCrossConnect) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for PrivateCrossConnectProperties will be returned func (o *PrivateCrossConnect) GetProperties() *PrivateCrossConnectProperties { @@ -180,6 +206,7 @@ func (o *PrivateCrossConnect) GetProperties() *PrivateCrossConnectProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *PrivateCrossConnect) GetPropertiesOk() (*PrivateCrossConnectProperties, if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *PrivateCrossConnect) SetProperties(v PrivateCrossConnectProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *PrivateCrossConnect) HasProperties() bool { return false } - func (o PrivateCrossConnect) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullablePrivateCrossConnect) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect_properties.go index b665ee3620e6..a92dc80982ee 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connect_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // PrivateCrossConnectProperties struct for PrivateCrossConnectProperties type PrivateCrossConnectProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Human readable description + // Human-readable description. Description *string `json:"description,omitempty"` - // Read-Only attribute. Lists LAN's joined to this private cross connect + // Read-Only attribute. Lists LAN's joined to this private Cross-Connect. Peers *[]Peer `json:"peers,omitempty"` - // Read-Only attribute. Lists datacenters that can be joined to this private cross connect + // Read-Only attribute. Lists data centers that can be joined to this private Cross-Connect. ConnectableDatacenters *[]ConnectableDatacenter `json:"connectableDatacenters,omitempty"` } +// NewPrivateCrossConnectProperties instantiates a new PrivateCrossConnectProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrivateCrossConnectProperties() *PrivateCrossConnectProperties { + this := PrivateCrossConnectProperties{} + return &this +} + +// NewPrivateCrossConnectPropertiesWithDefaults instantiates a new PrivateCrossConnectProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrivateCrossConnectPropertiesWithDefaults() *PrivateCrossConnectProperties { + this := PrivateCrossConnectProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *PrivateCrossConnectProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -45,12 +62,15 @@ func (o *PrivateCrossConnectProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *PrivateCrossConnectProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *PrivateCrossConnectProperties) HasName() bool { return false } - - // GetDescription returns the Description field value // If the value is explicit nil, the zero value for string will be returned func (o *PrivateCrossConnectProperties) GetDescription() *string { @@ -72,6 +90,7 @@ func (o *PrivateCrossConnectProperties) GetDescription() *string { } return o.Description + } // GetDescriptionOk returns a tuple with the Description field value @@ -81,12 +100,15 @@ func (o *PrivateCrossConnectProperties) GetDescriptionOk() (*string, bool) { if o == nil { return nil, false } + return o.Description, true } // SetDescription sets field value func (o *PrivateCrossConnectProperties) SetDescription(v string) { + o.Description = &v + } // HasDescription returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *PrivateCrossConnectProperties) HasDescription() bool { return false } - - // GetPeers returns the Peers field value // If the value is explicit nil, the zero value for []Peer will be returned func (o *PrivateCrossConnectProperties) GetPeers() *[]Peer { @@ -108,6 +128,7 @@ func (o *PrivateCrossConnectProperties) GetPeers() *[]Peer { } return o.Peers + } // GetPeersOk returns a tuple with the Peers field value @@ -117,12 +138,15 @@ func (o *PrivateCrossConnectProperties) GetPeersOk() (*[]Peer, bool) { if o == nil { return nil, false } + return o.Peers, true } // SetPeers sets field value func (o *PrivateCrossConnectProperties) SetPeers(v []Peer) { + o.Peers = &v + } // HasPeers returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *PrivateCrossConnectProperties) HasPeers() bool { return false } - - // GetConnectableDatacenters returns the ConnectableDatacenters field value // If the value is explicit nil, the zero value for []ConnectableDatacenter will be returned func (o *PrivateCrossConnectProperties) GetConnectableDatacenters() *[]ConnectableDatacenter { @@ -144,6 +166,7 @@ func (o *PrivateCrossConnectProperties) GetConnectableDatacenters() *[]Connectab } return o.ConnectableDatacenters + } // GetConnectableDatacentersOk returns a tuple with the ConnectableDatacenters field value @@ -153,12 +176,15 @@ func (o *PrivateCrossConnectProperties) GetConnectableDatacentersOk() (*[]Connec if o == nil { return nil, false } + return o.ConnectableDatacenters, true } // SetConnectableDatacenters sets field value func (o *PrivateCrossConnectProperties) SetConnectableDatacenters(v []ConnectableDatacenter) { + o.ConnectableDatacenters = &v + } // HasConnectableDatacenters returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *PrivateCrossConnectProperties) HasConnectableDatacenters() bool { return false } - func (o PrivateCrossConnectProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Description != nil { toSerialize["description"] = o.Description } - - if o.Peers != nil { toSerialize["peers"] = o.Peers } - - if o.ConnectableDatacenters != nil { toSerialize["connectableDatacenters"] = o.ConnectableDatacenters } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullablePrivateCrossConnectProperties) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connects.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connects.go index 0c291323c90c..7112f9a35aa5 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connects.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_private_cross_connects.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // PrivateCrossConnects struct for PrivateCrossConnects type PrivateCrossConnects struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]PrivateCrossConnect `json:"items,omitempty"` } +// NewPrivateCrossConnects instantiates a new PrivateCrossConnects object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrivateCrossConnects() *PrivateCrossConnects { + this := PrivateCrossConnects{} + return &this +} + +// NewPrivateCrossConnectsWithDefaults instantiates a new PrivateCrossConnects object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrivateCrossConnectsWithDefaults() *PrivateCrossConnects { + this := PrivateCrossConnects{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *PrivateCrossConnects) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *PrivateCrossConnects) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *PrivateCrossConnects) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *PrivateCrossConnects) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *PrivateCrossConnects) GetType() *Type { @@ -72,6 +90,7 @@ func (o *PrivateCrossConnects) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *PrivateCrossConnects) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *PrivateCrossConnects) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *PrivateCrossConnects) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *PrivateCrossConnects) GetHref() *string { @@ -108,6 +128,7 @@ func (o *PrivateCrossConnects) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *PrivateCrossConnects) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *PrivateCrossConnects) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *PrivateCrossConnects) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []PrivateCrossConnect will be returned func (o *PrivateCrossConnects) GetItems() *[]PrivateCrossConnect { @@ -144,6 +166,7 @@ func (o *PrivateCrossConnects) GetItems() *[]PrivateCrossConnect { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *PrivateCrossConnects) GetItemsOk() (*[]PrivateCrossConnect, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *PrivateCrossConnects) SetItems(v []PrivateCrossConnect) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *PrivateCrossConnects) HasItems() bool { return false } - func (o PrivateCrossConnects) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullablePrivateCrossConnects) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_remote_console_url.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_remote_console_url.go new file mode 100644 index 000000000000..4088c7a8c36b --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_remote_console_url.go @@ -0,0 +1,121 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// RemoteConsoleUrl struct for RemoteConsoleUrl +type RemoteConsoleUrl struct { + // The remote console url with the jwToken parameter for access + Url *string `json:"url,omitempty"` +} + +// NewRemoteConsoleUrl instantiates a new RemoteConsoleUrl object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRemoteConsoleUrl() *RemoteConsoleUrl { + this := RemoteConsoleUrl{} + + return &this +} + +// NewRemoteConsoleUrlWithDefaults instantiates a new RemoteConsoleUrl object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRemoteConsoleUrlWithDefaults() *RemoteConsoleUrl { + this := RemoteConsoleUrl{} + return &this +} + +// GetUrl returns the Url field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RemoteConsoleUrl) GetUrl() *string { + if o == nil { + return nil + } + + return o.Url + +} + +// GetUrlOk returns a tuple with the Url 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 *RemoteConsoleUrl) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Url, true +} + +// SetUrl sets field value +func (o *RemoteConsoleUrl) SetUrl(v string) { + + o.Url = &v + +} + +// HasUrl returns a boolean if a field has been set. +func (o *RemoteConsoleUrl) HasUrl() bool { + if o != nil && o.Url != nil { + return true + } + + return false +} + +func (o RemoteConsoleUrl) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Url != nil { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableRemoteConsoleUrl struct { + value *RemoteConsoleUrl + isSet bool +} + +func (v NullableRemoteConsoleUrl) Get() *RemoteConsoleUrl { + return v.value +} + +func (v *NullableRemoteConsoleUrl) Set(val *RemoteConsoleUrl) { + v.value = val + v.isSet = true +} + +func (v NullableRemoteConsoleUrl) IsSet() bool { + return v.isSet +} + +func (v *NullableRemoteConsoleUrl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemoteConsoleUrl(val *RemoteConsoleUrl) *NullableRemoteConsoleUrl { + return &NullableRemoteConsoleUrl{value: val, isSet: true} +} + +func (v NullableRemoteConsoleUrl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemoteConsoleUrl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request.go index 84035b79aaa2..5ac4f4851d18 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Request struct for Request type Request struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *RequestMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *RequestMetadata `json:"metadata,omitempty"` Properties *RequestProperties `json:"properties"` } +// NewRequest instantiates a new Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequest(properties RequestProperties) *Request { + this := Request{} + this.Properties = &properties + + return &this +} + +// NewRequestWithDefaults instantiates a new Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestWithDefaults() *Request { + this := Request{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Request) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Request) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Request) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Request) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Request) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Request) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Request) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Request) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Request) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Request) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Request) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Request) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Request) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Request) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for RequestMetadata will be returned func (o *Request) GetMetadata() *RequestMetadata { @@ -144,6 +168,7 @@ func (o *Request) GetMetadata() *RequestMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Request) GetMetadataOk() (*RequestMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Request) SetMetadata(v RequestMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Request) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for RequestProperties will be returned func (o *Request) GetProperties() *RequestProperties { @@ -180,6 +206,7 @@ func (o *Request) GetProperties() *RequestProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Request) GetPropertiesOk() (*RequestProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Request) SetProperties(v RequestProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Request) HasProperties() bool { return false } - func (o Request) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_metadata.go index bc4f71ad3c38..3ea319b31320 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,16 +17,32 @@ import ( // RequestMetadata struct for RequestMetadata type RequestMetadata struct { - // The last time the resource was created - CreatedDate *time.Time `json:"createdDate,omitempty"` + // The last time the resource was created. + CreatedDate *IonosTime // The user who created the resource. CreatedBy *string `json:"createdBy,omitempty"` - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. - Etag *string `json:"etag,omitempty"` + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + Etag *string `json:"etag,omitempty"` RequestStatus *RequestStatus `json:"requestStatus,omitempty"` } +// NewRequestMetadata instantiates a new RequestMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestMetadata() *RequestMetadata { + this := RequestMetadata{} + return &this +} + +// NewRequestMetadataWithDefaults instantiates a new RequestMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestMetadataWithDefaults() *RequestMetadata { + this := RequestMetadata{} + return &this +} // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned @@ -35,7 +51,11 @@ func (o *RequestMetadata) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -45,12 +65,19 @@ func (o *RequestMetadata) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *RequestMetadata) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -62,8 +89,6 @@ func (o *RequestMetadata) HasCreatedDate() bool { return false } - - // GetCreatedBy returns the CreatedBy field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestMetadata) GetCreatedBy() *string { @@ -72,6 +97,7 @@ func (o *RequestMetadata) GetCreatedBy() *string { } return o.CreatedBy + } // GetCreatedByOk returns a tuple with the CreatedBy field value @@ -81,12 +107,15 @@ func (o *RequestMetadata) GetCreatedByOk() (*string, bool) { if o == nil { return nil, false } + return o.CreatedBy, true } // SetCreatedBy sets field value func (o *RequestMetadata) SetCreatedBy(v string) { + o.CreatedBy = &v + } // HasCreatedBy returns a boolean if a field has been set. @@ -98,8 +127,6 @@ func (o *RequestMetadata) HasCreatedBy() bool { return false } - - // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestMetadata) GetEtag() *string { @@ -108,6 +135,7 @@ func (o *RequestMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -117,12 +145,15 @@ func (o *RequestMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *RequestMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -134,8 +165,6 @@ func (o *RequestMetadata) HasEtag() bool { return false } - - // GetRequestStatus returns the RequestStatus field value // If the value is explicit nil, the zero value for RequestStatus will be returned func (o *RequestMetadata) GetRequestStatus() *RequestStatus { @@ -144,6 +173,7 @@ func (o *RequestMetadata) GetRequestStatus() *RequestStatus { } return o.RequestStatus + } // GetRequestStatusOk returns a tuple with the RequestStatus field value @@ -153,12 +183,15 @@ func (o *RequestMetadata) GetRequestStatusOk() (*RequestStatus, bool) { if o == nil { return nil, false } + return o.RequestStatus, true } // SetRequestStatus sets field value func (o *RequestMetadata) SetRequestStatus(v RequestStatus) { + o.RequestStatus = &v + } // HasRequestStatus returns a boolean if a field has been set. @@ -170,29 +203,20 @@ func (o *RequestMetadata) HasRequestStatus() bool { return false } - func (o RequestMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - - if o.CreatedBy != nil { toSerialize["createdBy"] = o.CreatedBy } - - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.RequestStatus != nil { toSerialize["requestStatus"] = o.RequestStatus } - return json.Marshal(toSerialize) } @@ -231,5 +255,3 @@ func (v *NullableRequestMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_properties.go index 7850b7375f91..94d040939709 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,29 @@ import ( // RequestProperties struct for RequestProperties type RequestProperties struct { - Method *string `json:"method,omitempty"` + Method *string `json:"method,omitempty"` Headers *map[string]string `json:"headers,omitempty"` - Body *string `json:"body,omitempty"` - Url *string `json:"url,omitempty"` + Body *string `json:"body,omitempty"` + Url *string `json:"url,omitempty"` } +// NewRequestProperties instantiates a new RequestProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestProperties() *RequestProperties { + this := RequestProperties{} + return &this +} + +// NewRequestPropertiesWithDefaults instantiates a new RequestProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestPropertiesWithDefaults() *RequestProperties { + this := RequestProperties{} + return &this +} // GetMethod returns the Method field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +48,7 @@ func (o *RequestProperties) GetMethod() *string { } return o.Method + } // GetMethodOk returns a tuple with the Method field value @@ -41,12 +58,15 @@ func (o *RequestProperties) GetMethodOk() (*string, bool) { if o == nil { return nil, false } + return o.Method, true } // SetMethod sets field value func (o *RequestProperties) SetMethod(v string) { + o.Method = &v + } // HasMethod returns a boolean if a field has been set. @@ -58,8 +78,6 @@ func (o *RequestProperties) HasMethod() bool { return false } - - // GetHeaders returns the Headers field value // If the value is explicit nil, the zero value for map[string]string will be returned func (o *RequestProperties) GetHeaders() *map[string]string { @@ -68,6 +86,7 @@ func (o *RequestProperties) GetHeaders() *map[string]string { } return o.Headers + } // GetHeadersOk returns a tuple with the Headers field value @@ -77,12 +96,15 @@ func (o *RequestProperties) GetHeadersOk() (*map[string]string, bool) { if o == nil { return nil, false } + return o.Headers, true } // SetHeaders sets field value func (o *RequestProperties) SetHeaders(v map[string]string) { + o.Headers = &v + } // HasHeaders returns a boolean if a field has been set. @@ -94,8 +116,6 @@ func (o *RequestProperties) HasHeaders() bool { return false } - - // GetBody returns the Body field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestProperties) GetBody() *string { @@ -104,6 +124,7 @@ func (o *RequestProperties) GetBody() *string { } return o.Body + } // GetBodyOk returns a tuple with the Body field value @@ -113,12 +134,15 @@ func (o *RequestProperties) GetBodyOk() (*string, bool) { if o == nil { return nil, false } + return o.Body, true } // SetBody sets field value func (o *RequestProperties) SetBody(v string) { + o.Body = &v + } // HasBody returns a boolean if a field has been set. @@ -130,8 +154,6 @@ func (o *RequestProperties) HasBody() bool { return false } - - // GetUrl returns the Url field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestProperties) GetUrl() *string { @@ -140,6 +162,7 @@ func (o *RequestProperties) GetUrl() *string { } return o.Url + } // GetUrlOk returns a tuple with the Url field value @@ -149,12 +172,15 @@ func (o *RequestProperties) GetUrlOk() (*string, bool) { if o == nil { return nil, false } + return o.Url, true } // SetUrl sets field value func (o *RequestProperties) SetUrl(v string) { + o.Url = &v + } // HasUrl returns a boolean if a field has been set. @@ -166,29 +192,20 @@ func (o *RequestProperties) HasUrl() bool { return false } - func (o RequestProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Method != nil { toSerialize["method"] = o.Method } - - if o.Headers != nil { toSerialize["headers"] = o.Headers } - - if o.Body != nil { toSerialize["body"] = o.Body } - - if o.Url != nil { toSerialize["url"] = o.Url } - return json.Marshal(toSerialize) } @@ -227,5 +244,3 @@ func (v *NullableRequestProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status.go index 7b630638ba06..e772df8e6404 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,16 +16,32 @@ import ( // RequestStatus struct for RequestStatus type RequestStatus struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` Metadata *RequestStatusMetadata `json:"metadata,omitempty"` } +// NewRequestStatus instantiates a new RequestStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestStatus() *RequestStatus { + this := RequestStatus{} + return &this +} + +// NewRequestStatusWithDefaults instantiates a new RequestStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestStatusWithDefaults() *RequestStatus { + this := RequestStatus{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -35,6 +51,7 @@ func (o *RequestStatus) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -44,12 +61,15 @@ func (o *RequestStatus) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *RequestStatus) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -61,8 +81,6 @@ func (o *RequestStatus) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *RequestStatus) GetType() *Type { @@ -71,6 +89,7 @@ func (o *RequestStatus) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -80,12 +99,15 @@ func (o *RequestStatus) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *RequestStatus) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -97,8 +119,6 @@ func (o *RequestStatus) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestStatus) GetHref() *string { @@ -107,6 +127,7 @@ func (o *RequestStatus) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -116,12 +137,15 @@ func (o *RequestStatus) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *RequestStatus) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -133,8 +157,6 @@ func (o *RequestStatus) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for RequestStatusMetadata will be returned func (o *RequestStatus) GetMetadata() *RequestStatusMetadata { @@ -143,6 +165,7 @@ func (o *RequestStatus) GetMetadata() *RequestStatusMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -152,12 +175,15 @@ func (o *RequestStatus) GetMetadataOk() (*RequestStatusMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *RequestStatus) SetMetadata(v RequestStatusMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -169,29 +195,20 @@ func (o *RequestStatus) HasMetadata() bool { return false } - func (o RequestStatus) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - return json.Marshal(toSerialize) } @@ -230,5 +247,3 @@ func (v *NullableRequestStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status_metadata.go index 409c0fd776fa..ef97dbedb13e 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_status_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,14 +16,30 @@ import ( // RequestStatusMetadata struct for RequestStatusMetadata type RequestStatusMetadata struct { - Status *string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` Message *string `json:"message,omitempty"` - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. - Etag *string `json:"etag,omitempty"` + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + Etag *string `json:"etag,omitempty"` Targets *[]RequestTarget `json:"targets,omitempty"` } +// NewRequestStatusMetadata instantiates a new RequestStatusMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestStatusMetadata() *RequestStatusMetadata { + this := RequestStatusMetadata{} + return &this +} + +// NewRequestStatusMetadataWithDefaults instantiates a new RequestStatusMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestStatusMetadataWithDefaults() *RequestStatusMetadata { + this := RequestStatusMetadata{} + return &this +} // GetStatus returns the Status field value // If the value is explicit nil, the zero value for string will be returned @@ -33,6 +49,7 @@ func (o *RequestStatusMetadata) GetStatus() *string { } return o.Status + } // GetStatusOk returns a tuple with the Status field value @@ -42,12 +59,15 @@ func (o *RequestStatusMetadata) GetStatusOk() (*string, bool) { if o == nil { return nil, false } + return o.Status, true } // SetStatus sets field value func (o *RequestStatusMetadata) SetStatus(v string) { + o.Status = &v + } // HasStatus returns a boolean if a field has been set. @@ -59,8 +79,6 @@ func (o *RequestStatusMetadata) HasStatus() bool { return false } - - // GetMessage returns the Message field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestStatusMetadata) GetMessage() *string { @@ -69,6 +87,7 @@ func (o *RequestStatusMetadata) GetMessage() *string { } return o.Message + } // GetMessageOk returns a tuple with the Message field value @@ -78,12 +97,15 @@ func (o *RequestStatusMetadata) GetMessageOk() (*string, bool) { if o == nil { return nil, false } + return o.Message, true } // SetMessage sets field value func (o *RequestStatusMetadata) SetMessage(v string) { + o.Message = &v + } // HasMessage returns a boolean if a field has been set. @@ -95,8 +117,6 @@ func (o *RequestStatusMetadata) HasMessage() bool { return false } - - // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestStatusMetadata) GetEtag() *string { @@ -105,6 +125,7 @@ func (o *RequestStatusMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -114,12 +135,15 @@ func (o *RequestStatusMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *RequestStatusMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -131,8 +155,6 @@ func (o *RequestStatusMetadata) HasEtag() bool { return false } - - // GetTargets returns the Targets field value // If the value is explicit nil, the zero value for []RequestTarget will be returned func (o *RequestStatusMetadata) GetTargets() *[]RequestTarget { @@ -141,6 +163,7 @@ func (o *RequestStatusMetadata) GetTargets() *[]RequestTarget { } return o.Targets + } // GetTargetsOk returns a tuple with the Targets field value @@ -150,12 +173,15 @@ func (o *RequestStatusMetadata) GetTargetsOk() (*[]RequestTarget, bool) { if o == nil { return nil, false } + return o.Targets, true } // SetTargets sets field value func (o *RequestStatusMetadata) SetTargets(v []RequestTarget) { + o.Targets = &v + } // HasTargets returns a boolean if a field has been set. @@ -167,29 +193,20 @@ func (o *RequestStatusMetadata) HasTargets() bool { return false } - func (o RequestStatusMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Status != nil { toSerialize["status"] = o.Status } - - if o.Message != nil { toSerialize["message"] = o.Message } - - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.Targets != nil { toSerialize["targets"] = o.Targets } - return json.Marshal(toSerialize) } @@ -228,5 +245,3 @@ func (v *NullableRequestStatusMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_target.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_target.go index 5b5ec5657fff..590a5dfae8ae 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_target.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_request_target.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,10 +17,26 @@ import ( // RequestTarget struct for RequestTarget type RequestTarget struct { Target *ResourceReference `json:"target,omitempty"` - Status *string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` } +// NewRequestTarget instantiates a new RequestTarget object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestTarget() *RequestTarget { + this := RequestTarget{} + return &this +} + +// NewRequestTargetWithDefaults instantiates a new RequestTarget object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestTargetWithDefaults() *RequestTarget { + this := RequestTarget{} + return &this +} // GetTarget returns the Target field value // If the value is explicit nil, the zero value for ResourceReference will be returned @@ -30,6 +46,7 @@ func (o *RequestTarget) GetTarget() *ResourceReference { } return o.Target + } // GetTargetOk returns a tuple with the Target field value @@ -39,12 +56,15 @@ func (o *RequestTarget) GetTargetOk() (*ResourceReference, bool) { if o == nil { return nil, false } + return o.Target, true } // SetTarget sets field value func (o *RequestTarget) SetTarget(v ResourceReference) { + o.Target = &v + } // HasTarget returns a boolean if a field has been set. @@ -56,8 +76,6 @@ func (o *RequestTarget) HasTarget() bool { return false } - - // GetStatus returns the Status field value // If the value is explicit nil, the zero value for string will be returned func (o *RequestTarget) GetStatus() *string { @@ -66,6 +84,7 @@ func (o *RequestTarget) GetStatus() *string { } return o.Status + } // GetStatusOk returns a tuple with the Status field value @@ -75,12 +94,15 @@ func (o *RequestTarget) GetStatusOk() (*string, bool) { if o == nil { return nil, false } + return o.Status, true } // SetStatus sets field value func (o *RequestTarget) SetStatus(v string) { + o.Status = &v + } // HasStatus returns a boolean if a field has been set. @@ -92,19 +114,14 @@ func (o *RequestTarget) HasStatus() bool { return false } - func (o RequestTarget) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Target != nil { toSerialize["target"] = o.Target } - - if o.Status != nil { toSerialize["status"] = o.Status } - return json.Marshal(toSerialize) } @@ -143,5 +160,3 @@ func (v *NullableRequestTarget) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_requests.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_requests.go index 9e7391d0fbd0..3d67bdc81880 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_requests.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_requests.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,42 @@ import ( // Requests struct for Requests type Requests struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Request `json:"items,omitempty"` + // The offset, specified in the request (if not is specified, 0 is used by default). + Offset *float32 `json:"offset"` + // The limit, specified in the request (if not specified, the endpoint's default pagination limit is used). + Limit *float32 `json:"limit"` + Links *PaginationLinks `json:"_links"` } +// NewRequests instantiates a new Requests object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequests(offset float32, limit float32, links PaginationLinks) *Requests { + this := Requests{} + this.Offset = &offset + this.Limit = &limit + this.Links = &links + + return &this +} + +// NewRequestsWithDefaults instantiates a new Requests object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestsWithDefaults() *Requests { + this := Requests{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +61,7 @@ func (o *Requests) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +71,15 @@ func (o *Requests) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Requests) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +91,6 @@ func (o *Requests) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Requests) GetType() *Type { @@ -72,6 +99,7 @@ func (o *Requests) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +109,15 @@ func (o *Requests) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Requests) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +129,6 @@ func (o *Requests) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Requests) GetHref() *string { @@ -108,6 +137,7 @@ func (o *Requests) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +147,15 @@ func (o *Requests) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Requests) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +167,6 @@ func (o *Requests) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Request will be returned func (o *Requests) GetItems() *[]Request { @@ -144,6 +175,7 @@ func (o *Requests) GetItems() *[]Request { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +185,15 @@ func (o *Requests) GetItemsOk() (*[]Request, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Requests) SetItems(v []Request) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +205,143 @@ func (o *Requests) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Requests) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Requests) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Requests) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Requests) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Requests) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Requests) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Requests) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Requests) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Requests) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Requests) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Requests) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Requests) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Requests) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +380,3 @@ func (v *NullableRequests) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource.go index cd343d07c65b..1d370ce223e3 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,34 @@ import ( // Resource datacenter resource representation type Resource struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *ResourceProperties `json:"properties,omitempty"` - Entities *ResourceEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *ResourceProperties `json:"properties,omitempty"` + Entities *ResourceEntities `json:"entities,omitempty"` } +// NewResource instantiates a new Resource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +53,7 @@ func (o *Resource) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +63,15 @@ func (o *Resource) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Resource) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +83,6 @@ func (o *Resource) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Resource) GetType() *Type { @@ -73,6 +91,7 @@ func (o *Resource) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +101,15 @@ func (o *Resource) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Resource) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +121,6 @@ func (o *Resource) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Resource) GetHref() *string { @@ -109,6 +129,7 @@ func (o *Resource) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +139,15 @@ func (o *Resource) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Resource) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +159,6 @@ func (o *Resource) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Resource) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +167,7 @@ func (o *Resource) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +177,15 @@ func (o *Resource) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Resource) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +197,6 @@ func (o *Resource) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for ResourceProperties will be returned func (o *Resource) GetProperties() *ResourceProperties { @@ -181,6 +205,7 @@ func (o *Resource) GetProperties() *ResourceProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +215,15 @@ func (o *Resource) GetPropertiesOk() (*ResourceProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Resource) SetProperties(v ResourceProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +235,6 @@ func (o *Resource) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for ResourceEntities will be returned func (o *Resource) GetEntities() *ResourceEntities { @@ -217,6 +243,7 @@ func (o *Resource) GetEntities() *ResourceEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +253,15 @@ func (o *Resource) GetEntitiesOk() (*ResourceEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Resource) SetEntities(v ResourceEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +273,26 @@ func (o *Resource) HasEntities() bool { return false } - func (o Resource) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +331,3 @@ func (v *NullableResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_entities.go index 7b2457802999..cc9f26acb020 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -19,7 +19,23 @@ type ResourceEntities struct { Groups *ResourceGroups `json:"groups,omitempty"` } +// NewResourceEntities instantiates a new ResourceEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceEntities() *ResourceEntities { + this := ResourceEntities{} + return &this +} + +// NewResourceEntitiesWithDefaults instantiates a new ResourceEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceEntitiesWithDefaults() *ResourceEntities { + this := ResourceEntities{} + return &this +} // GetGroups returns the Groups field value // If the value is explicit nil, the zero value for ResourceGroups will be returned @@ -29,6 +45,7 @@ func (o *ResourceEntities) GetGroups() *ResourceGroups { } return o.Groups + } // GetGroupsOk returns a tuple with the Groups field value @@ -38,12 +55,15 @@ func (o *ResourceEntities) GetGroupsOk() (*ResourceGroups, bool) { if o == nil { return nil, false } + return o.Groups, true } // SetGroups sets field value func (o *ResourceEntities) SetGroups(v ResourceGroups) { + o.Groups = &v + } // HasGroups returns a boolean if a field has been set. @@ -55,14 +75,11 @@ func (o *ResourceEntities) HasGroups() bool { return false } - func (o ResourceEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Groups != nil { toSerialize["groups"] = o.Groups } - return json.Marshal(toSerialize) } @@ -101,5 +118,3 @@ func (v *NullableResourceEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_groups.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_groups.go index 69332ef3d795..ae8939261cf3 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_groups.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_groups.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // ResourceGroups Resources assigned to this group. type ResourceGroups struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Resource `json:"items,omitempty"` } +// NewResourceGroups instantiates a new ResourceGroups object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceGroups() *ResourceGroups { + this := ResourceGroups{} + return &this +} + +// NewResourceGroupsWithDefaults instantiates a new ResourceGroups object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceGroupsWithDefaults() *ResourceGroups { + this := ResourceGroups{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *ResourceGroups) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *ResourceGroups) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *ResourceGroups) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *ResourceGroups) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *ResourceGroups) GetType() *Type { @@ -72,6 +90,7 @@ func (o *ResourceGroups) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *ResourceGroups) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *ResourceGroups) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *ResourceGroups) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *ResourceGroups) GetHref() *string { @@ -108,6 +128,7 @@ func (o *ResourceGroups) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *ResourceGroups) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *ResourceGroups) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *ResourceGroups) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Resource will be returned func (o *ResourceGroups) GetItems() *[]Resource { @@ -144,6 +166,7 @@ func (o *ResourceGroups) GetItems() *[]Resource { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *ResourceGroups) GetItemsOk() (*[]Resource, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *ResourceGroups) SetItems(v []Resource) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *ResourceGroups) HasItems() bool { return false } - func (o ResourceGroups) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableResourceGroups) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_limits.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_limits.go index 014c6f67f420..4acc2299887c 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_limits.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_limits.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,44 +16,93 @@ import ( // ResourceLimits struct for ResourceLimits type ResourceLimits struct { - // maximum number of cores per server + // The maximum number of cores per server. CoresPerServer *int32 `json:"coresPerServer"` - // maximum cores per contract + // The maximum number of cores per contract. CoresPerContract *int32 `json:"coresPerContract"` - // number of cores provisioned + // The number of cores provisioned. CoresProvisioned *int32 `json:"coresProvisioned"` - // maximum ram per server + // The maximum RAM per server. RamPerServer *int32 `json:"ramPerServer"` - // maximum ram per contract + // The maximum RAM per contract. RamPerContract *int32 `json:"ramPerContract"` - // ram provisioned + // RAM provisioned. RamProvisioned *int32 `json:"ramProvisioned"` - // hdd limit per volume + // HDD limit per volume. HddLimitPerVolume *int64 `json:"hddLimitPerVolume"` - // hdd limit per contract + // HDD limit per contract. HddLimitPerContract *int64 `json:"hddLimitPerContract"` - // hdd volume provisioned + // HDD volume provisioned. HddVolumeProvisioned *int64 `json:"hddVolumeProvisioned"` - // ssd limit per volume + // SSD limit per volume. SsdLimitPerVolume *int64 `json:"ssdLimitPerVolume"` - // ssd limit per contract + // SSD limit per contract. SsdLimitPerContract *int64 `json:"ssdLimitPerContract"` - // ssd volume provisioned + // SSD volume provisioned. SsdVolumeProvisioned *int64 `json:"ssdVolumeProvisioned"` - // total reservable ip limit of the customer + // DAS (Direct Attached Storage) volume provisioned. + DasVolumeProvisioned *int64 `json:"dasVolumeProvisioned"` + // Total reservable IP limit for the customer. ReservableIps *int32 `json:"reservableIps"` - // reserved ips on a contract + // Reserved ips for the contract. ReservedIpsOnContract *int32 `json:"reservedIpsOnContract"` - // reserved ips in use + // Reserved ips in use. ReservedIpsInUse *int32 `json:"reservedIpsInUse"` - // k8s clusters total limit + // K8s clusters total limit. K8sClusterLimitTotal *int32 `json:"k8sClusterLimitTotal"` - // k8s clusters provisioned + // K8s clusters provisioned. K8sClustersProvisioned *int32 `json:"k8sClustersProvisioned"` + // NLB total limit. + NlbLimitTotal *int32 `json:"nlbLimitTotal"` + // NLBs provisioned. + NlbProvisioned *int32 `json:"nlbProvisioned"` + // NAT Gateway total limit. + NatGatewayLimitTotal *int32 `json:"natGatewayLimitTotal"` + // NAT Gateways provisioned. + NatGatewayProvisioned *int32 `json:"natGatewayProvisioned"` +} + +// NewResourceLimits instantiates a new ResourceLimits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceLimits(coresPerServer int32, coresPerContract int32, coresProvisioned int32, ramPerServer int32, ramPerContract int32, ramProvisioned int32, hddLimitPerVolume int64, hddLimitPerContract int64, hddVolumeProvisioned int64, ssdLimitPerVolume int64, ssdLimitPerContract int64, ssdVolumeProvisioned int64, dasVolumeProvisioned int64, reservableIps int32, reservedIpsOnContract int32, reservedIpsInUse int32, k8sClusterLimitTotal int32, k8sClustersProvisioned int32, nlbLimitTotal int32, nlbProvisioned int32, natGatewayLimitTotal int32, natGatewayProvisioned int32) *ResourceLimits { + this := ResourceLimits{} + + this.CoresPerServer = &coresPerServer + this.CoresPerContract = &coresPerContract + this.CoresProvisioned = &coresProvisioned + this.RamPerServer = &ramPerServer + this.RamPerContract = &ramPerContract + this.RamProvisioned = &ramProvisioned + this.HddLimitPerVolume = &hddLimitPerVolume + this.HddLimitPerContract = &hddLimitPerContract + this.HddVolumeProvisioned = &hddVolumeProvisioned + this.SsdLimitPerVolume = &ssdLimitPerVolume + this.SsdLimitPerContract = &ssdLimitPerContract + this.SsdVolumeProvisioned = &ssdVolumeProvisioned + this.DasVolumeProvisioned = &dasVolumeProvisioned + this.ReservableIps = &reservableIps + this.ReservedIpsOnContract = &reservedIpsOnContract + this.ReservedIpsInUse = &reservedIpsInUse + this.K8sClusterLimitTotal = &k8sClusterLimitTotal + this.K8sClustersProvisioned = &k8sClustersProvisioned + this.NlbLimitTotal = &nlbLimitTotal + this.NlbProvisioned = &nlbProvisioned + this.NatGatewayLimitTotal = &natGatewayLimitTotal + this.NatGatewayProvisioned = &natGatewayProvisioned + + return &this +} + +// NewResourceLimitsWithDefaults instantiates a new ResourceLimits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceLimitsWithDefaults() *ResourceLimits { + this := ResourceLimits{} + return &this } - - // GetCoresPerServer returns the CoresPerServer field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetCoresPerServer() *int32 { @@ -62,6 +111,7 @@ func (o *ResourceLimits) GetCoresPerServer() *int32 { } return o.CoresPerServer + } // GetCoresPerServerOk returns a tuple with the CoresPerServer field value @@ -71,12 +121,15 @@ func (o *ResourceLimits) GetCoresPerServerOk() (*int32, bool) { if o == nil { return nil, false } + return o.CoresPerServer, true } // SetCoresPerServer sets field value func (o *ResourceLimits) SetCoresPerServer(v int32) { + o.CoresPerServer = &v + } // HasCoresPerServer returns a boolean if a field has been set. @@ -88,8 +141,6 @@ func (o *ResourceLimits) HasCoresPerServer() bool { return false } - - // GetCoresPerContract returns the CoresPerContract field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetCoresPerContract() *int32 { @@ -98,6 +149,7 @@ func (o *ResourceLimits) GetCoresPerContract() *int32 { } return o.CoresPerContract + } // GetCoresPerContractOk returns a tuple with the CoresPerContract field value @@ -107,12 +159,15 @@ func (o *ResourceLimits) GetCoresPerContractOk() (*int32, bool) { if o == nil { return nil, false } + return o.CoresPerContract, true } // SetCoresPerContract sets field value func (o *ResourceLimits) SetCoresPerContract(v int32) { + o.CoresPerContract = &v + } // HasCoresPerContract returns a boolean if a field has been set. @@ -124,8 +179,6 @@ func (o *ResourceLimits) HasCoresPerContract() bool { return false } - - // GetCoresProvisioned returns the CoresProvisioned field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetCoresProvisioned() *int32 { @@ -134,6 +187,7 @@ func (o *ResourceLimits) GetCoresProvisioned() *int32 { } return o.CoresProvisioned + } // GetCoresProvisionedOk returns a tuple with the CoresProvisioned field value @@ -143,12 +197,15 @@ func (o *ResourceLimits) GetCoresProvisionedOk() (*int32, bool) { if o == nil { return nil, false } + return o.CoresProvisioned, true } // SetCoresProvisioned sets field value func (o *ResourceLimits) SetCoresProvisioned(v int32) { + o.CoresProvisioned = &v + } // HasCoresProvisioned returns a boolean if a field has been set. @@ -160,8 +217,6 @@ func (o *ResourceLimits) HasCoresProvisioned() bool { return false } - - // GetRamPerServer returns the RamPerServer field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetRamPerServer() *int32 { @@ -170,6 +225,7 @@ func (o *ResourceLimits) GetRamPerServer() *int32 { } return o.RamPerServer + } // GetRamPerServerOk returns a tuple with the RamPerServer field value @@ -179,12 +235,15 @@ func (o *ResourceLimits) GetRamPerServerOk() (*int32, bool) { if o == nil { return nil, false } + return o.RamPerServer, true } // SetRamPerServer sets field value func (o *ResourceLimits) SetRamPerServer(v int32) { + o.RamPerServer = &v + } // HasRamPerServer returns a boolean if a field has been set. @@ -196,8 +255,6 @@ func (o *ResourceLimits) HasRamPerServer() bool { return false } - - // GetRamPerContract returns the RamPerContract field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetRamPerContract() *int32 { @@ -206,6 +263,7 @@ func (o *ResourceLimits) GetRamPerContract() *int32 { } return o.RamPerContract + } // GetRamPerContractOk returns a tuple with the RamPerContract field value @@ -215,12 +273,15 @@ func (o *ResourceLimits) GetRamPerContractOk() (*int32, bool) { if o == nil { return nil, false } + return o.RamPerContract, true } // SetRamPerContract sets field value func (o *ResourceLimits) SetRamPerContract(v int32) { + o.RamPerContract = &v + } // HasRamPerContract returns a boolean if a field has been set. @@ -232,8 +293,6 @@ func (o *ResourceLimits) HasRamPerContract() bool { return false } - - // GetRamProvisioned returns the RamProvisioned field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetRamProvisioned() *int32 { @@ -242,6 +301,7 @@ func (o *ResourceLimits) GetRamProvisioned() *int32 { } return o.RamProvisioned + } // GetRamProvisionedOk returns a tuple with the RamProvisioned field value @@ -251,12 +311,15 @@ func (o *ResourceLimits) GetRamProvisionedOk() (*int32, bool) { if o == nil { return nil, false } + return o.RamProvisioned, true } // SetRamProvisioned sets field value func (o *ResourceLimits) SetRamProvisioned(v int32) { + o.RamProvisioned = &v + } // HasRamProvisioned returns a boolean if a field has been set. @@ -268,8 +331,6 @@ func (o *ResourceLimits) HasRamProvisioned() bool { return false } - - // GetHddLimitPerVolume returns the HddLimitPerVolume field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetHddLimitPerVolume() *int64 { @@ -278,6 +339,7 @@ func (o *ResourceLimits) GetHddLimitPerVolume() *int64 { } return o.HddLimitPerVolume + } // GetHddLimitPerVolumeOk returns a tuple with the HddLimitPerVolume field value @@ -287,12 +349,15 @@ func (o *ResourceLimits) GetHddLimitPerVolumeOk() (*int64, bool) { if o == nil { return nil, false } + return o.HddLimitPerVolume, true } // SetHddLimitPerVolume sets field value func (o *ResourceLimits) SetHddLimitPerVolume(v int64) { + o.HddLimitPerVolume = &v + } // HasHddLimitPerVolume returns a boolean if a field has been set. @@ -304,8 +369,6 @@ func (o *ResourceLimits) HasHddLimitPerVolume() bool { return false } - - // GetHddLimitPerContract returns the HddLimitPerContract field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetHddLimitPerContract() *int64 { @@ -314,6 +377,7 @@ func (o *ResourceLimits) GetHddLimitPerContract() *int64 { } return o.HddLimitPerContract + } // GetHddLimitPerContractOk returns a tuple with the HddLimitPerContract field value @@ -323,12 +387,15 @@ func (o *ResourceLimits) GetHddLimitPerContractOk() (*int64, bool) { if o == nil { return nil, false } + return o.HddLimitPerContract, true } // SetHddLimitPerContract sets field value func (o *ResourceLimits) SetHddLimitPerContract(v int64) { + o.HddLimitPerContract = &v + } // HasHddLimitPerContract returns a boolean if a field has been set. @@ -340,8 +407,6 @@ func (o *ResourceLimits) HasHddLimitPerContract() bool { return false } - - // GetHddVolumeProvisioned returns the HddVolumeProvisioned field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetHddVolumeProvisioned() *int64 { @@ -350,6 +415,7 @@ func (o *ResourceLimits) GetHddVolumeProvisioned() *int64 { } return o.HddVolumeProvisioned + } // GetHddVolumeProvisionedOk returns a tuple with the HddVolumeProvisioned field value @@ -359,12 +425,15 @@ func (o *ResourceLimits) GetHddVolumeProvisionedOk() (*int64, bool) { if o == nil { return nil, false } + return o.HddVolumeProvisioned, true } // SetHddVolumeProvisioned sets field value func (o *ResourceLimits) SetHddVolumeProvisioned(v int64) { + o.HddVolumeProvisioned = &v + } // HasHddVolumeProvisioned returns a boolean if a field has been set. @@ -376,8 +445,6 @@ func (o *ResourceLimits) HasHddVolumeProvisioned() bool { return false } - - // GetSsdLimitPerVolume returns the SsdLimitPerVolume field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetSsdLimitPerVolume() *int64 { @@ -386,6 +453,7 @@ func (o *ResourceLimits) GetSsdLimitPerVolume() *int64 { } return o.SsdLimitPerVolume + } // GetSsdLimitPerVolumeOk returns a tuple with the SsdLimitPerVolume field value @@ -395,12 +463,15 @@ func (o *ResourceLimits) GetSsdLimitPerVolumeOk() (*int64, bool) { if o == nil { return nil, false } + return o.SsdLimitPerVolume, true } // SetSsdLimitPerVolume sets field value func (o *ResourceLimits) SetSsdLimitPerVolume(v int64) { + o.SsdLimitPerVolume = &v + } // HasSsdLimitPerVolume returns a boolean if a field has been set. @@ -412,8 +483,6 @@ func (o *ResourceLimits) HasSsdLimitPerVolume() bool { return false } - - // GetSsdLimitPerContract returns the SsdLimitPerContract field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetSsdLimitPerContract() *int64 { @@ -422,6 +491,7 @@ func (o *ResourceLimits) GetSsdLimitPerContract() *int64 { } return o.SsdLimitPerContract + } // GetSsdLimitPerContractOk returns a tuple with the SsdLimitPerContract field value @@ -431,12 +501,15 @@ func (o *ResourceLimits) GetSsdLimitPerContractOk() (*int64, bool) { if o == nil { return nil, false } + return o.SsdLimitPerContract, true } // SetSsdLimitPerContract sets field value func (o *ResourceLimits) SetSsdLimitPerContract(v int64) { + o.SsdLimitPerContract = &v + } // HasSsdLimitPerContract returns a boolean if a field has been set. @@ -448,8 +521,6 @@ func (o *ResourceLimits) HasSsdLimitPerContract() bool { return false } - - // GetSsdVolumeProvisioned returns the SsdVolumeProvisioned field value // If the value is explicit nil, the zero value for int64 will be returned func (o *ResourceLimits) GetSsdVolumeProvisioned() *int64 { @@ -458,6 +529,7 @@ func (o *ResourceLimits) GetSsdVolumeProvisioned() *int64 { } return o.SsdVolumeProvisioned + } // GetSsdVolumeProvisionedOk returns a tuple with the SsdVolumeProvisioned field value @@ -467,12 +539,15 @@ func (o *ResourceLimits) GetSsdVolumeProvisionedOk() (*int64, bool) { if o == nil { return nil, false } + return o.SsdVolumeProvisioned, true } // SetSsdVolumeProvisioned sets field value func (o *ResourceLimits) SetSsdVolumeProvisioned(v int64) { + o.SsdVolumeProvisioned = &v + } // HasSsdVolumeProvisioned returns a boolean if a field has been set. @@ -484,7 +559,43 @@ func (o *ResourceLimits) HasSsdVolumeProvisioned() bool { return false } +// GetDasVolumeProvisioned returns the DasVolumeProvisioned field value +// If the value is explicit nil, the zero value for int64 will be returned +func (o *ResourceLimits) GetDasVolumeProvisioned() *int64 { + if o == nil { + return nil + } + + return o.DasVolumeProvisioned + +} + +// GetDasVolumeProvisionedOk returns a tuple with the DasVolumeProvisioned 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 *ResourceLimits) GetDasVolumeProvisionedOk() (*int64, bool) { + if o == nil { + return nil, false + } + + return o.DasVolumeProvisioned, true +} + +// SetDasVolumeProvisioned sets field value +func (o *ResourceLimits) SetDasVolumeProvisioned(v int64) { + + o.DasVolumeProvisioned = &v + +} +// HasDasVolumeProvisioned returns a boolean if a field has been set. +func (o *ResourceLimits) HasDasVolumeProvisioned() bool { + if o != nil && o.DasVolumeProvisioned != nil { + return true + } + + return false +} // GetReservableIps returns the ReservableIps field value // If the value is explicit nil, the zero value for int32 will be returned @@ -494,6 +605,7 @@ func (o *ResourceLimits) GetReservableIps() *int32 { } return o.ReservableIps + } // GetReservableIpsOk returns a tuple with the ReservableIps field value @@ -503,12 +615,15 @@ func (o *ResourceLimits) GetReservableIpsOk() (*int32, bool) { if o == nil { return nil, false } + return o.ReservableIps, true } // SetReservableIps sets field value func (o *ResourceLimits) SetReservableIps(v int32) { + o.ReservableIps = &v + } // HasReservableIps returns a boolean if a field has been set. @@ -520,8 +635,6 @@ func (o *ResourceLimits) HasReservableIps() bool { return false } - - // GetReservedIpsOnContract returns the ReservedIpsOnContract field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetReservedIpsOnContract() *int32 { @@ -530,6 +643,7 @@ func (o *ResourceLimits) GetReservedIpsOnContract() *int32 { } return o.ReservedIpsOnContract + } // GetReservedIpsOnContractOk returns a tuple with the ReservedIpsOnContract field value @@ -539,12 +653,15 @@ func (o *ResourceLimits) GetReservedIpsOnContractOk() (*int32, bool) { if o == nil { return nil, false } + return o.ReservedIpsOnContract, true } // SetReservedIpsOnContract sets field value func (o *ResourceLimits) SetReservedIpsOnContract(v int32) { + o.ReservedIpsOnContract = &v + } // HasReservedIpsOnContract returns a boolean if a field has been set. @@ -556,8 +673,6 @@ func (o *ResourceLimits) HasReservedIpsOnContract() bool { return false } - - // GetReservedIpsInUse returns the ReservedIpsInUse field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetReservedIpsInUse() *int32 { @@ -566,6 +681,7 @@ func (o *ResourceLimits) GetReservedIpsInUse() *int32 { } return o.ReservedIpsInUse + } // GetReservedIpsInUseOk returns a tuple with the ReservedIpsInUse field value @@ -575,12 +691,15 @@ func (o *ResourceLimits) GetReservedIpsInUseOk() (*int32, bool) { if o == nil { return nil, false } + return o.ReservedIpsInUse, true } // SetReservedIpsInUse sets field value func (o *ResourceLimits) SetReservedIpsInUse(v int32) { + o.ReservedIpsInUse = &v + } // HasReservedIpsInUse returns a boolean if a field has been set. @@ -592,8 +711,6 @@ func (o *ResourceLimits) HasReservedIpsInUse() bool { return false } - - // GetK8sClusterLimitTotal returns the K8sClusterLimitTotal field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetK8sClusterLimitTotal() *int32 { @@ -602,6 +719,7 @@ func (o *ResourceLimits) GetK8sClusterLimitTotal() *int32 { } return o.K8sClusterLimitTotal + } // GetK8sClusterLimitTotalOk returns a tuple with the K8sClusterLimitTotal field value @@ -611,12 +729,15 @@ func (o *ResourceLimits) GetK8sClusterLimitTotalOk() (*int32, bool) { if o == nil { return nil, false } + return o.K8sClusterLimitTotal, true } // SetK8sClusterLimitTotal sets field value func (o *ResourceLimits) SetK8sClusterLimitTotal(v int32) { + o.K8sClusterLimitTotal = &v + } // HasK8sClusterLimitTotal returns a boolean if a field has been set. @@ -628,8 +749,6 @@ func (o *ResourceLimits) HasK8sClusterLimitTotal() bool { return false } - - // GetK8sClustersProvisioned returns the K8sClustersProvisioned field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ResourceLimits) GetK8sClustersProvisioned() *int32 { @@ -638,6 +757,7 @@ func (o *ResourceLimits) GetK8sClustersProvisioned() *int32 { } return o.K8sClustersProvisioned + } // GetK8sClustersProvisionedOk returns a tuple with the K8sClustersProvisioned field value @@ -647,12 +767,15 @@ func (o *ResourceLimits) GetK8sClustersProvisionedOk() (*int32, bool) { if o == nil { return nil, false } + return o.K8sClustersProvisioned, true } // SetK8sClustersProvisioned sets field value func (o *ResourceLimits) SetK8sClustersProvisioned(v int32) { + o.K8sClustersProvisioned = &v + } // HasK8sClustersProvisioned returns a boolean if a field has been set. @@ -664,94 +787,226 @@ func (o *ResourceLimits) HasK8sClustersProvisioned() bool { return false } +// GetNlbLimitTotal returns the NlbLimitTotal field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ResourceLimits) GetNlbLimitTotal() *int32 { + if o == nil { + return nil + } + + return o.NlbLimitTotal + +} + +// GetNlbLimitTotalOk returns a tuple with the NlbLimitTotal 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 *ResourceLimits) GetNlbLimitTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.NlbLimitTotal, true +} + +// SetNlbLimitTotal sets field value +func (o *ResourceLimits) SetNlbLimitTotal(v int32) { + + o.NlbLimitTotal = &v + +} + +// HasNlbLimitTotal returns a boolean if a field has been set. +func (o *ResourceLimits) HasNlbLimitTotal() bool { + if o != nil && o.NlbLimitTotal != nil { + return true + } + + return false +} + +// GetNlbProvisioned returns the NlbProvisioned field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ResourceLimits) GetNlbProvisioned() *int32 { + if o == nil { + return nil + } + + return o.NlbProvisioned + +} + +// GetNlbProvisionedOk returns a tuple with the NlbProvisioned 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 *ResourceLimits) GetNlbProvisionedOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.NlbProvisioned, true +} + +// SetNlbProvisioned sets field value +func (o *ResourceLimits) SetNlbProvisioned(v int32) { + + o.NlbProvisioned = &v + +} + +// HasNlbProvisioned returns a boolean if a field has been set. +func (o *ResourceLimits) HasNlbProvisioned() bool { + if o != nil && o.NlbProvisioned != nil { + return true + } + + return false +} + +// GetNatGatewayLimitTotal returns the NatGatewayLimitTotal field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ResourceLimits) GetNatGatewayLimitTotal() *int32 { + if o == nil { + return nil + } + + return o.NatGatewayLimitTotal + +} + +// GetNatGatewayLimitTotalOk returns a tuple with the NatGatewayLimitTotal 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 *ResourceLimits) GetNatGatewayLimitTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.NatGatewayLimitTotal, true +} + +// SetNatGatewayLimitTotal sets field value +func (o *ResourceLimits) SetNatGatewayLimitTotal(v int32) { + + o.NatGatewayLimitTotal = &v + +} + +// HasNatGatewayLimitTotal returns a boolean if a field has been set. +func (o *ResourceLimits) HasNatGatewayLimitTotal() bool { + if o != nil && o.NatGatewayLimitTotal != nil { + return true + } + + return false +} + +// GetNatGatewayProvisioned returns the NatGatewayProvisioned field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *ResourceLimits) GetNatGatewayProvisioned() *int32 { + if o == nil { + return nil + } + + return o.NatGatewayProvisioned + +} + +// GetNatGatewayProvisionedOk returns a tuple with the NatGatewayProvisioned 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 *ResourceLimits) GetNatGatewayProvisionedOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.NatGatewayProvisioned, true +} + +// SetNatGatewayProvisioned sets field value +func (o *ResourceLimits) SetNatGatewayProvisioned(v int32) { + + o.NatGatewayProvisioned = &v + +} + +// HasNatGatewayProvisioned returns a boolean if a field has been set. +func (o *ResourceLimits) HasNatGatewayProvisioned() bool { + if o != nil && o.NatGatewayProvisioned != nil { + return true + } + + return false +} func (o ResourceLimits) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.CoresPerServer != nil { toSerialize["coresPerServer"] = o.CoresPerServer } - - if o.CoresPerContract != nil { toSerialize["coresPerContract"] = o.CoresPerContract } - - if o.CoresProvisioned != nil { toSerialize["coresProvisioned"] = o.CoresProvisioned } - - if o.RamPerServer != nil { toSerialize["ramPerServer"] = o.RamPerServer } - - if o.RamPerContract != nil { toSerialize["ramPerContract"] = o.RamPerContract } - - if o.RamProvisioned != nil { toSerialize["ramProvisioned"] = o.RamProvisioned } - - if o.HddLimitPerVolume != nil { toSerialize["hddLimitPerVolume"] = o.HddLimitPerVolume } - - if o.HddLimitPerContract != nil { toSerialize["hddLimitPerContract"] = o.HddLimitPerContract } - - if o.HddVolumeProvisioned != nil { toSerialize["hddVolumeProvisioned"] = o.HddVolumeProvisioned } - - if o.SsdLimitPerVolume != nil { toSerialize["ssdLimitPerVolume"] = o.SsdLimitPerVolume } - - if o.SsdLimitPerContract != nil { toSerialize["ssdLimitPerContract"] = o.SsdLimitPerContract } - - if o.SsdVolumeProvisioned != nil { toSerialize["ssdVolumeProvisioned"] = o.SsdVolumeProvisioned } - - + if o.DasVolumeProvisioned != nil { + toSerialize["dasVolumeProvisioned"] = o.DasVolumeProvisioned + } if o.ReservableIps != nil { toSerialize["reservableIps"] = o.ReservableIps } - - if o.ReservedIpsOnContract != nil { toSerialize["reservedIpsOnContract"] = o.ReservedIpsOnContract } - - if o.ReservedIpsInUse != nil { toSerialize["reservedIpsInUse"] = o.ReservedIpsInUse } - - if o.K8sClusterLimitTotal != nil { toSerialize["k8sClusterLimitTotal"] = o.K8sClusterLimitTotal } - - if o.K8sClustersProvisioned != nil { toSerialize["k8sClustersProvisioned"] = o.K8sClustersProvisioned } - + if o.NlbLimitTotal != nil { + toSerialize["nlbLimitTotal"] = o.NlbLimitTotal + } + if o.NlbProvisioned != nil { + toSerialize["nlbProvisioned"] = o.NlbProvisioned + } + if o.NatGatewayLimitTotal != nil { + toSerialize["natGatewayLimitTotal"] = o.NatGatewayLimitTotal + } + if o.NatGatewayProvisioned != nil { + toSerialize["natGatewayProvisioned"] = o.NatGatewayProvisioned + } return json.Marshal(toSerialize) } @@ -790,5 +1045,3 @@ func (v *NullableResourceLimits) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_properties.go index cba2849bceda..b5b274a28eb7 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,29 @@ import ( // ResourceProperties struct for ResourceProperties type ResourceProperties struct { - // name of the resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Boolean value representing if the resource is multi factor protected or not e.g. using two factor protection. Currently only Data Centers and Snapshots are allowed to be multi factor protected, The value of attribute if null is intentional and it means that the resource doesn't support multi factor protection at all. + // Boolean value representing if the resource is multi factor protected or not e.g. using two factor protection. Currently only data centers and snapshots are allowed to be multi factor protected, The value of attribute if null is intentional and it means that the resource doesn't support multi factor protection at all. SecAuthProtection *bool `json:"secAuthProtection,omitempty"` } +// NewResourceProperties instantiates a new ResourceProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceProperties() *ResourceProperties { + this := ResourceProperties{} + return &this +} + +// NewResourcePropertiesWithDefaults instantiates a new ResourceProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePropertiesWithDefaults() *ResourceProperties { + this := ResourceProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +48,7 @@ func (o *ResourceProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -41,12 +58,15 @@ func (o *ResourceProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *ResourceProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -58,8 +78,6 @@ func (o *ResourceProperties) HasName() bool { return false } - - // GetSecAuthProtection returns the SecAuthProtection field value // If the value is explicit nil, the zero value for bool will be returned func (o *ResourceProperties) GetSecAuthProtection() *bool { @@ -68,6 +86,7 @@ func (o *ResourceProperties) GetSecAuthProtection() *bool { } return o.SecAuthProtection + } // GetSecAuthProtectionOk returns a tuple with the SecAuthProtection field value @@ -77,12 +96,15 @@ func (o *ResourceProperties) GetSecAuthProtectionOk() (*bool, bool) { if o == nil { return nil, false } + return o.SecAuthProtection, true } // SetSecAuthProtection sets field value func (o *ResourceProperties) SetSecAuthProtection(v bool) { + o.SecAuthProtection = &v + } // HasSecAuthProtection returns a boolean if a field has been set. @@ -94,19 +116,14 @@ func (o *ResourceProperties) HasSecAuthProtection() bool { return false } - func (o ResourceProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.SecAuthProtection != nil { toSerialize["secAuthProtection"] = o.SecAuthProtection } - return json.Marshal(toSerialize) } @@ -145,5 +162,3 @@ func (v *NullableResourceProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_reference.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_reference.go index 4fec97300a35..5732ab570165 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_reference.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resource_reference.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,15 +16,33 @@ import ( // ResourceReference struct for ResourceReference type ResourceReference struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` } +// NewResourceReference instantiates a new ResourceReference object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceReference(id string) *ResourceReference { + this := ResourceReference{} + this.Id = &id + + return &this +} + +// NewResourceReferenceWithDefaults instantiates a new ResourceReference object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceReferenceWithDefaults() *ResourceReference { + this := ResourceReference{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -34,6 +52,7 @@ func (o *ResourceReference) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -43,12 +62,15 @@ func (o *ResourceReference) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *ResourceReference) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -60,8 +82,6 @@ func (o *ResourceReference) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *ResourceReference) GetType() *Type { @@ -70,6 +90,7 @@ func (o *ResourceReference) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -79,12 +100,15 @@ func (o *ResourceReference) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *ResourceReference) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -96,8 +120,6 @@ func (o *ResourceReference) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *ResourceReference) GetHref() *string { @@ -106,6 +128,7 @@ func (o *ResourceReference) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -115,12 +138,15 @@ func (o *ResourceReference) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *ResourceReference) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -132,24 +158,17 @@ func (o *ResourceReference) HasHref() bool { return false } - func (o ResourceReference) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - return json.Marshal(toSerialize) } @@ -188,5 +207,3 @@ func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources.go index acd1023a18fd..36b8beeabff6 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources.go @@ -1,32 +1,48 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" ) -// Resources Collection to represent the resource +// Resources Collection to represent the resource. type Resources struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Resource `json:"items,omitempty"` } +// NewResources instantiates a new Resources object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResources() *Resources { + this := Resources{} + return &this +} + +// NewResourcesWithDefaults instantiates a new Resources object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcesWithDefaults() *Resources { + this := Resources{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Resources) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Resources) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Resources) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Resources) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Resources) GetType() *Type { @@ -72,6 +90,7 @@ func (o *Resources) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Resources) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Resources) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Resources) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Resources) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Resources) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Resources) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Resources) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Resources) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Resource will be returned func (o *Resources) GetItems() *[]Resource { @@ -144,6 +166,7 @@ func (o *Resources) GetItems() *[]Resource { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Resources) GetItemsOk() (*[]Resource, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Resources) SetItems(v []Resource) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Resources) HasItems() bool { return false } - func (o Resources) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableResources) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources_users.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources_users.go index d03b15884ef7..18de5cf52d40 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources_users.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_resources_users.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // ResourcesUsers Resources owned by a user. type ResourcesUsers struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Resource `json:"items,omitempty"` } +// NewResourcesUsers instantiates a new ResourcesUsers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcesUsers() *ResourcesUsers { + this := ResourcesUsers{} + return &this +} + +// NewResourcesUsersWithDefaults instantiates a new ResourcesUsers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcesUsersWithDefaults() *ResourcesUsers { + this := ResourcesUsers{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *ResourcesUsers) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *ResourcesUsers) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *ResourcesUsers) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *ResourcesUsers) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *ResourcesUsers) GetType() *Type { @@ -72,6 +90,7 @@ func (o *ResourcesUsers) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *ResourcesUsers) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *ResourcesUsers) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *ResourcesUsers) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *ResourcesUsers) GetHref() *string { @@ -108,6 +128,7 @@ func (o *ResourcesUsers) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *ResourcesUsers) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *ResourcesUsers) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *ResourcesUsers) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Resource will be returned func (o *ResourcesUsers) GetItems() *[]Resource { @@ -144,6 +166,7 @@ func (o *ResourcesUsers) GetItems() *[]Resource { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *ResourcesUsers) GetItemsOk() (*[]Resource, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *ResourcesUsers) SetItems(v []Resource) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *ResourcesUsers) HasItems() bool { return false } - func (o ResourcesUsers) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableResourcesUsers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_bucket.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_bucket.go new file mode 100644 index 000000000000..cf175f53861e --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_bucket.go @@ -0,0 +1,123 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// S3Bucket struct for S3Bucket +type S3Bucket struct { + // Name of the S3 bucket + Name *string `json:"name"` +} + +// NewS3Bucket instantiates a new S3Bucket object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3Bucket(name string) *S3Bucket { + this := S3Bucket{} + + this.Name = &name + + return &this +} + +// NewS3BucketWithDefaults instantiates a new S3Bucket object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3BucketWithDefaults() *S3Bucket { + this := S3Bucket{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *S3Bucket) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *S3Bucket) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *S3Bucket) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *S3Bucket) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +func (o S3Bucket) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableS3Bucket struct { + value *S3Bucket + isSet bool +} + +func (v NullableS3Bucket) Get() *S3Bucket { + return v.value +} + +func (v *NullableS3Bucket) Set(val *S3Bucket) { + v.value = val + v.isSet = true +} + +func (v NullableS3Bucket) IsSet() bool { + return v.isSet +} + +func (v *NullableS3Bucket) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableS3Bucket(val *S3Bucket) *NullableS3Bucket { + return &NullableS3Bucket{value: val, isSet: true} +} + +func (v NullableS3Bucket) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableS3Bucket) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key.go index fa8bfa5bcee9..5febf4192a4b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // S3Key struct for S3Key type S3Key struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *S3KeyMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *S3KeyMetadata `json:"metadata,omitempty"` Properties *S3KeyProperties `json:"properties"` } +// NewS3Key instantiates a new S3Key object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3Key(properties S3KeyProperties) *S3Key { + this := S3Key{} + this.Properties = &properties + + return &this +} + +// NewS3KeyWithDefaults instantiates a new S3Key object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3KeyWithDefaults() *S3Key { + this := S3Key{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *S3Key) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *S3Key) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *S3Key) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *S3Key) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *S3Key) GetType() *Type { @@ -72,6 +92,7 @@ func (o *S3Key) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *S3Key) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *S3Key) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *S3Key) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *S3Key) GetHref() *string { @@ -108,6 +130,7 @@ func (o *S3Key) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *S3Key) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *S3Key) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *S3Key) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for S3KeyMetadata will be returned func (o *S3Key) GetMetadata() *S3KeyMetadata { @@ -144,6 +168,7 @@ func (o *S3Key) GetMetadata() *S3KeyMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *S3Key) GetMetadataOk() (*S3KeyMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *S3Key) SetMetadata(v S3KeyMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *S3Key) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for S3KeyProperties will be returned func (o *S3Key) GetProperties() *S3KeyProperties { @@ -180,6 +206,7 @@ func (o *S3Key) GetProperties() *S3KeyProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *S3Key) GetPropertiesOk() (*S3KeyProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *S3Key) SetProperties(v S3KeyProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *S3Key) HasProperties() bool { return false } - func (o S3Key) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableS3Key) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_metadata.go index e4bd9409a2a5..83ecc8b46385 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,13 +17,29 @@ import ( // S3KeyMetadata struct for S3KeyMetadata type S3KeyMetadata struct { - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. Etag *string `json:"etag,omitempty"` - // The time the S3 key was created - CreatedDate *time.Time `json:"createdDate,omitempty"` + // The time when the S3 key was created. + CreatedDate *IonosTime } +// NewS3KeyMetadata instantiates a new S3KeyMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3KeyMetadata() *S3KeyMetadata { + this := S3KeyMetadata{} + return &this +} + +// NewS3KeyMetadataWithDefaults instantiates a new S3KeyMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3KeyMetadataWithDefaults() *S3KeyMetadata { + this := S3KeyMetadata{} + return &this +} // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned @@ -33,6 +49,7 @@ func (o *S3KeyMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -42,12 +59,15 @@ func (o *S3KeyMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *S3KeyMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -59,8 +79,6 @@ func (o *S3KeyMetadata) HasEtag() bool { return false } - - // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *S3KeyMetadata) GetCreatedDate() *time.Time { @@ -68,7 +86,11 @@ func (o *S3KeyMetadata) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -78,12 +100,19 @@ func (o *S3KeyMetadata) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *S3KeyMetadata) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -95,19 +124,14 @@ func (o *S3KeyMetadata) HasCreatedDate() bool { return false } - func (o S3KeyMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - return json.Marshal(toSerialize) } @@ -146,5 +170,3 @@ func (v *NullableS3KeyMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_properties.go index 3bad61c2caa4..a3204d717c36 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_key_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,13 +16,29 @@ import ( // S3KeyProperties struct for S3KeyProperties type S3KeyProperties struct { - // secret of the s3 key + // Secret of the S3 key. SecretKey *string `json:"secretKey,omitempty"` - // denotes if the s3 key is active or not + // Denotes weather the S3 key is active. Active *bool `json:"active,omitempty"` } +// NewS3KeyProperties instantiates a new S3KeyProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3KeyProperties() *S3KeyProperties { + this := S3KeyProperties{} + return &this +} + +// NewS3KeyPropertiesWithDefaults instantiates a new S3KeyProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3KeyPropertiesWithDefaults() *S3KeyProperties { + this := S3KeyProperties{} + return &this +} // GetSecretKey returns the SecretKey field value // If the value is explicit nil, the zero value for string will be returned @@ -32,6 +48,7 @@ func (o *S3KeyProperties) GetSecretKey() *string { } return o.SecretKey + } // GetSecretKeyOk returns a tuple with the SecretKey field value @@ -41,12 +58,15 @@ func (o *S3KeyProperties) GetSecretKeyOk() (*string, bool) { if o == nil { return nil, false } + return o.SecretKey, true } // SetSecretKey sets field value func (o *S3KeyProperties) SetSecretKey(v string) { + o.SecretKey = &v + } // HasSecretKey returns a boolean if a field has been set. @@ -58,8 +78,6 @@ func (o *S3KeyProperties) HasSecretKey() bool { return false } - - // GetActive returns the Active field value // If the value is explicit nil, the zero value for bool will be returned func (o *S3KeyProperties) GetActive() *bool { @@ -68,6 +86,7 @@ func (o *S3KeyProperties) GetActive() *bool { } return o.Active + } // GetActiveOk returns a tuple with the Active field value @@ -77,12 +96,15 @@ func (o *S3KeyProperties) GetActiveOk() (*bool, bool) { if o == nil { return nil, false } + return o.Active, true } // SetActive sets field value func (o *S3KeyProperties) SetActive(v bool) { + o.Active = &v + } // HasActive returns a boolean if a field has been set. @@ -94,19 +116,14 @@ func (o *S3KeyProperties) HasActive() bool { return false } - func (o S3KeyProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SecretKey != nil { toSerialize["secretKey"] = o.SecretKey } - - if o.Active != nil { toSerialize["active"] = o.Active } - return json.Marshal(toSerialize) } @@ -145,5 +162,3 @@ func (v *NullableS3KeyProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_keys.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_keys.go index 7de532659647..a87bc2f76acb 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_keys.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_keys.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // S3Keys struct for S3Keys type S3Keys struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of the resource + // The type of the resource. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]S3Key `json:"items,omitempty"` } +// NewS3Keys instantiates a new S3Keys object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3Keys() *S3Keys { + this := S3Keys{} + return &this +} + +// NewS3KeysWithDefaults instantiates a new S3Keys object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3KeysWithDefaults() *S3Keys { + this := S3Keys{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *S3Keys) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *S3Keys) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *S3Keys) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *S3Keys) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *S3Keys) GetType() *Type { @@ -72,6 +90,7 @@ func (o *S3Keys) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *S3Keys) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *S3Keys) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *S3Keys) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *S3Keys) GetHref() *string { @@ -108,6 +128,7 @@ func (o *S3Keys) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *S3Keys) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *S3Keys) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *S3Keys) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []S3Key will be returned func (o *S3Keys) GetItems() *[]S3Key { @@ -144,6 +166,7 @@ func (o *S3Keys) GetItems() *[]S3Key { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *S3Keys) GetItemsOk() (*[]S3Key, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *S3Keys) SetItems(v []S3Key) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *S3Keys) HasItems() bool { return false } - func (o S3Keys) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableS3Keys) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_object_storage_sso.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_object_storage_sso.go index 3139ecc7ebec..48eb4b166cbb 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_object_storage_sso.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_s3_object_storage_sso.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -20,7 +20,23 @@ type S3ObjectStorageSSO struct { SsoUrl *string `json:"ssoUrl,omitempty"` } +// NewS3ObjectStorageSSO instantiates a new S3ObjectStorageSSO object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3ObjectStorageSSO() *S3ObjectStorageSSO { + this := S3ObjectStorageSSO{} + return &this +} + +// NewS3ObjectStorageSSOWithDefaults instantiates a new S3ObjectStorageSSO object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3ObjectStorageSSOWithDefaults() *S3ObjectStorageSSO { + this := S3ObjectStorageSSO{} + return &this +} // GetSsoUrl returns the SsoUrl field value // If the value is explicit nil, the zero value for string will be returned @@ -30,6 +46,7 @@ func (o *S3ObjectStorageSSO) GetSsoUrl() *string { } return o.SsoUrl + } // GetSsoUrlOk returns a tuple with the SsoUrl field value @@ -39,12 +56,15 @@ func (o *S3ObjectStorageSSO) GetSsoUrlOk() (*string, bool) { if o == nil { return nil, false } + return o.SsoUrl, true } // SetSsoUrl sets field value func (o *S3ObjectStorageSSO) SetSsoUrl(v string) { + o.SsoUrl = &v + } // HasSsoUrl returns a boolean if a field has been set. @@ -56,14 +76,11 @@ func (o *S3ObjectStorageSSO) HasSsoUrl() bool { return false } - func (o S3ObjectStorageSSO) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SsoUrl != nil { toSerialize["ssoUrl"] = o.SsoUrl } - return json.Marshal(toSerialize) } @@ -102,5 +119,3 @@ func (v *NullableS3ObjectStorageSSO) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server.go index 2373a6219ca7..ad75b98a1650 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // Server struct for Server type Server struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *ServerProperties `json:"properties"` - Entities *ServerEntities `json:"entities,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *ServerProperties `json:"properties"` + Entities *ServerEntities `json:"entities,omitempty"` } +// NewServer instantiates a new Server object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServer(properties ServerProperties) *Server { + this := Server{} + this.Properties = &properties + + return &this +} + +// NewServerWithDefaults instantiates a new Server object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerWithDefaults() *Server { + this := Server{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *Server) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *Server) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Server) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *Server) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Server) GetType() *Type { @@ -73,6 +93,7 @@ func (o *Server) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *Server) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Server) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *Server) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Server) GetHref() *string { @@ -109,6 +131,7 @@ func (o *Server) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *Server) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Server) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *Server) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Server) GetMetadata() *DatacenterElementMetadata { @@ -145,6 +169,7 @@ func (o *Server) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *Server) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Server) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *Server) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for ServerProperties will be returned func (o *Server) GetProperties() *ServerProperties { @@ -181,6 +207,7 @@ func (o *Server) GetProperties() *ServerProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *Server) GetPropertiesOk() (*ServerProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Server) SetProperties(v ServerProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *Server) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for ServerEntities will be returned func (o *Server) GetEntities() *ServerEntities { @@ -217,6 +245,7 @@ func (o *Server) GetEntities() *ServerEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *Server) GetEntitiesOk() (*ServerEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *Server) SetEntities(v ServerEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *Server) HasEntities() bool { return false } - func (o Server) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableServer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_entities.go index 7fc54192c30c..fcb42fdb285a 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,12 +16,28 @@ import ( // ServerEntities struct for ServerEntities type ServerEntities struct { - Cdroms *Cdroms `json:"cdroms,omitempty"` + Cdroms *Cdroms `json:"cdroms,omitempty"` Volumes *AttachedVolumes `json:"volumes,omitempty"` - Nics *Nics `json:"nics,omitempty"` + Nics *Nics `json:"nics,omitempty"` } +// NewServerEntities instantiates a new ServerEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerEntities() *ServerEntities { + this := ServerEntities{} + return &this +} + +// NewServerEntitiesWithDefaults instantiates a new ServerEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerEntitiesWithDefaults() *ServerEntities { + this := ServerEntities{} + return &this +} // GetCdroms returns the Cdroms field value // If the value is explicit nil, the zero value for Cdroms will be returned @@ -31,6 +47,7 @@ func (o *ServerEntities) GetCdroms() *Cdroms { } return o.Cdroms + } // GetCdromsOk returns a tuple with the Cdroms field value @@ -40,12 +57,15 @@ func (o *ServerEntities) GetCdromsOk() (*Cdroms, bool) { if o == nil { return nil, false } + return o.Cdroms, true } // SetCdroms sets field value func (o *ServerEntities) SetCdroms(v Cdroms) { + o.Cdroms = &v + } // HasCdroms returns a boolean if a field has been set. @@ -57,8 +77,6 @@ func (o *ServerEntities) HasCdroms() bool { return false } - - // GetVolumes returns the Volumes field value // If the value is explicit nil, the zero value for AttachedVolumes will be returned func (o *ServerEntities) GetVolumes() *AttachedVolumes { @@ -67,6 +85,7 @@ func (o *ServerEntities) GetVolumes() *AttachedVolumes { } return o.Volumes + } // GetVolumesOk returns a tuple with the Volumes field value @@ -76,12 +95,15 @@ func (o *ServerEntities) GetVolumesOk() (*AttachedVolumes, bool) { if o == nil { return nil, false } + return o.Volumes, true } // SetVolumes sets field value func (o *ServerEntities) SetVolumes(v AttachedVolumes) { + o.Volumes = &v + } // HasVolumes returns a boolean if a field has been set. @@ -93,8 +115,6 @@ func (o *ServerEntities) HasVolumes() bool { return false } - - // GetNics returns the Nics field value // If the value is explicit nil, the zero value for Nics will be returned func (o *ServerEntities) GetNics() *Nics { @@ -103,6 +123,7 @@ func (o *ServerEntities) GetNics() *Nics { } return o.Nics + } // GetNicsOk returns a tuple with the Nics field value @@ -112,12 +133,15 @@ func (o *ServerEntities) GetNicsOk() (*Nics, bool) { if o == nil { return nil, false } + return o.Nics, true } // SetNics sets field value func (o *ServerEntities) SetNics(v Nics) { + o.Nics = &v + } // HasNics returns a boolean if a field has been set. @@ -129,24 +153,17 @@ func (o *ServerEntities) HasNics() bool { return false } - func (o ServerEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Cdroms != nil { toSerialize["cdroms"] = o.Cdroms } - - if o.Volumes != nil { toSerialize["volumes"] = o.Volumes } - - if o.Nics != nil { toSerialize["nics"] = o.Nics } - return json.Marshal(toSerialize) } @@ -185,5 +202,3 @@ func (v *NullableServerEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_properties.go index e24d6ea68eae..eb67dfcc5960 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_server_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,23 +16,84 @@ import ( // ServerProperties struct for ServerProperties type ServerProperties struct { - // A name of that resource + // The ID of the template for creating a CUBE server; the available templates for CUBE servers can be found on the templates resource. + TemplateUuid *string `json:"templateUuid,omitempty"` + // The name of the resource. Name *string `json:"name,omitempty"` - // The total number of cores for the server + // The total number of cores for the server. Cores *int32 `json:"cores"` - // The amount of memory for the server in MB, e.g. 2048. Size must be specified in multiples of 256 MB with a minimum of 256 MB; however, if you set ramHotPlug to TRUE then you must use a minimum of 1024 MB. If you set the RAM size more than 240GB, then ramHotPlug will be set to FALSE and can not be set to TRUE unless RAM size not set to less than 240GB. + // The memory size for the server in MB, such as 2048. Size must be specified in multiples of 256 MB with a minimum of 256 MB; however, if you set ramHotPlug to TRUE then you must use a minimum of 1024 MB. If you set the RAM size more than 240GB, then ramHotPlug will be set to FALSE and can not be set to TRUE unless RAM size not set to less than 240GB. Ram *int32 `json:"ram"` - // The availability zone in which the server should exist + // The availability zone in which the server should be provisioned. AvailabilityZone *string `json:"availabilityZone,omitempty"` - // Status of the virtual Machine - VmState *string `json:"vmState,omitempty"` - BootCdrom *ResourceReference `json:"bootCdrom,omitempty"` + // Status of the virtual machine. + VmState *string `json:"vmState,omitempty"` + BootCdrom *ResourceReference `json:"bootCdrom,omitempty"` BootVolume *ResourceReference `json:"bootVolume,omitempty"` - // Cpu family of pserver + // CPU architecture on which server gets provisioned; not all CPU architectures are available in all datacenter regions; available CPU architectures can be retrieved from the datacenter resource. CpuFamily *string `json:"cpuFamily,omitempty"` + // server usages: ENTERPRISE or CUBE + Type *string `json:"type,omitempty"` } +// NewServerProperties instantiates a new ServerProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerProperties(cores int32, ram int32) *ServerProperties { + this := ServerProperties{} + this.Cores = &cores + this.Ram = &ram + + return &this +} + +// NewServerPropertiesWithDefaults instantiates a new ServerProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerPropertiesWithDefaults() *ServerProperties { + this := ServerProperties{} + return &this +} + +// GetTemplateUuid returns the TemplateUuid field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ServerProperties) GetTemplateUuid() *string { + if o == nil { + return nil + } + + return o.TemplateUuid + +} + +// GetTemplateUuidOk returns a tuple with the TemplateUuid 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 *ServerProperties) GetTemplateUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.TemplateUuid, true +} + +// SetTemplateUuid sets field value +func (o *ServerProperties) SetTemplateUuid(v string) { + + o.TemplateUuid = &v + +} + +// HasTemplateUuid returns a boolean if a field has been set. +func (o *ServerProperties) HasTemplateUuid() bool { + if o != nil && o.TemplateUuid != nil { + return true + } + + return false +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -42,6 +103,7 @@ func (o *ServerProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -51,12 +113,15 @@ func (o *ServerProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *ServerProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -68,8 +133,6 @@ func (o *ServerProperties) HasName() bool { return false } - - // GetCores returns the Cores field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ServerProperties) GetCores() *int32 { @@ -78,6 +141,7 @@ func (o *ServerProperties) GetCores() *int32 { } return o.Cores + } // GetCoresOk returns a tuple with the Cores field value @@ -87,12 +151,15 @@ func (o *ServerProperties) GetCoresOk() (*int32, bool) { if o == nil { return nil, false } + return o.Cores, true } // SetCores sets field value func (o *ServerProperties) SetCores(v int32) { + o.Cores = &v + } // HasCores returns a boolean if a field has been set. @@ -104,8 +171,6 @@ func (o *ServerProperties) HasCores() bool { return false } - - // GetRam returns the Ram field value // If the value is explicit nil, the zero value for int32 will be returned func (o *ServerProperties) GetRam() *int32 { @@ -114,6 +179,7 @@ func (o *ServerProperties) GetRam() *int32 { } return o.Ram + } // GetRamOk returns a tuple with the Ram field value @@ -123,12 +189,15 @@ func (o *ServerProperties) GetRamOk() (*int32, bool) { if o == nil { return nil, false } + return o.Ram, true } // SetRam sets field value func (o *ServerProperties) SetRam(v int32) { + o.Ram = &v + } // HasRam returns a boolean if a field has been set. @@ -140,8 +209,6 @@ func (o *ServerProperties) HasRam() bool { return false } - - // GetAvailabilityZone returns the AvailabilityZone field value // If the value is explicit nil, the zero value for string will be returned func (o *ServerProperties) GetAvailabilityZone() *string { @@ -150,6 +217,7 @@ func (o *ServerProperties) GetAvailabilityZone() *string { } return o.AvailabilityZone + } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value @@ -159,12 +227,15 @@ func (o *ServerProperties) GetAvailabilityZoneOk() (*string, bool) { if o == nil { return nil, false } + return o.AvailabilityZone, true } // SetAvailabilityZone sets field value func (o *ServerProperties) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v + } // HasAvailabilityZone returns a boolean if a field has been set. @@ -176,8 +247,6 @@ func (o *ServerProperties) HasAvailabilityZone() bool { return false } - - // GetVmState returns the VmState field value // If the value is explicit nil, the zero value for string will be returned func (o *ServerProperties) GetVmState() *string { @@ -186,6 +255,7 @@ func (o *ServerProperties) GetVmState() *string { } return o.VmState + } // GetVmStateOk returns a tuple with the VmState field value @@ -195,12 +265,15 @@ func (o *ServerProperties) GetVmStateOk() (*string, bool) { if o == nil { return nil, false } + return o.VmState, true } // SetVmState sets field value func (o *ServerProperties) SetVmState(v string) { + o.VmState = &v + } // HasVmState returns a boolean if a field has been set. @@ -212,8 +285,6 @@ func (o *ServerProperties) HasVmState() bool { return false } - - // GetBootCdrom returns the BootCdrom field value // If the value is explicit nil, the zero value for ResourceReference will be returned func (o *ServerProperties) GetBootCdrom() *ResourceReference { @@ -222,6 +293,7 @@ func (o *ServerProperties) GetBootCdrom() *ResourceReference { } return o.BootCdrom + } // GetBootCdromOk returns a tuple with the BootCdrom field value @@ -231,12 +303,15 @@ func (o *ServerProperties) GetBootCdromOk() (*ResourceReference, bool) { if o == nil { return nil, false } + return o.BootCdrom, true } // SetBootCdrom sets field value func (o *ServerProperties) SetBootCdrom(v ResourceReference) { + o.BootCdrom = &v + } // HasBootCdrom returns a boolean if a field has been set. @@ -248,8 +323,6 @@ func (o *ServerProperties) HasBootCdrom() bool { return false } - - // GetBootVolume returns the BootVolume field value // If the value is explicit nil, the zero value for ResourceReference will be returned func (o *ServerProperties) GetBootVolume() *ResourceReference { @@ -258,6 +331,7 @@ func (o *ServerProperties) GetBootVolume() *ResourceReference { } return o.BootVolume + } // GetBootVolumeOk returns a tuple with the BootVolume field value @@ -267,12 +341,15 @@ func (o *ServerProperties) GetBootVolumeOk() (*ResourceReference, bool) { if o == nil { return nil, false } + return o.BootVolume, true } // SetBootVolume sets field value func (o *ServerProperties) SetBootVolume(v ResourceReference) { + o.BootVolume = &v + } // HasBootVolume returns a boolean if a field has been set. @@ -284,8 +361,6 @@ func (o *ServerProperties) HasBootVolume() bool { return false } - - // GetCpuFamily returns the CpuFamily field value // If the value is explicit nil, the zero value for string will be returned func (o *ServerProperties) GetCpuFamily() *string { @@ -294,6 +369,7 @@ func (o *ServerProperties) GetCpuFamily() *string { } return o.CpuFamily + } // GetCpuFamilyOk returns a tuple with the CpuFamily field value @@ -303,12 +379,15 @@ func (o *ServerProperties) GetCpuFamilyOk() (*string, bool) { if o == nil { return nil, false } + return o.CpuFamily, true } // SetCpuFamily sets field value func (o *ServerProperties) SetCpuFamily(v string) { + o.CpuFamily = &v + } // HasCpuFamily returns a boolean if a field has been set. @@ -320,49 +399,76 @@ func (o *ServerProperties) HasCpuFamily() bool { return false } +// GetType returns the Type field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ServerProperties) GetType() *string { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ServerProperties) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *ServerProperties) SetType(v string) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *ServerProperties) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} func (o ServerProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - + if o.TemplateUuid != nil { + toSerialize["templateUuid"] = o.TemplateUuid + } if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Cores != nil { toSerialize["cores"] = o.Cores } - - if o.Ram != nil { toSerialize["ram"] = o.Ram } - - if o.AvailabilityZone != nil { toSerialize["availabilityZone"] = o.AvailabilityZone } - - if o.VmState != nil { toSerialize["vmState"] = o.VmState } - - if o.BootCdrom != nil { toSerialize["bootCdrom"] = o.BootCdrom } - - if o.BootVolume != nil { toSerialize["bootVolume"] = o.BootVolume } - - if o.CpuFamily != nil { toSerialize["cpuFamily"] = o.CpuFamily } - + if o.Type != nil { + toSerialize["type"] = o.Type + } return json.Marshal(toSerialize) } @@ -401,5 +507,3 @@ func (v *NullableServerProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_servers.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_servers.go index 0d0c3d24c678..86fe0d2deead 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_servers.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_servers.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Servers struct for Servers type Servers struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Server `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewServers instantiates a new Servers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServers() *Servers { + this := Servers{} + return &this +} + +// NewServersWithDefaults instantiates a new Servers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServersWithDefaults() *Servers { + this := Servers{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Servers) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Servers) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Servers) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Servers) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Servers) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Servers) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Servers) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Servers) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Servers) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Servers) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Servers) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Servers) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Servers) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Servers) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Server will be returned func (o *Servers) GetItems() *[]Server { @@ -144,6 +171,7 @@ func (o *Servers) GetItems() *[]Server { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Servers) GetItemsOk() (*[]Server, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Servers) SetItems(v []Server) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Servers) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Servers) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Servers) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Servers) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Servers) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Servers) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Servers) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Servers) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Servers) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Servers) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Servers) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Servers) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Servers) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Servers) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableServers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot.go index 15efa7ea086f..56ebb960da86 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Snapshot struct for Snapshot type Snapshot struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *SnapshotProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *SnapshotProperties `json:"properties"` } +// NewSnapshot instantiates a new Snapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshot(properties SnapshotProperties) *Snapshot { + this := Snapshot{} + this.Properties = &properties + + return &this +} + +// NewSnapshotWithDefaults instantiates a new Snapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotWithDefaults() *Snapshot { + this := Snapshot{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Snapshot) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Snapshot) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Snapshot) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Snapshot) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Snapshot) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Snapshot) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Snapshot) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Snapshot) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Snapshot) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Snapshot) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Snapshot) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Snapshot) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Snapshot) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Snapshot) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Snapshot) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *Snapshot) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Snapshot) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Snapshot) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Snapshot) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for SnapshotProperties will be returned func (o *Snapshot) GetProperties() *SnapshotProperties { @@ -180,6 +206,7 @@ func (o *Snapshot) GetProperties() *SnapshotProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Snapshot) GetPropertiesOk() (*SnapshotProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Snapshot) SetProperties(v SnapshotProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Snapshot) HasProperties() bool { return false } - func (o Snapshot) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot_properties.go index 90f729b9602b..b42dca20cd54 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshot_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,41 +16,57 @@ import ( // SnapshotProperties struct for SnapshotProperties type SnapshotProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Human readable description + // Human-readable description. Description *string `json:"description,omitempty"` - // Location of that image/snapshot. + // Location of that image/snapshot. Location *string `json:"location,omitempty"` - // The size of the image in GB + // The size of the image in GB. Size *float32 `json:"size,omitempty"` - // Boolean value representing if the snapshot requires extra protection e.g. two factor protection + // Boolean value representing if the snapshot requires extra protection, such as two-step verification. SecAuthProtection *bool `json:"secAuthProtection,omitempty"` - // Is capable of CPU hot plug (no reboot required) + // Hot-plug capable CPU (no reboot required). CpuHotPlug *bool `json:"cpuHotPlug,omitempty"` - // Is capable of CPU hot unplug (no reboot required) + // Hot-unplug capable CPU (no reboot required). CpuHotUnplug *bool `json:"cpuHotUnplug,omitempty"` - // Is capable of memory hot plug (no reboot required) + // Hot-plug capable RAM (no reboot required). RamHotPlug *bool `json:"ramHotPlug,omitempty"` - // Is capable of memory hot unplug (no reboot required) + // Hot-unplug capable RAM (no reboot required). RamHotUnplug *bool `json:"ramHotUnplug,omitempty"` - // Is capable of nic hot plug (no reboot required) + // Hot-plug capable NIC (no reboot required). NicHotPlug *bool `json:"nicHotPlug,omitempty"` - // Is capable of nic hot unplug (no reboot required) + // Hot-unplug capable NIC (no reboot required). NicHotUnplug *bool `json:"nicHotUnplug,omitempty"` - // Is capable of Virt-IO drive hot plug (no reboot required) + // Hot-plug capable Virt-IO drive (no reboot required). DiscVirtioHotPlug *bool `json:"discVirtioHotPlug,omitempty"` - // Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines. + // Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs. DiscVirtioHotUnplug *bool `json:"discVirtioHotUnplug,omitempty"` - // Is capable of SCSI drive hot plug (no reboot required) + // Hot-plug capable SCSI drive (no reboot required). DiscScsiHotPlug *bool `json:"discScsiHotPlug,omitempty"` // Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines. DiscScsiHotUnplug *bool `json:"discScsiHotUnplug,omitempty"` - // OS type of this Snapshot + // OS type of this snapshot LicenceType *string `json:"licenceType,omitempty"` } +// NewSnapshotProperties instantiates a new SnapshotProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotProperties() *SnapshotProperties { + this := SnapshotProperties{} + return &this +} + +// NewSnapshotPropertiesWithDefaults instantiates a new SnapshotProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotPropertiesWithDefaults() *SnapshotProperties { + this := SnapshotProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -60,6 +76,7 @@ func (o *SnapshotProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -69,12 +86,15 @@ func (o *SnapshotProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *SnapshotProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -86,8 +106,6 @@ func (o *SnapshotProperties) HasName() bool { return false } - - // GetDescription returns the Description field value // If the value is explicit nil, the zero value for string will be returned func (o *SnapshotProperties) GetDescription() *string { @@ -96,6 +114,7 @@ func (o *SnapshotProperties) GetDescription() *string { } return o.Description + } // GetDescriptionOk returns a tuple with the Description field value @@ -105,12 +124,15 @@ func (o *SnapshotProperties) GetDescriptionOk() (*string, bool) { if o == nil { return nil, false } + return o.Description, true } // SetDescription sets field value func (o *SnapshotProperties) SetDescription(v string) { + o.Description = &v + } // HasDescription returns a boolean if a field has been set. @@ -122,8 +144,6 @@ func (o *SnapshotProperties) HasDescription() bool { return false } - - // GetLocation returns the Location field value // If the value is explicit nil, the zero value for string will be returned func (o *SnapshotProperties) GetLocation() *string { @@ -132,6 +152,7 @@ func (o *SnapshotProperties) GetLocation() *string { } return o.Location + } // GetLocationOk returns a tuple with the Location field value @@ -141,12 +162,15 @@ func (o *SnapshotProperties) GetLocationOk() (*string, bool) { if o == nil { return nil, false } + return o.Location, true } // SetLocation sets field value func (o *SnapshotProperties) SetLocation(v string) { + o.Location = &v + } // HasLocation returns a boolean if a field has been set. @@ -158,8 +182,6 @@ func (o *SnapshotProperties) HasLocation() bool { return false } - - // GetSize returns the Size field value // If the value is explicit nil, the zero value for float32 will be returned func (o *SnapshotProperties) GetSize() *float32 { @@ -168,6 +190,7 @@ func (o *SnapshotProperties) GetSize() *float32 { } return o.Size + } // GetSizeOk returns a tuple with the Size field value @@ -177,12 +200,15 @@ func (o *SnapshotProperties) GetSizeOk() (*float32, bool) { if o == nil { return nil, false } + return o.Size, true } // SetSize sets field value func (o *SnapshotProperties) SetSize(v float32) { + o.Size = &v + } // HasSize returns a boolean if a field has been set. @@ -194,8 +220,6 @@ func (o *SnapshotProperties) HasSize() bool { return false } - - // GetSecAuthProtection returns the SecAuthProtection field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetSecAuthProtection() *bool { @@ -204,6 +228,7 @@ func (o *SnapshotProperties) GetSecAuthProtection() *bool { } return o.SecAuthProtection + } // GetSecAuthProtectionOk returns a tuple with the SecAuthProtection field value @@ -213,12 +238,15 @@ func (o *SnapshotProperties) GetSecAuthProtectionOk() (*bool, bool) { if o == nil { return nil, false } + return o.SecAuthProtection, true } // SetSecAuthProtection sets field value func (o *SnapshotProperties) SetSecAuthProtection(v bool) { + o.SecAuthProtection = &v + } // HasSecAuthProtection returns a boolean if a field has been set. @@ -230,8 +258,6 @@ func (o *SnapshotProperties) HasSecAuthProtection() bool { return false } - - // GetCpuHotPlug returns the CpuHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetCpuHotPlug() *bool { @@ -240,6 +266,7 @@ func (o *SnapshotProperties) GetCpuHotPlug() *bool { } return o.CpuHotPlug + } // GetCpuHotPlugOk returns a tuple with the CpuHotPlug field value @@ -249,12 +276,15 @@ func (o *SnapshotProperties) GetCpuHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.CpuHotPlug, true } // SetCpuHotPlug sets field value func (o *SnapshotProperties) SetCpuHotPlug(v bool) { + o.CpuHotPlug = &v + } // HasCpuHotPlug returns a boolean if a field has been set. @@ -266,8 +296,6 @@ func (o *SnapshotProperties) HasCpuHotPlug() bool { return false } - - // GetCpuHotUnplug returns the CpuHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetCpuHotUnplug() *bool { @@ -276,6 +304,7 @@ func (o *SnapshotProperties) GetCpuHotUnplug() *bool { } return o.CpuHotUnplug + } // GetCpuHotUnplugOk returns a tuple with the CpuHotUnplug field value @@ -285,12 +314,15 @@ func (o *SnapshotProperties) GetCpuHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.CpuHotUnplug, true } // SetCpuHotUnplug sets field value func (o *SnapshotProperties) SetCpuHotUnplug(v bool) { + o.CpuHotUnplug = &v + } // HasCpuHotUnplug returns a boolean if a field has been set. @@ -302,8 +334,6 @@ func (o *SnapshotProperties) HasCpuHotUnplug() bool { return false } - - // GetRamHotPlug returns the RamHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetRamHotPlug() *bool { @@ -312,6 +342,7 @@ func (o *SnapshotProperties) GetRamHotPlug() *bool { } return o.RamHotPlug + } // GetRamHotPlugOk returns a tuple with the RamHotPlug field value @@ -321,12 +352,15 @@ func (o *SnapshotProperties) GetRamHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.RamHotPlug, true } // SetRamHotPlug sets field value func (o *SnapshotProperties) SetRamHotPlug(v bool) { + o.RamHotPlug = &v + } // HasRamHotPlug returns a boolean if a field has been set. @@ -338,8 +372,6 @@ func (o *SnapshotProperties) HasRamHotPlug() bool { return false } - - // GetRamHotUnplug returns the RamHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetRamHotUnplug() *bool { @@ -348,6 +380,7 @@ func (o *SnapshotProperties) GetRamHotUnplug() *bool { } return o.RamHotUnplug + } // GetRamHotUnplugOk returns a tuple with the RamHotUnplug field value @@ -357,12 +390,15 @@ func (o *SnapshotProperties) GetRamHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.RamHotUnplug, true } // SetRamHotUnplug sets field value func (o *SnapshotProperties) SetRamHotUnplug(v bool) { + o.RamHotUnplug = &v + } // HasRamHotUnplug returns a boolean if a field has been set. @@ -374,8 +410,6 @@ func (o *SnapshotProperties) HasRamHotUnplug() bool { return false } - - // GetNicHotPlug returns the NicHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetNicHotPlug() *bool { @@ -384,6 +418,7 @@ func (o *SnapshotProperties) GetNicHotPlug() *bool { } return o.NicHotPlug + } // GetNicHotPlugOk returns a tuple with the NicHotPlug field value @@ -393,12 +428,15 @@ func (o *SnapshotProperties) GetNicHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotPlug, true } // SetNicHotPlug sets field value func (o *SnapshotProperties) SetNicHotPlug(v bool) { + o.NicHotPlug = &v + } // HasNicHotPlug returns a boolean if a field has been set. @@ -410,8 +448,6 @@ func (o *SnapshotProperties) HasNicHotPlug() bool { return false } - - // GetNicHotUnplug returns the NicHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetNicHotUnplug() *bool { @@ -420,6 +456,7 @@ func (o *SnapshotProperties) GetNicHotUnplug() *bool { } return o.NicHotUnplug + } // GetNicHotUnplugOk returns a tuple with the NicHotUnplug field value @@ -429,12 +466,15 @@ func (o *SnapshotProperties) GetNicHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotUnplug, true } // SetNicHotUnplug sets field value func (o *SnapshotProperties) SetNicHotUnplug(v bool) { + o.NicHotUnplug = &v + } // HasNicHotUnplug returns a boolean if a field has been set. @@ -446,8 +486,6 @@ func (o *SnapshotProperties) HasNicHotUnplug() bool { return false } - - // GetDiscVirtioHotPlug returns the DiscVirtioHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetDiscVirtioHotPlug() *bool { @@ -456,6 +494,7 @@ func (o *SnapshotProperties) GetDiscVirtioHotPlug() *bool { } return o.DiscVirtioHotPlug + } // GetDiscVirtioHotPlugOk returns a tuple with the DiscVirtioHotPlug field value @@ -465,12 +504,15 @@ func (o *SnapshotProperties) GetDiscVirtioHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotPlug, true } // SetDiscVirtioHotPlug sets field value func (o *SnapshotProperties) SetDiscVirtioHotPlug(v bool) { + o.DiscVirtioHotPlug = &v + } // HasDiscVirtioHotPlug returns a boolean if a field has been set. @@ -482,8 +524,6 @@ func (o *SnapshotProperties) HasDiscVirtioHotPlug() bool { return false } - - // GetDiscVirtioHotUnplug returns the DiscVirtioHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetDiscVirtioHotUnplug() *bool { @@ -492,6 +532,7 @@ func (o *SnapshotProperties) GetDiscVirtioHotUnplug() *bool { } return o.DiscVirtioHotUnplug + } // GetDiscVirtioHotUnplugOk returns a tuple with the DiscVirtioHotUnplug field value @@ -501,12 +542,15 @@ func (o *SnapshotProperties) GetDiscVirtioHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotUnplug, true } // SetDiscVirtioHotUnplug sets field value func (o *SnapshotProperties) SetDiscVirtioHotUnplug(v bool) { + o.DiscVirtioHotUnplug = &v + } // HasDiscVirtioHotUnplug returns a boolean if a field has been set. @@ -518,8 +562,6 @@ func (o *SnapshotProperties) HasDiscVirtioHotUnplug() bool { return false } - - // GetDiscScsiHotPlug returns the DiscScsiHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetDiscScsiHotPlug() *bool { @@ -528,6 +570,7 @@ func (o *SnapshotProperties) GetDiscScsiHotPlug() *bool { } return o.DiscScsiHotPlug + } // GetDiscScsiHotPlugOk returns a tuple with the DiscScsiHotPlug field value @@ -537,12 +580,15 @@ func (o *SnapshotProperties) GetDiscScsiHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscScsiHotPlug, true } // SetDiscScsiHotPlug sets field value func (o *SnapshotProperties) SetDiscScsiHotPlug(v bool) { + o.DiscScsiHotPlug = &v + } // HasDiscScsiHotPlug returns a boolean if a field has been set. @@ -554,8 +600,6 @@ func (o *SnapshotProperties) HasDiscScsiHotPlug() bool { return false } - - // GetDiscScsiHotUnplug returns the DiscScsiHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *SnapshotProperties) GetDiscScsiHotUnplug() *bool { @@ -564,6 +608,7 @@ func (o *SnapshotProperties) GetDiscScsiHotUnplug() *bool { } return o.DiscScsiHotUnplug + } // GetDiscScsiHotUnplugOk returns a tuple with the DiscScsiHotUnplug field value @@ -573,12 +618,15 @@ func (o *SnapshotProperties) GetDiscScsiHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscScsiHotUnplug, true } // SetDiscScsiHotUnplug sets field value func (o *SnapshotProperties) SetDiscScsiHotUnplug(v bool) { + o.DiscScsiHotUnplug = &v + } // HasDiscScsiHotUnplug returns a boolean if a field has been set. @@ -590,8 +638,6 @@ func (o *SnapshotProperties) HasDiscScsiHotUnplug() bool { return false } - - // GetLicenceType returns the LicenceType field value // If the value is explicit nil, the zero value for string will be returned func (o *SnapshotProperties) GetLicenceType() *string { @@ -600,6 +646,7 @@ func (o *SnapshotProperties) GetLicenceType() *string { } return o.LicenceType + } // GetLicenceTypeOk returns a tuple with the LicenceType field value @@ -609,12 +656,15 @@ func (o *SnapshotProperties) GetLicenceTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.LicenceType, true } // SetLicenceType sets field value func (o *SnapshotProperties) SetLicenceType(v string) { + o.LicenceType = &v + } // HasLicenceType returns a boolean if a field has been set. @@ -626,89 +676,56 @@ func (o *SnapshotProperties) HasLicenceType() bool { return false } - func (o SnapshotProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Description != nil { toSerialize["description"] = o.Description } - - if o.Location != nil { toSerialize["location"] = o.Location } - - if o.Size != nil { toSerialize["size"] = o.Size } - - if o.SecAuthProtection != nil { toSerialize["secAuthProtection"] = o.SecAuthProtection } - - if o.CpuHotPlug != nil { toSerialize["cpuHotPlug"] = o.CpuHotPlug } - - if o.CpuHotUnplug != nil { toSerialize["cpuHotUnplug"] = o.CpuHotUnplug } - - if o.RamHotPlug != nil { toSerialize["ramHotPlug"] = o.RamHotPlug } - - if o.RamHotUnplug != nil { toSerialize["ramHotUnplug"] = o.RamHotUnplug } - - if o.NicHotPlug != nil { toSerialize["nicHotPlug"] = o.NicHotPlug } - - if o.NicHotUnplug != nil { toSerialize["nicHotUnplug"] = o.NicHotUnplug } - - if o.DiscVirtioHotPlug != nil { toSerialize["discVirtioHotPlug"] = o.DiscVirtioHotPlug } - - if o.DiscVirtioHotUnplug != nil { toSerialize["discVirtioHotUnplug"] = o.DiscVirtioHotUnplug } - - if o.DiscScsiHotPlug != nil { toSerialize["discScsiHotPlug"] = o.DiscScsiHotPlug } - - if o.DiscScsiHotUnplug != nil { toSerialize["discScsiHotUnplug"] = o.DiscScsiHotUnplug } - - if o.LicenceType != nil { toSerialize["licenceType"] = o.LicenceType } - return json.Marshal(toSerialize) } @@ -747,5 +764,3 @@ func (v *NullableSnapshotProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshots.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshots.go index e40e5784b124..8578d03ddaa0 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshots.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_snapshots.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,33 @@ import ( // Snapshots struct for Snapshots type Snapshots struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Snapshot `json:"items,omitempty"` } +// NewSnapshots instantiates a new Snapshots object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshots() *Snapshots { + this := Snapshots{} + return &this +} + +// NewSnapshotsWithDefaults instantiates a new Snapshots object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotsWithDefaults() *Snapshots { + this := Snapshots{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +52,7 @@ func (o *Snapshots) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +62,15 @@ func (o *Snapshots) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Snapshots) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +82,6 @@ func (o *Snapshots) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Snapshots) GetType() *Type { @@ -72,6 +90,7 @@ func (o *Snapshots) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +100,15 @@ func (o *Snapshots) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Snapshots) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +120,6 @@ func (o *Snapshots) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Snapshots) GetHref() *string { @@ -108,6 +128,7 @@ func (o *Snapshots) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +138,15 @@ func (o *Snapshots) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Snapshots) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +158,6 @@ func (o *Snapshots) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Snapshot will be returned func (o *Snapshots) GetItems() *[]Snapshot { @@ -144,6 +166,7 @@ func (o *Snapshots) GetItems() *[]Snapshot { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +176,15 @@ func (o *Snapshots) GetItemsOk() (*[]Snapshot, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Snapshots) SetItems(v []Snapshot) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +196,20 @@ func (o *Snapshots) HasItems() bool { return false } - func (o Snapshots) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - return json.Marshal(toSerialize) } @@ -231,5 +248,3 @@ func (v *NullableSnapshots) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_target_port_range.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_target_port_range.go new file mode 100644 index 000000000000..9a1c39ea528f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_target_port_range.go @@ -0,0 +1,164 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// TargetPortRange struct for TargetPortRange +type TargetPortRange struct { + // Target port range start associated with the NAT Gateway rule. + Start *int32 `json:"start,omitempty"` + // Target port range end associated with the NAT Gateway rule. + End *int32 `json:"end,omitempty"` +} + +// NewTargetPortRange instantiates a new TargetPortRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTargetPortRange() *TargetPortRange { + this := TargetPortRange{} + + return &this +} + +// NewTargetPortRangeWithDefaults instantiates a new TargetPortRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTargetPortRangeWithDefaults() *TargetPortRange { + this := TargetPortRange{} + return &this +} + +// GetStart returns the Start field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *TargetPortRange) GetStart() *int32 { + if o == nil { + return nil + } + + return o.Start + +} + +// GetStartOk returns a tuple with the Start 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 *TargetPortRange) GetStartOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Start, true +} + +// SetStart sets field value +func (o *TargetPortRange) SetStart(v int32) { + + o.Start = &v + +} + +// HasStart returns a boolean if a field has been set. +func (o *TargetPortRange) HasStart() bool { + if o != nil && o.Start != nil { + return true + } + + return false +} + +// GetEnd returns the End field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *TargetPortRange) GetEnd() *int32 { + if o == nil { + return nil + } + + return o.End + +} + +// GetEndOk returns a tuple with the End 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 *TargetPortRange) GetEndOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.End, true +} + +// SetEnd sets field value +func (o *TargetPortRange) SetEnd(v int32) { + + o.End = &v + +} + +// HasEnd returns a boolean if a field has been set. +func (o *TargetPortRange) HasEnd() bool { + if o != nil && o.End != nil { + return true + } + + return false +} + +func (o TargetPortRange) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Start != nil { + toSerialize["start"] = o.Start + } + if o.End != nil { + toSerialize["end"] = o.End + } + return json.Marshal(toSerialize) +} + +type NullableTargetPortRange struct { + value *TargetPortRange + isSet bool +} + +func (v NullableTargetPortRange) Get() *TargetPortRange { + return v.value +} + +func (v *NullableTargetPortRange) Set(val *TargetPortRange) { + v.value = val + v.isSet = true +} + +func (v NullableTargetPortRange) IsSet() bool { + return v.isSet +} + +func (v *NullableTargetPortRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTargetPortRange(val *TargetPortRange) *NullableTargetPortRange { + return &NullableTargetPortRange{value: val, isSet: true} +} + +func (v NullableTargetPortRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTargetPortRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template.go new file mode 100644 index 000000000000..709587e91005 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template.go @@ -0,0 +1,293 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Template struct for Template +type Template struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *TemplateProperties `json:"properties"` +} + +// NewTemplate instantiates a new Template object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplate(properties TemplateProperties) *Template { + this := Template{} + + this.Properties = &properties + + return &this +} + +// NewTemplateWithDefaults instantiates a new Template object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplateWithDefaults() *Template { + this := Template{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Template) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Template) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *Template) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *Template) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *Template) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Template) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *Template) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *Template) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Template) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Template) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *Template) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *Template) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned +func (o *Template) GetMetadata() *DatacenterElementMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Template) GetMetadataOk() (*DatacenterElementMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *Template) SetMetadata(v DatacenterElementMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Template) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for TemplateProperties will be returned +func (o *Template) GetProperties() *TemplateProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Template) GetPropertiesOk() (*TemplateProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *Template) SetProperties(v TemplateProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *Template) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o Template) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableTemplate struct { + value *Template + isSet bool +} + +func (v NullableTemplate) Get() *Template { + return v.value +} + +func (v *NullableTemplate) Set(val *Template) { + v.value = val + v.isSet = true +} + +func (v NullableTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplate(val *Template) *NullableTemplate { + return &NullableTemplate{value: val, isSet: true} +} + +func (v NullableTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template_properties.go new file mode 100644 index 000000000000..4784c61023a5 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_template_properties.go @@ -0,0 +1,255 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// TemplateProperties struct for TemplateProperties +type TemplateProperties struct { + // The name of the resource. + Name *string `json:"name"` + // The CPU cores count. + Cores *float32 `json:"cores"` + // The RAM size in MB. + Ram *float32 `json:"ram"` + // The storage size in GB. + StorageSize *float32 `json:"storageSize"` +} + +// NewTemplateProperties instantiates a new TemplateProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplateProperties(name string, cores float32, ram float32, storageSize float32) *TemplateProperties { + this := TemplateProperties{} + + this.Name = &name + this.Cores = &cores + this.Ram = &ram + this.StorageSize = &storageSize + + return &this +} + +// NewTemplatePropertiesWithDefaults instantiates a new TemplateProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplatePropertiesWithDefaults() *TemplateProperties { + this := TemplateProperties{} + return &this +} + +// GetName returns the Name field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TemplateProperties) GetName() *string { + if o == nil { + return nil + } + + return o.Name + +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TemplateProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Name, true +} + +// SetName sets field value +func (o *TemplateProperties) SetName(v string) { + + o.Name = &v + +} + +// HasName returns a boolean if a field has been set. +func (o *TemplateProperties) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// GetCores returns the Cores field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *TemplateProperties) GetCores() *float32 { + if o == nil { + return nil + } + + 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 *TemplateProperties) GetCoresOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Cores, true +} + +// SetCores sets field value +func (o *TemplateProperties) SetCores(v float32) { + + o.Cores = &v + +} + +// HasCores returns a boolean if a field has been set. +func (o *TemplateProperties) HasCores() bool { + if o != nil && o.Cores != nil { + return true + } + + return false +} + +// GetRam returns the Ram field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *TemplateProperties) GetRam() *float32 { + if o == nil { + return nil + } + + 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 *TemplateProperties) GetRamOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Ram, true +} + +// SetRam sets field value +func (o *TemplateProperties) SetRam(v float32) { + + o.Ram = &v + +} + +// HasRam returns a boolean if a field has been set. +func (o *TemplateProperties) HasRam() bool { + if o != nil && o.Ram != nil { + return true + } + + return false +} + +// GetStorageSize returns the StorageSize field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *TemplateProperties) GetStorageSize() *float32 { + if o == nil { + return nil + } + + 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 *TemplateProperties) GetStorageSizeOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.StorageSize, true +} + +// SetStorageSize sets field value +func (o *TemplateProperties) SetStorageSize(v float32) { + + o.StorageSize = &v + +} + +// HasStorageSize returns a boolean if a field has been set. +func (o *TemplateProperties) HasStorageSize() bool { + if o != nil && o.StorageSize != nil { + return true + } + + return false +} + +func (o TemplateProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Cores != nil { + toSerialize["cores"] = o.Cores + } + if o.Ram != nil { + toSerialize["ram"] = o.Ram + } + if o.StorageSize != nil { + toSerialize["storageSize"] = o.StorageSize + } + return json.Marshal(toSerialize) +} + +type NullableTemplateProperties struct { + value *TemplateProperties + isSet bool +} + +func (v NullableTemplateProperties) Get() *TemplateProperties { + return v.value +} + +func (v *NullableTemplateProperties) Set(val *TemplateProperties) { + v.value = val + v.isSet = true +} + +func (v NullableTemplateProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplateProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplateProperties(val *TemplateProperties) *NullableTemplateProperties { + return &NullableTemplateProperties{value: val, isSet: true} +} + +func (v NullableTemplateProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplateProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_templates.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_templates.go new file mode 100644 index 000000000000..d849d16c2323 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_templates.go @@ -0,0 +1,250 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Templates struct for Templates +type Templates struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + // The type of object that has been created. + Type *Type `json:"type,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + // Array of items in the collection. + Items *[]Template `json:"items,omitempty"` +} + +// NewTemplates instantiates a new Templates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTemplates() *Templates { + this := Templates{} + + return &this +} + +// NewTemplatesWithDefaults instantiates a new Templates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTemplatesWithDefaults() *Templates { + this := Templates{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Templates) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Templates) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *Templates) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *Templates) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for Type will be returned +func (o *Templates) GetType() *Type { + if o == nil { + return nil + } + + return o.Type + +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Templates) GetTypeOk() (*Type, bool) { + if o == nil { + return nil, false + } + + return o.Type, true +} + +// SetType sets field value +func (o *Templates) SetType(v Type) { + + o.Type = &v + +} + +// HasType returns a boolean if a field has been set. +func (o *Templates) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Templates) GetHref() *string { + if o == nil { + return nil + } + + return o.Href + +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Templates) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Href, true +} + +// SetHref sets field value +func (o *Templates) SetHref(v string) { + + o.Href = &v + +} + +// HasHref returns a boolean if a field has been set. +func (o *Templates) HasHref() bool { + if o != nil && o.Href != nil { + return true + } + + return false +} + +// GetItems returns the Items field value +// If the value is explicit nil, the zero value for []Template will be returned +func (o *Templates) GetItems() *[]Template { + if o == nil { + return nil + } + + return o.Items + +} + +// GetItemsOk returns a tuple with the Items 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 *Templates) GetItemsOk() (*[]Template, bool) { + if o == nil { + return nil, false + } + + return o.Items, true +} + +// SetItems sets field value +func (o *Templates) SetItems(v []Template) { + + o.Items = &v + +} + +// HasItems returns a boolean if a field has been set. +func (o *Templates) HasItems() bool { + if o != nil && o.Items != nil { + return true + } + + return false +} + +func (o Templates) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Href != nil { + toSerialize["href"] = o.Href + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + return json.Marshal(toSerialize) +} + +type NullableTemplates struct { + value *Templates + isSet bool +} + +func (v NullableTemplates) Get() *Templates { + return v.value +} + +func (v *NullableTemplates) Set(val *Templates) { + v.value = val + v.isSet = true +} + +func (v NullableTemplates) IsSet() bool { + return v.isSet +} + +func (v *NullableTemplates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTemplates(val *Templates) *NullableTemplates { + return &NullableTemplates{value: val, isSet: true} +} + +func (v NullableTemplates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTemplates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_token.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_token.go new file mode 100644 index 000000000000..074e07ad6730 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_token.go @@ -0,0 +1,121 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// Token struct for Token +type Token struct { + // The jwToken for the server. + Token *string `json:"token,omitempty"` +} + +// NewToken instantiates a new Token object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewToken() *Token { + this := Token{} + + return &this +} + +// NewTokenWithDefaults instantiates a new Token object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenWithDefaults() *Token { + this := Token{} + return &this +} + +// GetToken returns the Token field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Token) GetToken() *string { + if o == nil { + return nil + } + + return o.Token + +} + +// GetTokenOk returns a tuple with the Token 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 *Token) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Token, true +} + +// SetToken sets field value +func (o *Token) SetToken(v string) { + + o.Token = &v + +} + +// HasToken returns a boolean if a field has been set. +func (o *Token) HasToken() bool { + if o != nil && o.Token != nil { + return true + } + + return false +} + +func (o Token) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Token != nil { + toSerialize["token"] = o.Token + } + return json.Marshal(toSerialize) +} + +type NullableToken struct { + value *Token + isSet bool +} + +func (v NullableToken) Get() *Token { + return v.value +} + +func (v *NullableToken) Set(val *Token) { + v.value = val + v.isSet = true +} + +func (v NullableToken) IsSet() bool { + return v.isSet +} + +func (v *NullableToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableToken(val *Token) *NullableToken { + return &NullableToken{value: val, isSet: true} +} + +func (v NullableToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_type.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_type.go index d67ee7995c39..486153ff02bf 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_type.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_type.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -20,30 +20,39 @@ type Type string // List of Type const ( - DATACENTER Type = "datacenter" - SERVER Type = "server" - VOLUME Type = "volume" - NIC Type = "nic" - LOADBALANCER Type = "loadbalancer" - LOCATION Type = "location" - FIREWALL_RULE Type = "firewall-rule" - IMAGE Type = "image" - SNAPSHOT Type = "snapshot" - LAN Type = "lan" - IPBLOCK Type = "ipblock" - PCC Type = "pcc" - CONTRACT Type = "contract" - USER Type = "user" - GROUP Type = "group" - COLLECTION Type = "collection" - RESOURCE Type = "resource" - REQUEST Type = "request" - REQUEST_STATUS Type = "request-status" - S3KEY Type = "s3key" - BACKUPUNIT Type = "backupunit" - LABEL Type = "label" - K8S Type = "k8s" - NODEPOOL Type = "nodepool" + DATACENTER Type = "datacenter" + SERVER Type = "server" + VOLUME Type = "volume" + NIC Type = "nic" + LOADBALANCER Type = "loadbalancer" + LOCATION Type = "location" + FIREWALL_RULE Type = "firewall-rule" + FLOW_LOG Type = "flow-log" + IMAGE Type = "image" + SNAPSHOT Type = "snapshot" + LAN Type = "lan" + IPBLOCK Type = "ipblock" + PCC Type = "pcc" + CONTRACT Type = "contract" + USER Type = "user" + GROUP Type = "group" + COLLECTION Type = "collection" + RESOURCE Type = "resource" + REQUEST Type = "request" + REQUEST_STATUS Type = "request-status" + S3KEY Type = "s3key" + BACKUPUNIT Type = "backupunit" + LABEL Type = "label" + K8S Type = "k8s" + NODEPOOL Type = "nodepool" + TEMPLATE Type = "template" + NETWORKLOADBALANCER Type = "networkloadbalancer" + FORWARDING_RULE Type = "forwarding-rule" + NATGATEWAY Type = "natgateway" + NATGATEWAY_RULE Type = "natgateway-rule" + NODE Type = "node" + APPLICATIONLOADBALANCER Type = "applicationloadbalancer" + TARGET_GROUP Type = "target-group" ) func (v *Type) UnmarshalJSON(src []byte) error { @@ -53,7 +62,7 @@ func (v *Type) UnmarshalJSON(src []byte) error { return err } enumTypeValue := Type(value) - for _, existing := range []Type{ "datacenter", "server", "volume", "nic", "loadbalancer", "location", "firewall-rule", "image", "snapshot", "lan", "ipblock", "pcc", "contract", "user", "group", "collection", "resource", "request", "request-status", "s3key", "backupunit", "label", "k8s", "nodepool", } { + for _, existing := range []Type{"datacenter", "server", "volume", "nic", "loadbalancer", "location", "firewall-rule", "flow-log", "image", "snapshot", "lan", "ipblock", "pcc", "contract", "user", "group", "collection", "resource", "request", "request-status", "s3key", "backupunit", "label", "k8s", "nodepool", "template", "networkloadbalancer", "forwarding-rule", "natgateway", "natgateway-rule", "node", "applicationloadbalancer", "target-group"} { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -103,4 +112,3 @@ func (v *NullableType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user.go index b4b195472d90..14864be690f8 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,18 +16,36 @@ import ( // User struct for User type User struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *UserMetadata `json:"metadata,omitempty"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *UserMetadata `json:"metadata,omitempty"` Properties *UserProperties `json:"properties"` - Entities *UsersEntities `json:"entities,omitempty"` + Entities *UsersEntities `json:"entities,omitempty"` } +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser(properties UserProperties) *User { + this := User{} + this.Properties = &properties + + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -37,6 +55,7 @@ func (o *User) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -46,12 +65,15 @@ func (o *User) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *User) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -63,8 +85,6 @@ func (o *User) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *User) GetType() *Type { @@ -73,6 +93,7 @@ func (o *User) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -82,12 +103,15 @@ func (o *User) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *User) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -99,8 +123,6 @@ func (o *User) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *User) GetHref() *string { @@ -109,6 +131,7 @@ func (o *User) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -118,12 +141,15 @@ func (o *User) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *User) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -135,8 +161,6 @@ func (o *User) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for UserMetadata will be returned func (o *User) GetMetadata() *UserMetadata { @@ -145,6 +169,7 @@ func (o *User) GetMetadata() *UserMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -154,12 +179,15 @@ func (o *User) GetMetadataOk() (*UserMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *User) SetMetadata(v UserMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -171,8 +199,6 @@ func (o *User) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for UserProperties will be returned func (o *User) GetProperties() *UserProperties { @@ -181,6 +207,7 @@ func (o *User) GetProperties() *UserProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -190,12 +217,15 @@ func (o *User) GetPropertiesOk() (*UserProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *User) SetProperties(v UserProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -207,8 +237,6 @@ func (o *User) HasProperties() bool { return false } - - // GetEntities returns the Entities field value // If the value is explicit nil, the zero value for UsersEntities will be returned func (o *User) GetEntities() *UsersEntities { @@ -217,6 +245,7 @@ func (o *User) GetEntities() *UsersEntities { } return o.Entities + } // GetEntitiesOk returns a tuple with the Entities field value @@ -226,12 +255,15 @@ func (o *User) GetEntitiesOk() (*UsersEntities, bool) { if o == nil { return nil, false } + return o.Entities, true } // SetEntities sets field value func (o *User) SetEntities(v UsersEntities) { + o.Entities = &v + } // HasEntities returns a boolean if a field has been set. @@ -243,39 +275,26 @@ func (o *User) HasEntities() bool { return false } - func (o User) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - - if o.Entities != nil { toSerialize["entities"] = o.Entities } - return json.Marshal(toSerialize) } @@ -314,5 +333,3 @@ func (v *NullableUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_metadata.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_metadata.go index 1cbb8e590718..da90dc00b891 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_metadata.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_metadata.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -17,15 +17,31 @@ import ( // UserMetadata struct for UserMetadata type UserMetadata struct { - // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 . Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. + // Resource's Entity Tag as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter. Etag *string `json:"etag,omitempty"` - // time of creation of the user - CreatedDate *time.Time `json:"createdDate,omitempty"` - // time of last login by the user - LastLogin *time.Time `json:"lastLogin,omitempty"` + // The time the user was created. + CreatedDate *IonosTime + // The time of the last login by the user. + LastLogin *IonosTime } +// NewUserMetadata instantiates a new UserMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserMetadata() *UserMetadata { + this := UserMetadata{} + return &this +} + +// NewUserMetadataWithDefaults instantiates a new UserMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserMetadataWithDefaults() *UserMetadata { + this := UserMetadata{} + return &this +} // GetEtag returns the Etag field value // If the value is explicit nil, the zero value for string will be returned @@ -35,6 +51,7 @@ func (o *UserMetadata) GetEtag() *string { } return o.Etag + } // GetEtagOk returns a tuple with the Etag field value @@ -44,12 +61,15 @@ func (o *UserMetadata) GetEtagOk() (*string, bool) { if o == nil { return nil, false } + return o.Etag, true } // SetEtag sets field value func (o *UserMetadata) SetEtag(v string) { + o.Etag = &v + } // HasEtag returns a boolean if a field has been set. @@ -61,8 +81,6 @@ func (o *UserMetadata) HasEtag() bool { return false } - - // GetCreatedDate returns the CreatedDate field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *UserMetadata) GetCreatedDate() *time.Time { @@ -70,7 +88,11 @@ func (o *UserMetadata) GetCreatedDate() *time.Time { return nil } - return o.CreatedDate + if o.CreatedDate == nil { + return nil + } + return &o.CreatedDate.Time + } // GetCreatedDateOk returns a tuple with the CreatedDate field value @@ -80,12 +102,19 @@ func (o *UserMetadata) GetCreatedDateOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.CreatedDate, true + + if o.CreatedDate == nil { + return nil, false + } + return &o.CreatedDate.Time, true + } // SetCreatedDate sets field value func (o *UserMetadata) SetCreatedDate(v time.Time) { - o.CreatedDate = &v + + o.CreatedDate = &IonosTime{v} + } // HasCreatedDate returns a boolean if a field has been set. @@ -97,8 +126,6 @@ func (o *UserMetadata) HasCreatedDate() bool { return false } - - // GetLastLogin returns the LastLogin field value // If the value is explicit nil, the zero value for time.Time will be returned func (o *UserMetadata) GetLastLogin() *time.Time { @@ -106,7 +133,11 @@ func (o *UserMetadata) GetLastLogin() *time.Time { return nil } - return o.LastLogin + if o.LastLogin == nil { + return nil + } + return &o.LastLogin.Time + } // GetLastLoginOk returns a tuple with the LastLogin field value @@ -116,12 +147,19 @@ func (o *UserMetadata) GetLastLoginOk() (*time.Time, bool) { if o == nil { return nil, false } - return o.LastLogin, true + + if o.LastLogin == nil { + return nil, false + } + return &o.LastLogin.Time, true + } // SetLastLogin sets field value func (o *UserMetadata) SetLastLogin(v time.Time) { - o.LastLogin = &v + + o.LastLogin = &IonosTime{v} + } // HasLastLogin returns a boolean if a field has been set. @@ -133,24 +171,17 @@ func (o *UserMetadata) HasLastLogin() bool { return false } - func (o UserMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Etag != nil { toSerialize["etag"] = o.Etag } - - if o.CreatedDate != nil { toSerialize["createdDate"] = o.CreatedDate } - - if o.LastLogin != nil { toSerialize["lastLogin"] = o.LastLogin } - return json.Marshal(toSerialize) } @@ -189,5 +220,3 @@ func (v *NullableUserMetadata) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_post.go new file mode 100644 index 000000000000..912dc3391990 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_post.go @@ -0,0 +1,122 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserPost struct for UserPost +type UserPost struct { + Properties *UserPropertiesPost `json:"properties"` +} + +// NewUserPost instantiates a new UserPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPost(properties UserPropertiesPost) *UserPost { + this := UserPost{} + + this.Properties = &properties + + return &this +} + +// NewUserPostWithDefaults instantiates a new UserPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPostWithDefaults() *UserPost { + this := UserPost{} + return &this +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for UserPropertiesPost will be returned +func (o *UserPost) GetProperties() *UserPropertiesPost { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserPost) GetPropertiesOk() (*UserPropertiesPost, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *UserPost) SetProperties(v UserPropertiesPost) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *UserPost) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o UserPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableUserPost struct { + value *UserPost + isSet bool +} + +func (v NullableUserPost) Get() *UserPost { + return v.value +} + +func (v *NullableUserPost) Set(val *UserPost) { + v.value = val + v.isSet = true +} + +func (v NullableUserPost) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPost(val *UserPost) *NullableUserPost { + return &NullableUserPost{value: val, isSet: true} +} + +func (v NullableUserPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties.go index 5bd16244081d..6ff0ff0f00ca 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,25 +16,41 @@ import ( // UserProperties struct for UserProperties type UserProperties struct { - // first name of the user + // The first name of the user. Firstname *string `json:"firstname,omitempty"` - // last name of the user + // The last name of the user. Lastname *string `json:"lastname,omitempty"` - // email address of the user + // The email address of the user. Email *string `json:"email,omitempty"` - // indicates if the user has admin rights or not + // Indicates if the user has admin rights. Administrator *bool `json:"administrator,omitempty"` - // indicates if secure authentication should be forced on the user or not + // Indicates if secure authentication should be forced on the user. ForceSecAuth *bool `json:"forceSecAuth,omitempty"` - // indicates if secure authentication is active for the user or not + // Indicates if secure authentication is active for the user. SecAuthActive *bool `json:"secAuthActive,omitempty"` - // Canonical (S3) id of the user for a given identity + // Canonical (S3) ID of the user for a given identity. S3CanonicalUserId *string `json:"s3CanonicalUserId,omitempty"` - // User password - Password *string `json:"password,omitempty"` + // Indicates if the user is active. + Active *bool `json:"active,omitempty"` } +// NewUserProperties instantiates a new UserProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserProperties() *UserProperties { + this := UserProperties{} + return &this +} + +// NewUserPropertiesWithDefaults instantiates a new UserProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPropertiesWithDefaults() *UserProperties { + this := UserProperties{} + return &this +} // GetFirstname returns the Firstname field value // If the value is explicit nil, the zero value for string will be returned @@ -44,6 +60,7 @@ func (o *UserProperties) GetFirstname() *string { } return o.Firstname + } // GetFirstnameOk returns a tuple with the Firstname field value @@ -53,12 +70,15 @@ func (o *UserProperties) GetFirstnameOk() (*string, bool) { if o == nil { return nil, false } + return o.Firstname, true } // SetFirstname sets field value func (o *UserProperties) SetFirstname(v string) { + o.Firstname = &v + } // HasFirstname returns a boolean if a field has been set. @@ -70,8 +90,6 @@ func (o *UserProperties) HasFirstname() bool { return false } - - // GetLastname returns the Lastname field value // If the value is explicit nil, the zero value for string will be returned func (o *UserProperties) GetLastname() *string { @@ -80,6 +98,7 @@ func (o *UserProperties) GetLastname() *string { } return o.Lastname + } // GetLastnameOk returns a tuple with the Lastname field value @@ -89,12 +108,15 @@ func (o *UserProperties) GetLastnameOk() (*string, bool) { if o == nil { return nil, false } + return o.Lastname, true } // SetLastname sets field value func (o *UserProperties) SetLastname(v string) { + o.Lastname = &v + } // HasLastname returns a boolean if a field has been set. @@ -106,8 +128,6 @@ func (o *UserProperties) HasLastname() bool { return false } - - // GetEmail returns the Email field value // If the value is explicit nil, the zero value for string will be returned func (o *UserProperties) GetEmail() *string { @@ -116,6 +136,7 @@ func (o *UserProperties) GetEmail() *string { } return o.Email + } // GetEmailOk returns a tuple with the Email field value @@ -125,12 +146,15 @@ func (o *UserProperties) GetEmailOk() (*string, bool) { if o == nil { return nil, false } + return o.Email, true } // SetEmail sets field value func (o *UserProperties) SetEmail(v string) { + o.Email = &v + } // HasEmail returns a boolean if a field has been set. @@ -142,8 +166,6 @@ func (o *UserProperties) HasEmail() bool { return false } - - // GetAdministrator returns the Administrator field value // If the value is explicit nil, the zero value for bool will be returned func (o *UserProperties) GetAdministrator() *bool { @@ -152,6 +174,7 @@ func (o *UserProperties) GetAdministrator() *bool { } return o.Administrator + } // GetAdministratorOk returns a tuple with the Administrator field value @@ -161,12 +184,15 @@ func (o *UserProperties) GetAdministratorOk() (*bool, bool) { if o == nil { return nil, false } + return o.Administrator, true } // SetAdministrator sets field value func (o *UserProperties) SetAdministrator(v bool) { + o.Administrator = &v + } // HasAdministrator returns a boolean if a field has been set. @@ -178,8 +204,6 @@ func (o *UserProperties) HasAdministrator() bool { return false } - - // GetForceSecAuth returns the ForceSecAuth field value // If the value is explicit nil, the zero value for bool will be returned func (o *UserProperties) GetForceSecAuth() *bool { @@ -188,6 +212,7 @@ func (o *UserProperties) GetForceSecAuth() *bool { } return o.ForceSecAuth + } // GetForceSecAuthOk returns a tuple with the ForceSecAuth field value @@ -197,12 +222,15 @@ func (o *UserProperties) GetForceSecAuthOk() (*bool, bool) { if o == nil { return nil, false } + return o.ForceSecAuth, true } // SetForceSecAuth sets field value func (o *UserProperties) SetForceSecAuth(v bool) { + o.ForceSecAuth = &v + } // HasForceSecAuth returns a boolean if a field has been set. @@ -214,8 +242,6 @@ func (o *UserProperties) HasForceSecAuth() bool { return false } - - // GetSecAuthActive returns the SecAuthActive field value // If the value is explicit nil, the zero value for bool will be returned func (o *UserProperties) GetSecAuthActive() *bool { @@ -224,6 +250,7 @@ func (o *UserProperties) GetSecAuthActive() *bool { } return o.SecAuthActive + } // GetSecAuthActiveOk returns a tuple with the SecAuthActive field value @@ -233,12 +260,15 @@ func (o *UserProperties) GetSecAuthActiveOk() (*bool, bool) { if o == nil { return nil, false } + return o.SecAuthActive, true } // SetSecAuthActive sets field value func (o *UserProperties) SetSecAuthActive(v bool) { + o.SecAuthActive = &v + } // HasSecAuthActive returns a boolean if a field has been set. @@ -250,8 +280,6 @@ func (o *UserProperties) HasSecAuthActive() bool { return false } - - // GetS3CanonicalUserId returns the S3CanonicalUserId field value // If the value is explicit nil, the zero value for string will be returned func (o *UserProperties) GetS3CanonicalUserId() *string { @@ -260,6 +288,7 @@ func (o *UserProperties) GetS3CanonicalUserId() *string { } return o.S3CanonicalUserId + } // GetS3CanonicalUserIdOk returns a tuple with the S3CanonicalUserId field value @@ -269,12 +298,15 @@ func (o *UserProperties) GetS3CanonicalUserIdOk() (*string, bool) { if o == nil { return nil, false } + return o.S3CanonicalUserId, true } // SetS3CanonicalUserId sets field value func (o *UserProperties) SetS3CanonicalUserId(v string) { + o.S3CanonicalUserId = &v + } // HasS3CanonicalUserId returns a boolean if a field has been set. @@ -286,85 +318,70 @@ func (o *UserProperties) HasS3CanonicalUserId() bool { return false } - - -// GetPassword returns the Password field value -// If the value is explicit nil, the zero value for string will be returned -func (o *UserProperties) GetPassword() *string { +// GetActive returns the Active field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserProperties) GetActive() *bool { if o == nil { return nil } - return o.Password + return o.Active + } -// GetPasswordOk returns a tuple with the Password field value +// GetActiveOk returns a tuple with the Active 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 *UserProperties) GetPasswordOk() (*string, bool) { +func (o *UserProperties) GetActiveOk() (*bool, bool) { if o == nil { return nil, false } - return o.Password, true + + return o.Active, true } -// SetPassword sets field value -func (o *UserProperties) SetPassword(v string) { - o.Password = &v +// SetActive sets field value +func (o *UserProperties) SetActive(v bool) { + + o.Active = &v + } -// HasPassword returns a boolean if a field has been set. -func (o *UserProperties) HasPassword() bool { - if o != nil && o.Password != nil { +// HasActive returns a boolean if a field has been set. +func (o *UserProperties) HasActive() bool { + if o != nil && o.Active != nil { return true } return false } - func (o UserProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Firstname != nil { toSerialize["firstname"] = o.Firstname } - - if o.Lastname != nil { toSerialize["lastname"] = o.Lastname } - - if o.Email != nil { toSerialize["email"] = o.Email } - - if o.Administrator != nil { toSerialize["administrator"] = o.Administrator } - - if o.ForceSecAuth != nil { toSerialize["forceSecAuth"] = o.ForceSecAuth } - - if o.SecAuthActive != nil { toSerialize["secAuthActive"] = o.SecAuthActive } - - if o.S3CanonicalUserId != nil { toSerialize["s3CanonicalUserId"] = o.S3CanonicalUserId } - - - if o.Password != nil { - toSerialize["password"] = o.Password + if o.Active != nil { + toSerialize["active"] = o.Active } - return json.Marshal(toSerialize) } @@ -403,5 +420,3 @@ func (v *NullableUserProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_post.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_post.go new file mode 100644 index 000000000000..463eb6dc3a36 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_post.go @@ -0,0 +1,422 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserPropertiesPost struct for UserPropertiesPost +type UserPropertiesPost struct { + // The first name of the user. + Firstname *string `json:"firstname,omitempty"` + // The last name of the user. + Lastname *string `json:"lastname,omitempty"` + // The email address of the user. + Email *string `json:"email,omitempty"` + // Indicates if the user has admin rights. + Administrator *bool `json:"administrator,omitempty"` + // Indicates if secure authentication should be forced on the user. + ForceSecAuth *bool `json:"forceSecAuth,omitempty"` + // Indicates if secure authentication is active for the user. + SecAuthActive *bool `json:"secAuthActive,omitempty"` + // User password. + Password *string `json:"password,omitempty"` + // Indicates if the user is active. + Active *bool `json:"active,omitempty"` +} + +// NewUserPropertiesPost instantiates a new UserPropertiesPost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPropertiesPost() *UserPropertiesPost { + this := UserPropertiesPost{} + + return &this +} + +// NewUserPropertiesPostWithDefaults instantiates a new UserPropertiesPost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPropertiesPostWithDefaults() *UserPropertiesPost { + this := UserPropertiesPost{} + return &this +} + +// GetFirstname returns the Firstname field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPost) GetFirstname() *string { + if o == nil { + return nil + } + + return o.Firstname + +} + +// GetFirstnameOk returns a tuple with the Firstname 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 *UserPropertiesPost) GetFirstnameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Firstname, true +} + +// SetFirstname sets field value +func (o *UserPropertiesPost) SetFirstname(v string) { + + o.Firstname = &v + +} + +// HasFirstname returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasFirstname() bool { + if o != nil && o.Firstname != nil { + return true + } + + return false +} + +// GetLastname returns the Lastname field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPost) GetLastname() *string { + if o == nil { + return nil + } + + return o.Lastname + +} + +// GetLastnameOk returns a tuple with the Lastname 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 *UserPropertiesPost) GetLastnameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Lastname, true +} + +// SetLastname sets field value +func (o *UserPropertiesPost) SetLastname(v string) { + + o.Lastname = &v + +} + +// HasLastname returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasLastname() bool { + if o != nil && o.Lastname != nil { + return true + } + + return false +} + +// GetEmail returns the Email field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPost) GetEmail() *string { + if o == nil { + return nil + } + + return o.Email + +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserPropertiesPost) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Email, true +} + +// SetEmail sets field value +func (o *UserPropertiesPost) SetEmail(v string) { + + o.Email = &v + +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// GetAdministrator returns the Administrator field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPost) GetAdministrator() *bool { + if o == nil { + return nil + } + + return o.Administrator + +} + +// GetAdministratorOk returns a tuple with the Administrator 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 *UserPropertiesPost) GetAdministratorOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Administrator, true +} + +// SetAdministrator sets field value +func (o *UserPropertiesPost) SetAdministrator(v bool) { + + o.Administrator = &v + +} + +// HasAdministrator returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasAdministrator() bool { + if o != nil && o.Administrator != nil { + return true + } + + return false +} + +// GetForceSecAuth returns the ForceSecAuth field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPost) GetForceSecAuth() *bool { + if o == nil { + return nil + } + + return o.ForceSecAuth + +} + +// GetForceSecAuthOk returns a tuple with the ForceSecAuth 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 *UserPropertiesPost) GetForceSecAuthOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.ForceSecAuth, true +} + +// SetForceSecAuth sets field value +func (o *UserPropertiesPost) SetForceSecAuth(v bool) { + + o.ForceSecAuth = &v + +} + +// HasForceSecAuth returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasForceSecAuth() bool { + if o != nil && o.ForceSecAuth != nil { + return true + } + + return false +} + +// GetSecAuthActive returns the SecAuthActive field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPost) GetSecAuthActive() *bool { + if o == nil { + return nil + } + + return o.SecAuthActive + +} + +// GetSecAuthActiveOk returns a tuple with the SecAuthActive 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 *UserPropertiesPost) GetSecAuthActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.SecAuthActive, true +} + +// SetSecAuthActive sets field value +func (o *UserPropertiesPost) SetSecAuthActive(v bool) { + + o.SecAuthActive = &v + +} + +// HasSecAuthActive returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasSecAuthActive() bool { + if o != nil && o.SecAuthActive != nil { + return true + } + + return false +} + +// GetPassword returns the Password field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPost) GetPassword() *string { + if o == nil { + return nil + } + + 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 *UserPropertiesPost) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Password, true +} + +// SetPassword sets field value +func (o *UserPropertiesPost) SetPassword(v string) { + + o.Password = &v + +} + +// HasPassword returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// GetActive returns the Active field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPost) GetActive() *bool { + if o == nil { + return nil + } + + return o.Active + +} + +// GetActiveOk returns a tuple with the Active 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 *UserPropertiesPost) GetActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Active, true +} + +// SetActive sets field value +func (o *UserPropertiesPost) SetActive(v bool) { + + o.Active = &v + +} + +// HasActive returns a boolean if a field has been set. +func (o *UserPropertiesPost) HasActive() bool { + if o != nil && o.Active != nil { + return true + } + + return false +} + +func (o UserPropertiesPost) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Firstname != nil { + toSerialize["firstname"] = o.Firstname + } + if o.Lastname != nil { + toSerialize["lastname"] = o.Lastname + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Administrator != nil { + toSerialize["administrator"] = o.Administrator + } + if o.ForceSecAuth != nil { + toSerialize["forceSecAuth"] = o.ForceSecAuth + } + if o.SecAuthActive != nil { + toSerialize["secAuthActive"] = o.SecAuthActive + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Active != nil { + toSerialize["active"] = o.Active + } + return json.Marshal(toSerialize) +} + +type NullableUserPropertiesPost struct { + value *UserPropertiesPost + isSet bool +} + +func (v NullableUserPropertiesPost) Get() *UserPropertiesPost { + return v.value +} + +func (v *NullableUserPropertiesPost) Set(val *UserPropertiesPost) { + v.value = val + v.isSet = true +} + +func (v NullableUserPropertiesPost) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPropertiesPost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPropertiesPost(val *UserPropertiesPost) *NullableUserPropertiesPost { + return &NullableUserPropertiesPost{value: val, isSet: true} +} + +func (v NullableUserPropertiesPost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPropertiesPost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_put.go new file mode 100644 index 000000000000..778c3b0cfc54 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_properties_put.go @@ -0,0 +1,422 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserPropertiesPut struct for UserPropertiesPut +type UserPropertiesPut struct { + // The first name of the user. + Firstname *string `json:"firstname,omitempty"` + // The last name of the user. + Lastname *string `json:"lastname,omitempty"` + // The email address of the user. + Email *string `json:"email,omitempty"` + // password of the user + Password *string `json:"password,omitempty"` + // Indicates if the user has admin rights. + Administrator *bool `json:"administrator,omitempty"` + // Indicates if secure authentication should be forced on the user. + ForceSecAuth *bool `json:"forceSecAuth,omitempty"` + // Indicates if secure authentication is active for the user. + SecAuthActive *bool `json:"secAuthActive,omitempty"` + // Indicates if the user is active. + Active *bool `json:"active,omitempty"` +} + +// NewUserPropertiesPut instantiates a new UserPropertiesPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPropertiesPut() *UserPropertiesPut { + this := UserPropertiesPut{} + + return &this +} + +// NewUserPropertiesPutWithDefaults instantiates a new UserPropertiesPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPropertiesPutWithDefaults() *UserPropertiesPut { + this := UserPropertiesPut{} + return &this +} + +// GetFirstname returns the Firstname field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPut) GetFirstname() *string { + if o == nil { + return nil + } + + return o.Firstname + +} + +// GetFirstnameOk returns a tuple with the Firstname 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 *UserPropertiesPut) GetFirstnameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Firstname, true +} + +// SetFirstname sets field value +func (o *UserPropertiesPut) SetFirstname(v string) { + + o.Firstname = &v + +} + +// HasFirstname returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasFirstname() bool { + if o != nil && o.Firstname != nil { + return true + } + + return false +} + +// GetLastname returns the Lastname field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPut) GetLastname() *string { + if o == nil { + return nil + } + + return o.Lastname + +} + +// GetLastnameOk returns a tuple with the Lastname 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 *UserPropertiesPut) GetLastnameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Lastname, true +} + +// SetLastname sets field value +func (o *UserPropertiesPut) SetLastname(v string) { + + o.Lastname = &v + +} + +// HasLastname returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasLastname() bool { + if o != nil && o.Lastname != nil { + return true + } + + return false +} + +// GetEmail returns the Email field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPut) GetEmail() *string { + if o == nil { + return nil + } + + return o.Email + +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserPropertiesPut) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Email, true +} + +// SetEmail sets field value +func (o *UserPropertiesPut) SetEmail(v string) { + + o.Email = &v + +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// GetPassword returns the Password field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPropertiesPut) GetPassword() *string { + if o == nil { + return nil + } + + 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 *UserPropertiesPut) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Password, true +} + +// SetPassword sets field value +func (o *UserPropertiesPut) SetPassword(v string) { + + o.Password = &v + +} + +// HasPassword returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// GetAdministrator returns the Administrator field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPut) GetAdministrator() *bool { + if o == nil { + return nil + } + + return o.Administrator + +} + +// GetAdministratorOk returns a tuple with the Administrator 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 *UserPropertiesPut) GetAdministratorOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Administrator, true +} + +// SetAdministrator sets field value +func (o *UserPropertiesPut) SetAdministrator(v bool) { + + o.Administrator = &v + +} + +// HasAdministrator returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasAdministrator() bool { + if o != nil && o.Administrator != nil { + return true + } + + return false +} + +// GetForceSecAuth returns the ForceSecAuth field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPut) GetForceSecAuth() *bool { + if o == nil { + return nil + } + + return o.ForceSecAuth + +} + +// GetForceSecAuthOk returns a tuple with the ForceSecAuth 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 *UserPropertiesPut) GetForceSecAuthOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.ForceSecAuth, true +} + +// SetForceSecAuth sets field value +func (o *UserPropertiesPut) SetForceSecAuth(v bool) { + + o.ForceSecAuth = &v + +} + +// HasForceSecAuth returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasForceSecAuth() bool { + if o != nil && o.ForceSecAuth != nil { + return true + } + + return false +} + +// GetSecAuthActive returns the SecAuthActive field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPut) GetSecAuthActive() *bool { + if o == nil { + return nil + } + + return o.SecAuthActive + +} + +// GetSecAuthActiveOk returns a tuple with the SecAuthActive 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 *UserPropertiesPut) GetSecAuthActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.SecAuthActive, true +} + +// SetSecAuthActive sets field value +func (o *UserPropertiesPut) SetSecAuthActive(v bool) { + + o.SecAuthActive = &v + +} + +// HasSecAuthActive returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasSecAuthActive() bool { + if o != nil && o.SecAuthActive != nil { + return true + } + + return false +} + +// GetActive returns the Active field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *UserPropertiesPut) GetActive() *bool { + if o == nil { + return nil + } + + return o.Active + +} + +// GetActiveOk returns a tuple with the Active 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 *UserPropertiesPut) GetActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + + return o.Active, true +} + +// SetActive sets field value +func (o *UserPropertiesPut) SetActive(v bool) { + + o.Active = &v + +} + +// HasActive returns a boolean if a field has been set. +func (o *UserPropertiesPut) HasActive() bool { + if o != nil && o.Active != nil { + return true + } + + return false +} + +func (o UserPropertiesPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Firstname != nil { + toSerialize["firstname"] = o.Firstname + } + if o.Lastname != nil { + toSerialize["lastname"] = o.Lastname + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Administrator != nil { + toSerialize["administrator"] = o.Administrator + } + if o.ForceSecAuth != nil { + toSerialize["forceSecAuth"] = o.ForceSecAuth + } + if o.SecAuthActive != nil { + toSerialize["secAuthActive"] = o.SecAuthActive + } + if o.Active != nil { + toSerialize["active"] = o.Active + } + return json.Marshal(toSerialize) +} + +type NullableUserPropertiesPut struct { + value *UserPropertiesPut + isSet bool +} + +func (v NullableUserPropertiesPut) Get() *UserPropertiesPut { + return v.value +} + +func (v *NullableUserPropertiesPut) Set(val *UserPropertiesPut) { + v.value = val + v.isSet = true +} + +func (v NullableUserPropertiesPut) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPropertiesPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPropertiesPut(val *UserPropertiesPut) *NullableUserPropertiesPut { + return &NullableUserPropertiesPut{value: val, isSet: true} +} + +func (v NullableUserPropertiesPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPropertiesPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_put.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_put.go new file mode 100644 index 000000000000..b45261f2f442 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_user_put.go @@ -0,0 +1,165 @@ +/* + * CLOUD API + * + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. + * + * API version: 6.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// UserPut struct for UserPut +type UserPut struct { + // The resource's unique identifier. + Id *string `json:"id,omitempty"` + Properties *UserPropertiesPut `json:"properties"` +} + +// NewUserPut instantiates a new UserPut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPut(properties UserPropertiesPut) *UserPut { + this := UserPut{} + + this.Properties = &properties + + return &this +} + +// NewUserPutWithDefaults instantiates a new UserPut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPutWithDefaults() *UserPut { + this := UserPut{} + return &this +} + +// GetId returns the Id field value +// If the value is explicit nil, the zero value for string will be returned +func (o *UserPut) GetId() *string { + if o == nil { + return nil + } + + return o.Id + +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserPut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.Id, true +} + +// SetId sets field value +func (o *UserPut) SetId(v string) { + + o.Id = &v + +} + +// HasId returns a boolean if a field has been set. +func (o *UserPut) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for UserPropertiesPut will be returned +func (o *UserPut) GetProperties() *UserPropertiesPut { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserPut) GetPropertiesOk() (*UserPropertiesPut, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *UserPut) SetProperties(v UserPropertiesPut) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *UserPut) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o UserPut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return json.Marshal(toSerialize) +} + +type NullableUserPut struct { + value *UserPut + isSet bool +} + +func (v NullableUserPut) Get() *UserPut { + return v.value +} + +func (v *NullableUserPut) Set(val *UserPut) { + v.value = val + v.isSet = true +} + +func (v NullableUserPut) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPut(val *UserPut) *NullableUserPut { + return &NullableUserPut{value: val, isSet: true} +} + +func (v NullableUserPut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users.go index 9068d95b3293..0107d029b325 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Users struct for Users type Users struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]User `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewUsers instantiates a new Users object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsers() *Users { + this := Users{} + return &this +} + +// NewUsersWithDefaults instantiates a new Users object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsersWithDefaults() *Users { + this := Users{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Users) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Users) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Users) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Users) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Users) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Users) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Users) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Users) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Users) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Users) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Users) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Users) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Users) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Users) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []User will be returned func (o *Users) GetItems() *[]User { @@ -144,6 +171,7 @@ func (o *Users) GetItems() *[]User { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Users) GetItemsOk() (*[]User, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Users) SetItems(v []User) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Users) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Users) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Users) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Users) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Users) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Users) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Users) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Users) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Users) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Users) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Users) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Users) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Users) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Users) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableUsers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users_entities.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users_entities.go index 41d547aa10b3..6c10d5a04b1d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users_entities.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_users_entities.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,11 +16,27 @@ import ( // UsersEntities struct for UsersEntities type UsersEntities struct { - Owns *ResourcesUsers `json:"owns,omitempty"` - Groups *GroupUsers `json:"groups,omitempty"` + Owns *ResourcesUsers `json:"owns,omitempty"` + Groups *GroupUsers `json:"groups,omitempty"` } +// NewUsersEntities instantiates a new UsersEntities object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsersEntities() *UsersEntities { + this := UsersEntities{} + return &this +} + +// NewUsersEntitiesWithDefaults instantiates a new UsersEntities object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsersEntitiesWithDefaults() *UsersEntities { + this := UsersEntities{} + return &this +} // GetOwns returns the Owns field value // If the value is explicit nil, the zero value for ResourcesUsers will be returned @@ -30,6 +46,7 @@ func (o *UsersEntities) GetOwns() *ResourcesUsers { } return o.Owns + } // GetOwnsOk returns a tuple with the Owns field value @@ -39,12 +56,15 @@ func (o *UsersEntities) GetOwnsOk() (*ResourcesUsers, bool) { if o == nil { return nil, false } + return o.Owns, true } // SetOwns sets field value func (o *UsersEntities) SetOwns(v ResourcesUsers) { + o.Owns = &v + } // HasOwns returns a boolean if a field has been set. @@ -56,8 +76,6 @@ func (o *UsersEntities) HasOwns() bool { return false } - - // GetGroups returns the Groups field value // If the value is explicit nil, the zero value for GroupUsers will be returned func (o *UsersEntities) GetGroups() *GroupUsers { @@ -66,6 +84,7 @@ func (o *UsersEntities) GetGroups() *GroupUsers { } return o.Groups + } // GetGroupsOk returns a tuple with the Groups field value @@ -75,12 +94,15 @@ func (o *UsersEntities) GetGroupsOk() (*GroupUsers, bool) { if o == nil { return nil, false } + return o.Groups, true } // SetGroups sets field value func (o *UsersEntities) SetGroups(v GroupUsers) { + o.Groups = &v + } // HasGroups returns a boolean if a field has been set. @@ -92,19 +114,14 @@ func (o *UsersEntities) HasGroups() bool { return false } - func (o UsersEntities) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Owns != nil { toSerialize["owns"] = o.Owns } - - if o.Groups != nil { toSerialize["groups"] = o.Groups } - return json.Marshal(toSerialize) } @@ -143,5 +160,3 @@ func (v *NullableUsersEntities) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume.go index 15741a600bd9..52f4eca7a8d0 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,35 @@ import ( // Volume struct for Volume type Volume struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) - Href *string `json:"href,omitempty"` - Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` - Properties *VolumeProperties `json:"properties"` + // URL to the object representation (absolute path). + Href *string `json:"href,omitempty"` + Metadata *DatacenterElementMetadata `json:"metadata,omitempty"` + Properties *VolumeProperties `json:"properties"` } +// NewVolume instantiates a new Volume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolume(properties VolumeProperties) *Volume { + this := Volume{} + this.Properties = &properties + + return &this +} + +// NewVolumeWithDefaults instantiates a new Volume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeWithDefaults() *Volume { + this := Volume{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +54,7 @@ func (o *Volume) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +64,15 @@ func (o *Volume) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Volume) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +84,6 @@ func (o *Volume) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Volume) GetType() *Type { @@ -72,6 +92,7 @@ func (o *Volume) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +102,15 @@ func (o *Volume) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Volume) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +122,6 @@ func (o *Volume) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Volume) GetHref() *string { @@ -108,6 +130,7 @@ func (o *Volume) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +140,15 @@ func (o *Volume) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Volume) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +160,6 @@ func (o *Volume) HasHref() bool { return false } - - // GetMetadata returns the Metadata field value // If the value is explicit nil, the zero value for DatacenterElementMetadata will be returned func (o *Volume) GetMetadata() *DatacenterElementMetadata { @@ -144,6 +168,7 @@ func (o *Volume) GetMetadata() *DatacenterElementMetadata { } return o.Metadata + } // GetMetadataOk returns a tuple with the Metadata field value @@ -153,12 +178,15 @@ func (o *Volume) GetMetadataOk() (*DatacenterElementMetadata, bool) { if o == nil { return nil, false } + return o.Metadata, true } // SetMetadata sets field value func (o *Volume) SetMetadata(v DatacenterElementMetadata) { + o.Metadata = &v + } // HasMetadata returns a boolean if a field has been set. @@ -170,8 +198,6 @@ func (o *Volume) HasMetadata() bool { return false } - - // GetProperties returns the Properties field value // If the value is explicit nil, the zero value for VolumeProperties will be returned func (o *Volume) GetProperties() *VolumeProperties { @@ -180,6 +206,7 @@ func (o *Volume) GetProperties() *VolumeProperties { } return o.Properties + } // GetPropertiesOk returns a tuple with the Properties field value @@ -189,12 +216,15 @@ func (o *Volume) GetPropertiesOk() (*VolumeProperties, bool) { if o == nil { return nil, false } + return o.Properties, true } // SetProperties sets field value func (o *Volume) SetProperties(v VolumeProperties) { + o.Properties = &v + } // HasProperties returns a boolean if a field has been set. @@ -206,34 +236,23 @@ func (o *Volume) HasProperties() bool { return false } - func (o Volume) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Metadata != nil { toSerialize["metadata"] = o.Metadata } - - if o.Properties != nil { toSerialize["properties"] = o.Properties } - return json.Marshal(toSerialize) } @@ -272,5 +291,3 @@ func (v *NullableVolume) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume_properties.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume_properties.go index 0539bb3ff461..d01fedc835df 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume_properties.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volume_properties.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,44 +16,68 @@ import ( // VolumeProperties struct for VolumeProperties type VolumeProperties struct { - // A name of that resource + // The name of the resource. Name *string `json:"name,omitempty"` - // Hardware type of the volume. + // Hardware type of the volume. DAS (Direct Attached Storage) could be used only in a composite call with a Cube server. Type *string `json:"type,omitempty"` - // The size of the volume in GB + // The size of the volume in GB. Size *float32 `json:"size"` - // The availability zone in which the volume should exist. The storage volume will be provisioned on as less physical storages as possible but cannot guarantee upfront + // The availability zone in which the volume should be provisioned. The storage volume will be provisioned on as few physical storage devices as possible, but this cannot be guaranteed upfront. This is uavailable for DAS (Direct Attached Storage), and subject to availability for SSD. AvailabilityZone *string `json:"availabilityZone,omitempty"` - // Image or snapshot ID to be used as template for this volume + // Image or snapshot ID to be used as template for this volume. Image *string `json:"image,omitempty"` - ImageAlias *string `json:"imageAlias,omitempty"` - // Initial password to be set for installed OS. Works with public images only. Not modifiable, forbidden in update requests. Password rules allows all characters from a-z, A-Z, 0-9 + // Initial password to be set for installed OS. Works with public images only. Not modifiable, forbidden in update requests. Password rules allows all characters from a-z, A-Z, 0-9. ImagePassword *string `json:"imagePassword,omitempty"` + ImageAlias *string `json:"imageAlias,omitempty"` // Public SSH keys are set on the image as authorized keys for appropriate SSH login to the instance using the corresponding private key. This field may only be set in creation requests. When reading, it always returns null. SSH keys are only supported if a public Linux image is used for the volume creation. SshKeys *[]string `json:"sshKeys,omitempty"` - // The bus type of the volume. Default is VIRTIO + // The bus type for this volume; default is VIRTIO. Bus *string `json:"bus,omitempty"` - // OS type of this volume + // OS type for this volume. LicenceType *string `json:"licenceType,omitempty"` - // Is capable of CPU hot plug (no reboot required) + // Hot-plug capable CPU (no reboot required). CpuHotPlug *bool `json:"cpuHotPlug,omitempty"` - // Is capable of memory hot plug (no reboot required) + // Hot-plug capable RAM (no reboot required). RamHotPlug *bool `json:"ramHotPlug,omitempty"` - // Is capable of nic hot plug (no reboot required) + // Hot-plug capable NIC (no reboot required). NicHotPlug *bool `json:"nicHotPlug,omitempty"` - // Is capable of nic hot unplug (no reboot required) + // Hot-unplug capable NIC (no reboot required). NicHotUnplug *bool `json:"nicHotUnplug,omitempty"` - // Is capable of Virt-IO drive hot plug (no reboot required) + // Hot-plug capable Virt-IO drive (no reboot required). DiscVirtioHotPlug *bool `json:"discVirtioHotPlug,omitempty"` - // Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines. + // Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs. DiscVirtioHotUnplug *bool `json:"discVirtioHotUnplug,omitempty"` - // The LUN ID of the storage volume. Null for volumes not mounted to any VM + // The Logical Unit Number of the storage volume. Null for volumes, not mounted to a VM. DeviceNumber *int64 `json:"deviceNumber,omitempty"` - // The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provied either public image or imageAlias in conjunction with this property. + // The PCI slot number of the storage volume. Null for volumes, not mounted to a VM. + PciSlot *int32 `json:"pciSlot,omitempty"` + // The ID of the backup unit that the user has access to. The property is immutable and is only allowed to be set on creation of a new a volume. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property. BackupunitId *string `json:"backupunitId,omitempty"` + // The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on creation of a new a volume. It is mandatory to provide either 'public image' or 'imageAlias' that has cloud-init compatibility in conjunction with this property. + UserData *string `json:"userData,omitempty"` + // The UUID of the attached server. + BootServer *string `json:"bootServer,omitempty"` } +// NewVolumeProperties instantiates a new VolumeProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeProperties(size float32) *VolumeProperties { + this := VolumeProperties{} + this.Size = &size + + return &this +} + +// NewVolumePropertiesWithDefaults instantiates a new VolumeProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePropertiesWithDefaults() *VolumeProperties { + this := VolumeProperties{} + return &this +} // GetName returns the Name field value // If the value is explicit nil, the zero value for string will be returned @@ -63,6 +87,7 @@ func (o *VolumeProperties) GetName() *string { } return o.Name + } // GetNameOk returns a tuple with the Name field value @@ -72,12 +97,15 @@ func (o *VolumeProperties) GetNameOk() (*string, bool) { if o == nil { return nil, false } + return o.Name, true } // SetName sets field value func (o *VolumeProperties) SetName(v string) { + o.Name = &v + } // HasName returns a boolean if a field has been set. @@ -89,8 +117,6 @@ func (o *VolumeProperties) HasName() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for string will be returned func (o *VolumeProperties) GetType() *string { @@ -99,6 +125,7 @@ func (o *VolumeProperties) GetType() *string { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -108,12 +135,15 @@ func (o *VolumeProperties) GetTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *VolumeProperties) SetType(v string) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -125,8 +155,6 @@ func (o *VolumeProperties) HasType() bool { return false } - - // GetSize returns the Size field value // If the value is explicit nil, the zero value for float32 will be returned func (o *VolumeProperties) GetSize() *float32 { @@ -135,6 +163,7 @@ func (o *VolumeProperties) GetSize() *float32 { } return o.Size + } // GetSizeOk returns a tuple with the Size field value @@ -144,12 +173,15 @@ func (o *VolumeProperties) GetSizeOk() (*float32, bool) { if o == nil { return nil, false } + return o.Size, true } // SetSize sets field value func (o *VolumeProperties) SetSize(v float32) { + o.Size = &v + } // HasSize returns a boolean if a field has been set. @@ -161,8 +193,6 @@ func (o *VolumeProperties) HasSize() bool { return false } - - // GetAvailabilityZone returns the AvailabilityZone field value // If the value is explicit nil, the zero value for string will be returned func (o *VolumeProperties) GetAvailabilityZone() *string { @@ -171,6 +201,7 @@ func (o *VolumeProperties) GetAvailabilityZone() *string { } return o.AvailabilityZone + } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value @@ -180,12 +211,15 @@ func (o *VolumeProperties) GetAvailabilityZoneOk() (*string, bool) { if o == nil { return nil, false } + return o.AvailabilityZone, true } // SetAvailabilityZone sets field value func (o *VolumeProperties) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v + } // HasAvailabilityZone returns a boolean if a field has been set. @@ -197,8 +231,6 @@ func (o *VolumeProperties) HasAvailabilityZone() bool { return false } - - // GetImage returns the Image field value // If the value is explicit nil, the zero value for string will be returned func (o *VolumeProperties) GetImage() *string { @@ -207,6 +239,7 @@ func (o *VolumeProperties) GetImage() *string { } return o.Image + } // GetImageOk returns a tuple with the Image field value @@ -216,12 +249,15 @@ func (o *VolumeProperties) GetImageOk() (*string, bool) { if o == nil { return nil, false } + return o.Image, true } // SetImage sets field value func (o *VolumeProperties) SetImage(v string) { + o.Image = &v + } // HasImage returns a boolean if a field has been set. @@ -233,80 +269,82 @@ func (o *VolumeProperties) HasImage() bool { return false } - - -// GetImageAlias returns the ImageAlias field value +// GetImagePassword returns the ImagePassword field value // If the value is explicit nil, the zero value for string will be returned -func (o *VolumeProperties) GetImageAlias() *string { +func (o *VolumeProperties) GetImagePassword() *string { if o == nil { return nil } - return o.ImageAlias + return o.ImagePassword + } -// GetImageAliasOk returns a tuple with the ImageAlias field value +// GetImagePasswordOk returns a tuple with the ImagePassword 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 *VolumeProperties) GetImageAliasOk() (*string, bool) { +func (o *VolumeProperties) GetImagePasswordOk() (*string, bool) { if o == nil { return nil, false } - return o.ImageAlias, true + + return o.ImagePassword, true } -// SetImageAlias sets field value -func (o *VolumeProperties) SetImageAlias(v string) { - o.ImageAlias = &v +// SetImagePassword sets field value +func (o *VolumeProperties) SetImagePassword(v string) { + + o.ImagePassword = &v + } -// HasImageAlias returns a boolean if a field has been set. -func (o *VolumeProperties) HasImageAlias() bool { - if o != nil && o.ImageAlias != nil { +// HasImagePassword returns a boolean if a field has been set. +func (o *VolumeProperties) HasImagePassword() bool { + if o != nil && o.ImagePassword != nil { return true } return false } - - -// GetImagePassword returns the ImagePassword field value +// GetImageAlias returns the ImageAlias field value // If the value is explicit nil, the zero value for string will be returned -func (o *VolumeProperties) GetImagePassword() *string { +func (o *VolumeProperties) GetImageAlias() *string { if o == nil { return nil } - return o.ImagePassword + return o.ImageAlias + } -// GetImagePasswordOk returns a tuple with the ImagePassword field value +// GetImageAliasOk returns a tuple with the ImageAlias 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 *VolumeProperties) GetImagePasswordOk() (*string, bool) { +func (o *VolumeProperties) GetImageAliasOk() (*string, bool) { if o == nil { return nil, false } - return o.ImagePassword, true + + return o.ImageAlias, true } -// SetImagePassword sets field value -func (o *VolumeProperties) SetImagePassword(v string) { - o.ImagePassword = &v +// SetImageAlias sets field value +func (o *VolumeProperties) SetImageAlias(v string) { + + o.ImageAlias = &v + } -// HasImagePassword returns a boolean if a field has been set. -func (o *VolumeProperties) HasImagePassword() bool { - if o != nil && o.ImagePassword != nil { +// HasImageAlias returns a boolean if a field has been set. +func (o *VolumeProperties) HasImageAlias() bool { + if o != nil && o.ImageAlias != nil { return true } return false } - - // GetSshKeys returns the SshKeys field value // If the value is explicit nil, the zero value for []string will be returned func (o *VolumeProperties) GetSshKeys() *[]string { @@ -315,6 +353,7 @@ func (o *VolumeProperties) GetSshKeys() *[]string { } return o.SshKeys + } // GetSshKeysOk returns a tuple with the SshKeys field value @@ -324,12 +363,15 @@ func (o *VolumeProperties) GetSshKeysOk() (*[]string, bool) { if o == nil { return nil, false } + return o.SshKeys, true } // SetSshKeys sets field value func (o *VolumeProperties) SetSshKeys(v []string) { + o.SshKeys = &v + } // HasSshKeys returns a boolean if a field has been set. @@ -341,8 +383,6 @@ func (o *VolumeProperties) HasSshKeys() bool { return false } - - // GetBus returns the Bus field value // If the value is explicit nil, the zero value for string will be returned func (o *VolumeProperties) GetBus() *string { @@ -351,6 +391,7 @@ func (o *VolumeProperties) GetBus() *string { } return o.Bus + } // GetBusOk returns a tuple with the Bus field value @@ -360,12 +401,15 @@ func (o *VolumeProperties) GetBusOk() (*string, bool) { if o == nil { return nil, false } + return o.Bus, true } // SetBus sets field value func (o *VolumeProperties) SetBus(v string) { + o.Bus = &v + } // HasBus returns a boolean if a field has been set. @@ -377,8 +421,6 @@ func (o *VolumeProperties) HasBus() bool { return false } - - // GetLicenceType returns the LicenceType field value // If the value is explicit nil, the zero value for string will be returned func (o *VolumeProperties) GetLicenceType() *string { @@ -387,6 +429,7 @@ func (o *VolumeProperties) GetLicenceType() *string { } return o.LicenceType + } // GetLicenceTypeOk returns a tuple with the LicenceType field value @@ -396,12 +439,15 @@ func (o *VolumeProperties) GetLicenceTypeOk() (*string, bool) { if o == nil { return nil, false } + return o.LicenceType, true } // SetLicenceType sets field value func (o *VolumeProperties) SetLicenceType(v string) { + o.LicenceType = &v + } // HasLicenceType returns a boolean if a field has been set. @@ -413,8 +459,6 @@ func (o *VolumeProperties) HasLicenceType() bool { return false } - - // GetCpuHotPlug returns the CpuHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetCpuHotPlug() *bool { @@ -423,6 +467,7 @@ func (o *VolumeProperties) GetCpuHotPlug() *bool { } return o.CpuHotPlug + } // GetCpuHotPlugOk returns a tuple with the CpuHotPlug field value @@ -432,12 +477,15 @@ func (o *VolumeProperties) GetCpuHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.CpuHotPlug, true } // SetCpuHotPlug sets field value func (o *VolumeProperties) SetCpuHotPlug(v bool) { + o.CpuHotPlug = &v + } // HasCpuHotPlug returns a boolean if a field has been set. @@ -449,8 +497,6 @@ func (o *VolumeProperties) HasCpuHotPlug() bool { return false } - - // GetRamHotPlug returns the RamHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetRamHotPlug() *bool { @@ -459,6 +505,7 @@ func (o *VolumeProperties) GetRamHotPlug() *bool { } return o.RamHotPlug + } // GetRamHotPlugOk returns a tuple with the RamHotPlug field value @@ -468,12 +515,15 @@ func (o *VolumeProperties) GetRamHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.RamHotPlug, true } // SetRamHotPlug sets field value func (o *VolumeProperties) SetRamHotPlug(v bool) { + o.RamHotPlug = &v + } // HasRamHotPlug returns a boolean if a field has been set. @@ -485,8 +535,6 @@ func (o *VolumeProperties) HasRamHotPlug() bool { return false } - - // GetNicHotPlug returns the NicHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetNicHotPlug() *bool { @@ -495,6 +543,7 @@ func (o *VolumeProperties) GetNicHotPlug() *bool { } return o.NicHotPlug + } // GetNicHotPlugOk returns a tuple with the NicHotPlug field value @@ -504,12 +553,15 @@ func (o *VolumeProperties) GetNicHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotPlug, true } // SetNicHotPlug sets field value func (o *VolumeProperties) SetNicHotPlug(v bool) { + o.NicHotPlug = &v + } // HasNicHotPlug returns a boolean if a field has been set. @@ -521,8 +573,6 @@ func (o *VolumeProperties) HasNicHotPlug() bool { return false } - - // GetNicHotUnplug returns the NicHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetNicHotUnplug() *bool { @@ -531,6 +581,7 @@ func (o *VolumeProperties) GetNicHotUnplug() *bool { } return o.NicHotUnplug + } // GetNicHotUnplugOk returns a tuple with the NicHotUnplug field value @@ -540,12 +591,15 @@ func (o *VolumeProperties) GetNicHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.NicHotUnplug, true } // SetNicHotUnplug sets field value func (o *VolumeProperties) SetNicHotUnplug(v bool) { + o.NicHotUnplug = &v + } // HasNicHotUnplug returns a boolean if a field has been set. @@ -557,8 +611,6 @@ func (o *VolumeProperties) HasNicHotUnplug() bool { return false } - - // GetDiscVirtioHotPlug returns the DiscVirtioHotPlug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetDiscVirtioHotPlug() *bool { @@ -567,6 +619,7 @@ func (o *VolumeProperties) GetDiscVirtioHotPlug() *bool { } return o.DiscVirtioHotPlug + } // GetDiscVirtioHotPlugOk returns a tuple with the DiscVirtioHotPlug field value @@ -576,12 +629,15 @@ func (o *VolumeProperties) GetDiscVirtioHotPlugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotPlug, true } // SetDiscVirtioHotPlug sets field value func (o *VolumeProperties) SetDiscVirtioHotPlug(v bool) { + o.DiscVirtioHotPlug = &v + } // HasDiscVirtioHotPlug returns a boolean if a field has been set. @@ -593,8 +649,6 @@ func (o *VolumeProperties) HasDiscVirtioHotPlug() bool { return false } - - // GetDiscVirtioHotUnplug returns the DiscVirtioHotUnplug field value // If the value is explicit nil, the zero value for bool will be returned func (o *VolumeProperties) GetDiscVirtioHotUnplug() *bool { @@ -603,6 +657,7 @@ func (o *VolumeProperties) GetDiscVirtioHotUnplug() *bool { } return o.DiscVirtioHotUnplug + } // GetDiscVirtioHotUnplugOk returns a tuple with the DiscVirtioHotUnplug field value @@ -612,12 +667,15 @@ func (o *VolumeProperties) GetDiscVirtioHotUnplugOk() (*bool, bool) { if o == nil { return nil, false } + return o.DiscVirtioHotUnplug, true } // SetDiscVirtioHotUnplug sets field value func (o *VolumeProperties) SetDiscVirtioHotUnplug(v bool) { + o.DiscVirtioHotUnplug = &v + } // HasDiscVirtioHotUnplug returns a boolean if a field has been set. @@ -629,8 +687,6 @@ func (o *VolumeProperties) HasDiscVirtioHotUnplug() bool { return false } - - // GetDeviceNumber returns the DeviceNumber field value // If the value is explicit nil, the zero value for int64 will be returned func (o *VolumeProperties) GetDeviceNumber() *int64 { @@ -639,6 +695,7 @@ func (o *VolumeProperties) GetDeviceNumber() *int64 { } return o.DeviceNumber + } // GetDeviceNumberOk returns a tuple with the DeviceNumber field value @@ -648,12 +705,15 @@ func (o *VolumeProperties) GetDeviceNumberOk() (*int64, bool) { if o == nil { return nil, false } + return o.DeviceNumber, true } // SetDeviceNumber sets field value func (o *VolumeProperties) SetDeviceNumber(v int64) { + o.DeviceNumber = &v + } // HasDeviceNumber returns a boolean if a field has been set. @@ -665,7 +725,43 @@ func (o *VolumeProperties) HasDeviceNumber() bool { return false } +// GetPciSlot returns the PciSlot field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *VolumeProperties) GetPciSlot() *int32 { + if o == nil { + return nil + } + + return o.PciSlot + +} +// GetPciSlotOk returns a tuple with the PciSlot 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 *VolumeProperties) GetPciSlotOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.PciSlot, true +} + +// SetPciSlot sets field value +func (o *VolumeProperties) SetPciSlot(v int32) { + + o.PciSlot = &v + +} + +// HasPciSlot returns a boolean if a field has been set. +func (o *VolumeProperties) HasPciSlot() bool { + if o != nil && o.PciSlot != nil { + return true + } + + return false +} // GetBackupunitId returns the BackupunitId field value // If the value is explicit nil, the zero value for string will be returned @@ -675,6 +771,7 @@ func (o *VolumeProperties) GetBackupunitId() *string { } return o.BackupunitId + } // GetBackupunitIdOk returns a tuple with the BackupunitId field value @@ -684,12 +781,15 @@ func (o *VolumeProperties) GetBackupunitIdOk() (*string, bool) { if o == nil { return nil, false } + return o.BackupunitId, true } // SetBackupunitId sets field value func (o *VolumeProperties) SetBackupunitId(v string) { + o.BackupunitId = &v + } // HasBackupunitId returns a boolean if a field has been set. @@ -701,99 +801,147 @@ func (o *VolumeProperties) HasBackupunitId() bool { return false } +// GetUserData returns the UserData field value +// If the value is explicit nil, the zero value for string will be returned +func (o *VolumeProperties) GetUserData() *string { + if o == nil { + return nil + } + + return o.UserData + +} + +// GetUserDataOk returns a tuple with the UserData 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 *VolumeProperties) GetUserDataOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.UserData, true +} + +// SetUserData sets field value +func (o *VolumeProperties) SetUserData(v string) { + + o.UserData = &v + +} + +// HasUserData returns a boolean if a field has been set. +func (o *VolumeProperties) HasUserData() bool { + if o != nil && o.UserData != nil { + return true + } + + return false +} + +// GetBootServer returns the BootServer field value +// If the value is explicit nil, the zero value for string will be returned +func (o *VolumeProperties) GetBootServer() *string { + if o == nil { + return nil + } + + return o.BootServer + +} + +// GetBootServerOk returns a tuple with the BootServer 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 *VolumeProperties) GetBootServerOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.BootServer, true +} + +// SetBootServer sets field value +func (o *VolumeProperties) SetBootServer(v string) { + + o.BootServer = &v + +} + +// HasBootServer returns a boolean if a field has been set. +func (o *VolumeProperties) HasBootServer() bool { + if o != nil && o.BootServer != nil { + return true + } + + return false +} func (o VolumeProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { toSerialize["name"] = o.Name } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Size != nil { toSerialize["size"] = o.Size } - - if o.AvailabilityZone != nil { toSerialize["availabilityZone"] = o.AvailabilityZone } - - if o.Image != nil { toSerialize["image"] = o.Image } - - - if o.ImageAlias != nil { - toSerialize["imageAlias"] = o.ImageAlias - } - - if o.ImagePassword != nil { toSerialize["imagePassword"] = o.ImagePassword } - - + if o.ImageAlias != nil { + toSerialize["imageAlias"] = o.ImageAlias + } if o.SshKeys != nil { toSerialize["sshKeys"] = o.SshKeys } - - if o.Bus != nil { toSerialize["bus"] = o.Bus } - - if o.LicenceType != nil { toSerialize["licenceType"] = o.LicenceType } - - if o.CpuHotPlug != nil { toSerialize["cpuHotPlug"] = o.CpuHotPlug } - - if o.RamHotPlug != nil { toSerialize["ramHotPlug"] = o.RamHotPlug } - - if o.NicHotPlug != nil { toSerialize["nicHotPlug"] = o.NicHotPlug } - - if o.NicHotUnplug != nil { toSerialize["nicHotUnplug"] = o.NicHotUnplug } - - if o.DiscVirtioHotPlug != nil { toSerialize["discVirtioHotPlug"] = o.DiscVirtioHotPlug } - - if o.DiscVirtioHotUnplug != nil { toSerialize["discVirtioHotUnplug"] = o.DiscVirtioHotUnplug } - - if o.DeviceNumber != nil { toSerialize["deviceNumber"] = o.DeviceNumber } - - + if o.PciSlot != nil { + toSerialize["pciSlot"] = o.PciSlot + } if o.BackupunitId != nil { toSerialize["backupunitId"] = o.BackupunitId } - + if o.UserData != nil { + toSerialize["userData"] = o.UserData + } + if o.BootServer != nil { + toSerialize["bootServer"] = o.BootServer + } return json.Marshal(toSerialize) } @@ -832,5 +980,3 @@ func (v *NullableVolumeProperties) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volumes.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volumes.go index 6bfa6fc94b3d..dfe753d8e6de 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volumes.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/model_volumes.go @@ -1,14 +1,14 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" @@ -16,17 +16,38 @@ import ( // Volumes struct for Volumes type Volumes struct { - // The resource's unique identifier + // The resource's unique identifier. Id *string `json:"id,omitempty"` - // The type of object that has been created + // The type of object that has been created. Type *Type `json:"type,omitempty"` - // URL to the object representation (absolute path) + // URL to the object representation (absolute path). Href *string `json:"href,omitempty"` - // Array of items in that collection + // Array of items in the collection. Items *[]Volume `json:"items,omitempty"` + // The offset (if specified in the request). + Offset *float32 `json:"offset,omitempty"` + // The limit (if specified in the request). + Limit *float32 `json:"limit,omitempty"` + Links *PaginationLinks `json:"_links,omitempty"` } +// NewVolumes instantiates a new Volumes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumes() *Volumes { + this := Volumes{} + return &this +} + +// NewVolumesWithDefaults instantiates a new Volumes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumesWithDefaults() *Volumes { + this := Volumes{} + return &this +} // GetId returns the Id field value // If the value is explicit nil, the zero value for string will be returned @@ -36,6 +57,7 @@ func (o *Volumes) GetId() *string { } return o.Id + } // GetIdOk returns a tuple with the Id field value @@ -45,12 +67,15 @@ func (o *Volumes) GetIdOk() (*string, bool) { if o == nil { return nil, false } + return o.Id, true } // SetId sets field value func (o *Volumes) SetId(v string) { + o.Id = &v + } // HasId returns a boolean if a field has been set. @@ -62,8 +87,6 @@ func (o *Volumes) HasId() bool { return false } - - // GetType returns the Type field value // If the value is explicit nil, the zero value for Type will be returned func (o *Volumes) GetType() *Type { @@ -72,6 +95,7 @@ func (o *Volumes) GetType() *Type { } return o.Type + } // GetTypeOk returns a tuple with the Type field value @@ -81,12 +105,15 @@ func (o *Volumes) GetTypeOk() (*Type, bool) { if o == nil { return nil, false } + return o.Type, true } // SetType sets field value func (o *Volumes) SetType(v Type) { + o.Type = &v + } // HasType returns a boolean if a field has been set. @@ -98,8 +125,6 @@ func (o *Volumes) HasType() bool { return false } - - // GetHref returns the Href field value // If the value is explicit nil, the zero value for string will be returned func (o *Volumes) GetHref() *string { @@ -108,6 +133,7 @@ func (o *Volumes) GetHref() *string { } return o.Href + } // GetHrefOk returns a tuple with the Href field value @@ -117,12 +143,15 @@ func (o *Volumes) GetHrefOk() (*string, bool) { if o == nil { return nil, false } + return o.Href, true } // SetHref sets field value func (o *Volumes) SetHref(v string) { + o.Href = &v + } // HasHref returns a boolean if a field has been set. @@ -134,8 +163,6 @@ func (o *Volumes) HasHref() bool { return false } - - // GetItems returns the Items field value // If the value is explicit nil, the zero value for []Volume will be returned func (o *Volumes) GetItems() *[]Volume { @@ -144,6 +171,7 @@ func (o *Volumes) GetItems() *[]Volume { } return o.Items + } // GetItemsOk returns a tuple with the Items field value @@ -153,12 +181,15 @@ func (o *Volumes) GetItemsOk() (*[]Volume, bool) { if o == nil { return nil, false } + return o.Items, true } // SetItems sets field value func (o *Volumes) SetItems(v []Volume) { + o.Items = &v + } // HasItems returns a boolean if a field has been set. @@ -170,29 +201,143 @@ func (o *Volumes) HasItems() bool { return false } +// GetOffset returns the Offset field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Volumes) GetOffset() *float32 { + if o == nil { + return nil + } + + return o.Offset + +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Volumes) GetOffsetOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Offset, true +} + +// SetOffset sets field value +func (o *Volumes) SetOffset(v float32) { + + o.Offset = &v + +} + +// HasOffset returns a boolean if a field has been set. +func (o *Volumes) HasOffset() bool { + if o != nil && o.Offset != nil { + return true + } + + return false +} + +// GetLimit returns the Limit field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Volumes) GetLimit() *float32 { + if o == nil { + return nil + } + + return o.Limit + +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Volumes) GetLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + + return o.Limit, true +} + +// SetLimit sets field value +func (o *Volumes) SetLimit(v float32) { + + o.Limit = &v + +} + +// HasLimit returns a boolean if a field has been set. +func (o *Volumes) HasLimit() bool { + if o != nil && o.Limit != nil { + 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 *Volumes) GetLinks() *PaginationLinks { + if o == nil { + return nil + } + + return o.Links + +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Volumes) GetLinksOk() (*PaginationLinks, bool) { + if o == nil { + return nil, false + } + + return o.Links, true +} + +// SetLinks sets field value +func (o *Volumes) SetLinks(v PaginationLinks) { + + o.Links = &v + +} + +// HasLinks returns a boolean if a field has been set. +func (o *Volumes) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} func (o Volumes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { toSerialize["id"] = o.Id } - - if o.Type != nil { toSerialize["type"] = o.Type } - - if o.Href != nil { toSerialize["href"] = o.Href } - - if o.Items != nil { toSerialize["items"] = o.Items } - + if o.Offset != nil { + toSerialize["offset"] = o.Offset + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } return json.Marshal(toSerialize) } @@ -231,5 +376,3 @@ func (v *NullableVolumes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/response.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/response.go index c1ff44681eae..30e3c36753b6 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/response.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/response.go @@ -1,17 +1,18 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "net/http" + "time" ) // APIResponse stores the API response returned by the server. @@ -23,6 +24,9 @@ type APIResponse struct { // 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"` diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/utils.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/utils.go index 50679f586580..aa9652cd5578 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/utils.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/utils.go @@ -1,44 +1,431 @@ /* * CLOUD API * - * An enterprise-grade Infrastructure is provided as a Service (IaaS) 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 perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. 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. + * IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. * - * API version: 5.0 + * API version: 6.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package ionossdk +package ionoscloud import ( "encoding/json" + "strings" "time" ) -// PtrBool is a helper routine that returns a pointer to given boolean value. +// PtrBool - returns a pointer to given boolean value. func PtrBool(v bool) *bool { return &v } -// PtrInt is a helper routine that returns a pointer to given integer value. +// PtrInt - returns a pointer to given integer value. func PtrInt(v int) *int { return &v } -// PtrInt32 is a helper routine that returns a pointer to given integer value. +// PtrInt32 - returns a pointer to given integer value. func PtrInt32(v int32) *int32 { return &v } -// PtrInt64 is a helper routine that returns a pointer to given integer value. +// PtrInt64 - returns a pointer to given integer value. func PtrInt64(v int64) *int64 { return &v } -// PtrFloat32 is a helper routine that returns a pointer to given float value. +// PtrFloat32 - returns a pointer to given float value. func PtrFloat32(v float32) *float32 { return &v } -// PtrFloat64 is a helper routine that returns a pointer to given float value. +// PtrFloat64 - returns a pointer to given float value. func PtrFloat64(v float64) *float64 { return &v } -// PtrString is a helper routine that returns a pointer to given string value. +// PtrString - returns a pointer to given string value. func PtrString(v string) *string { return &v } -// PtrTime is helper routine that returns a pointer to given Time value. +// 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 @@ -75,7 +462,6 @@ func (v *NullableBool) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableInt struct { value *int isSet bool @@ -112,7 +498,6 @@ func (v *NullableInt) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableInt32 struct { value *int32 isSet bool @@ -149,7 +534,6 @@ func (v *NullableInt32) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableInt64 struct { value *int64 isSet bool @@ -186,7 +570,6 @@ func (v *NullableInt64) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableFloat32 struct { value *float32 isSet bool @@ -223,7 +606,6 @@ func (v *NullableFloat32) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableFloat64 struct { value *float64 isSet bool @@ -260,7 +642,6 @@ func (v *NullableFloat64) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableString struct { value *string isSet bool @@ -297,7 +678,6 @@ func (v *NullableString) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } - type NullableTime struct { value *time.Time isSet bool @@ -333,3 +713,32 @@ 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] + } + 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 +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider.go index 65449c322a5c..c6cd1617362d 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider.go @@ -207,10 +207,10 @@ func (ic *IonosCloudCloudProvider) NodeGroups() []cloudprovider.NodeGroup { func (ic *IonosCloudCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { providerID := node.Spec.ProviderID if nodeGroup := ic.manager.GetNodeGroupForNode(node); nodeGroup != nil { - klog.V(4).Infof("Node %s found in cache", providerID) + klog.V(5).Infof("Found cached node group entry %s for node %s", nodeGroup.Id(), providerID) return nodeGroup, nil } - klog.V(4).Infof("Node %s not found in cache", providerID) + klog.V(4).Infof("No cached node group entry found for node %s", providerID) for _, nodeGroup := range ic.manager.GetNodeGroups() { klog.V(5).Infof("Checking node group %s", nodeGroup.Id()) @@ -223,7 +223,7 @@ func (ic *IonosCloudCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprov if node.Id != providerID { continue } - klog.V(4).Infof("Node %s found after refresh in node group %s", providerID, nodeGroup.Id()) + klog.V(4).Infof("Found node group %s for node %s after refresh", nodeGroup.Id(), providerID) return nodeGroup, nil } } @@ -294,7 +294,7 @@ func BuildIonosCloud( do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter, ) cloudprovider.CloudProvider { - manager, err := CreateIonosCloudManager(opts.NodeGroups) + manager, err := CreateIonosCloudManager(opts.NodeGroups, opts.UserAgent) if err != nil { klog.Fatalf("Failed to create IonosCloud cloud provider: %v", err) } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider_test.go index fb2b11891951..85a2f5ef043a 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_cloud_provider_test.go @@ -33,7 +33,7 @@ type NodeGroupTestSuite struct { } func (s *NodeGroupTestSuite) SetupTest() { - s.manager = &MockIonosCloudManager{} + s.manager = NewMockIonosCloudManager(s.T()) s.nodePool = &nodePool{ id: "test", min: 1, @@ -45,10 +45,6 @@ func (s *NodeGroupTestSuite) SetupTest() { } } -func (s *NodeGroupTestSuite) TearDownTest() { - s.manager.AssertExpectations(s.T()) -} - func TestNodeGroup(t *testing.T) { suite.Run(t, new(NodeGroupTestSuite)) } @@ -180,14 +176,10 @@ type CloudProviderTestSuite struct { } func (s *CloudProviderTestSuite) SetupTest() { - s.manager = &MockIonosCloudManager{} + s.manager = NewMockIonosCloudManager(s.T()) s.provider = BuildIonosCloudCloudProvider(s.manager, &cloudprovider.ResourceLimiter{}) } -func (s *CloudProviderTestSuite) TearDownTest() { - s.manager.AssertExpectations(s.T()) -} - func TestIonosCloudCloudProvider(t *testing.T) { suite.Run(t, new(CloudProviderTestSuite)) } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go index 2d794782fc76..4cd0eba9ffe3 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go @@ -17,6 +17,7 @@ limitations under the License. package ionoscloud import ( + "errors" "fmt" "os" "strconv" @@ -26,14 +27,15 @@ import ( "github.com/google/uuid" apiv1 "k8s.io/api/core/v1" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + ionos "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" "k8s.io/klog/v2" ) const ( envKeyClusterId = "IONOS_CLUSTER_ID" - envKeyToken = "IONOS_TOKEN" + envKeyToken = ionos.IonosTokenEnvVar + envKeyEndpoint = ionos.IonosApiUrlEnvVar envKeyInsecure = "IONOS_INSECURE" - envKeyEndpoint = "IONOS_ENDPOINT" envKeyPollTimeout = "IONOS_POLL_TIMEOUT" envKeyPollInterval = "IONOS_POLL_INTERVAL" envKeyTokensPath = "IONOS_TOKENS_PATH" @@ -68,7 +70,6 @@ type Config struct { // ClusterId is the ID of the cluster to autoscale. ClusterId string // Token is an IonosCloud API access token. - // This token takes precedence over tokens contained in TokensPath. Token string // Endpoint overrides the default API URL. Endpoint string @@ -78,7 +79,7 @@ type Config struct { PollTimeout time.Duration // PollInterval is the interval in which a node pool is polled after an update. PollInterval time.Duration - // TokensPath points to a directory that contains file mappings of node pools to tokens. + // TokensPath points to a directory that contains token files TokensPath string } @@ -129,14 +130,14 @@ type ionosCloudManagerImpl struct { } // CreateIonosCloudManager initializes a new IonosCloudManager. -func CreateIonosCloudManager(nodeGroupsConfig []string) (IonosCloudManager, error) { +func CreateIonosCloudManager(nodeGroupsConfig []string, userAgent string) (IonosCloudManager, error) { klog.V(4).Info("Creating IonosCloud manager") config, err := LoadConfigFromEnv() if err != nil { return nil, fmt.Errorf("failed to load config: %w", err) } - client, err := NewAutoscalingClient(config) + client, err := NewAutoscalingClient(config, userAgent) if err != nil { return nil, fmt.Errorf("failed to initialize client: %w", err) } @@ -190,14 +191,15 @@ func (manager *ionosCloudManagerImpl) initExplicitNodeGroups(nodeGroupsConfig [] if err != nil { return fmt.Errorf("failed to fetch configured node pool %s: %w", np.Id(), err) } - instances, err := manager.fetchInstancesForNodeGroup(np.Id()) - if err != nil { - return err - } manager.cache.AddNodeGroup(np) - manager.cache.SetNodeGroupSize(np.Id(), len(instances)) manager.cache.SetNodeGroupTargetSize(np.Id(), int(*fetchedNodePool.Properties.NodeCount)) - manager.cache.SetInstancesCacheForNodeGroup(np.Id(), instances) + + if err := manager.refreshInstancesForNodeGroup(np.Id()); err != nil { + if !errors.Is(err, errMissingNodeID) { + return err + } + klog.V(4).Infof("node pool %s has nodes with missing node ID", np.Id()) + } } return nil } @@ -270,12 +272,7 @@ func (manager *ionosCloudManagerImpl) DeleteNode(nodeGroup cloudprovider.NodeGro // GetInstancesForNodeGroup returns the instances for the given node group. func (manager *ionosCloudManagerImpl) GetInstancesForNodeGroup(nodeGroup cloudprovider.NodeGroup) ([]cloudprovider.Instance, error) { - if manager.cache.NodeGroupNeedsRefresh(nodeGroup.Id()) { - if err := manager.refreshInstancesForNodeGroup(nodeGroup.Id()); err != nil { - return nil, err - } - } - return manager.cache.GetInstancesForNodeGroup(nodeGroup.Id()), nil + return manager.fetchInstancesForNodeGroup(nodeGroup.Id()) } func (manager *ionosCloudManagerImpl) GetNodeGroupForNode(node *apiv1.Node) cloudprovider.NodeGroup { @@ -285,16 +282,11 @@ func (manager *ionosCloudManagerImpl) GetNodeGroupForNode(node *apiv1.Node) clou // Refreshes the cache holding the instances for the configured node groups. func (manager *ionosCloudManagerImpl) Refresh() error { - nodeGroupInstances := map[string][]cloudprovider.Instance{} for _, id := range manager.cache.GetNodeGroupIds() { - instances, err := manager.fetchInstancesForNodeGroup(id) - if err != nil { + if err := manager.refreshInstancesForNodeGroup(id); err != nil { return err } - nodeGroupInstances[id] = instances } - - manager.cache.SetInstancesCache(nodeGroupInstances) return nil } @@ -315,9 +307,9 @@ func (manager *ionosCloudManagerImpl) fetchInstancesForNodeGroup(id string) ([]c return nil, fmt.Errorf("failed to list nodes for node group %s: %w", id, err) } - instances := make([]cloudprovider.Instance, len(kubernetesNodes)) - for i, kubernetesNode := range kubernetesNodes { - instances[i] = convertToInstance(kubernetesNode) + instances, err := convertToInstances(kubernetesNodes) + if err != nil { + return nil, fmt.Errorf("failed to convert instances for node group %s: %w", id, err) } return instances, nil diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go index 61be60ef0b57..d548a21f108b 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go @@ -17,6 +17,7 @@ limitations under the License. package ionoscloud import ( + "context" "errors" "fmt" "os" @@ -127,7 +128,7 @@ func TestCreateIonosCloudManager(t *testing.T) { os.Unsetenv(envKeyToken) }() - manager, err := CreateIonosCloudManager(nil) + manager, err := CreateIonosCloudManager(nil, "ua") require.Nil(t, manager) require.Error(t, err) } @@ -175,14 +176,14 @@ type ManagerTestSuite struct { } func (s *ManagerTestSuite) SetupTest() { - s.client = &MockAPIClient{} - apiClientFactory = func(_, _ string, _ bool) APIClient { return s.client } + s.client = NewMockAPIClient(s.T()) client, err := NewAutoscalingClient(&Config{ ClusterId: "cluster", Token: "token", PollInterval: pollInterval, PollTimeout: pollTimeout, - }) + }, "ua") + client.clientProvider = fakeClientProvider{s.client} s.Require().NoError(err) s.manager = newManager(client) @@ -194,11 +195,6 @@ func (s *ManagerTestSuite) SetupTest() { } } -func (s *ManagerTestSuite) TearDownTest() { - apiClientFactory = NewAPIClient - s.client.AssertExpectations(s.T()) -} - func (s *ManagerTestSuite) OnGetKubernetesNodePool(retval *ionos.KubernetesNodePool, reterr error) *mock.Call { req := ionos.ApiK8sNodepoolsFindByIdRequest{} nodepool := ionos.KubernetesNodePool{} @@ -211,11 +207,13 @@ func (s *ManagerTestSuite) OnGetKubernetesNodePool(retval *ionos.KubernetesNodeP } func (s *ManagerTestSuite) OnUpdateKubernetesNodePool(size int, reterr error) *mock.Call { - origReq := ionos.ApiK8sNodepoolsPutRequest{} - req := ionos.ApiK8sNodepoolsPutRequest{}.KubernetesNodePoolProperties(resizeRequestBody(size)) + // use actual client here to fill in private fields + cl := ionos.APIClient{}.KubernetesApi + origReq := cl.K8sNodepoolsPut(context.Background(), s.manager.client.clusterId, s.nodePool.id) + expect := origReq.KubernetesNodePool(resizeRequestBody(size)) return s.client. On("K8sNodepoolsPut", mock.Anything, s.manager.client.clusterId, s.nodePool.id).Return(origReq). - On("K8sNodepoolsPutExecute", req).Return(ionos.KubernetesNodePoolForPut{}, nil, reterr) + On("K8sNodepoolsPutExecute", expect).Return(ionos.KubernetesNodePool{}, nil, reterr) } func (s *ManagerTestSuite) OnListKubernetesNodes(retval *ionos.KubernetesNodes, reterr error) *mock.Call { @@ -234,7 +232,7 @@ func (s *ManagerTestSuite) OnDeleteKubernetesNode(id string, reterr error) *mock req := ionos.ApiK8sNodepoolsNodesDeleteRequest{} return s.client. On("K8sNodepoolsNodesDelete", mock.Anything, s.manager.client.clusterId, s.nodePool.id, id).Return(req). - On("K8sNodepoolsNodesDeleteExecute", req).Return(nil, nil, reterr) + On("K8sNodepoolsNodesDeleteExecute", req).Return(nil, reterr) } func TestIonosCloudManager(t *testing.T) { @@ -298,7 +296,6 @@ func (s *ManagerTestSuite) TestSetNodeGroupSize_WaitGetError() { s.Error(err) s.False(errors.Is(err, wait.ErrWaitTimeout)) s.Empty(s.manager.cache.GetNodeGroups()) - s.Empty(s.manager.cache.GetInstancesForNodeGroup(s.nodePool.Id())) } func (s *ManagerTestSuite) TestSetNodeGroupSize_WaitTimeout() { @@ -315,7 +312,6 @@ func (s *ManagerTestSuite) TestSetNodeGroupSize_WaitTimeout() { // The poll count may vary, so just do this to prevent flakes. s.True(pollCount > int(pollTimeout/pollInterval)) s.Empty(s.manager.cache.GetNodeGroups()) - s.Empty(s.manager.cache.GetInstancesForNodeGroup(s.nodePool.Id())) } func (s *ManagerTestSuite) TestSetNodeGroupSize_RefreshNodesError() { @@ -326,7 +322,6 @@ func (s *ManagerTestSuite) TestSetNodeGroupSize_RefreshNodesError() { s.Error(s.manager.SetNodeGroupSize(s.nodePool, 2)) s.Empty(s.manager.cache.GetNodeGroups()) - s.Empty(s.manager.cache.GetInstancesForNodeGroup(s.nodePool.Id())) } func (s *ManagerTestSuite) TestSetNodeGroupSize_OK() { @@ -346,11 +341,6 @@ func (s *ManagerTestSuite) TestSetNodeGroupSize_OK() { size, found := s.manager.cache.GetNodeGroupSize(s.nodePool.Id()) s.True(found) s.Equal(2, size) - expectInstances := []cloudprovider.Instance{ - convertToInstance(newKubernetesNode("node-1", K8sNodeStateReady)), - convertToInstance(newKubernetesNode("node-2", K8sNodeStateReady)), - } - s.ElementsMatch(expectInstances, s.manager.cache.GetInstancesForNodeGroup(s.nodePool.Id())) } func (s *ManagerTestSuite) TestGetInstancesForNodeGroup_Error() { @@ -381,24 +371,6 @@ func (s *ManagerTestSuite) TestGetInstancesForNodeGroup_RefreshOK() { s.ElementsMatch(expectInstances, instances) } -func (s *ManagerTestSuite) TestGetInstancesForNodeGroup_CachedOK() { - s.manager.cache.AddNodeGroup(s.nodePool) - s.manager.cache.SetInstancesCacheForNodeGroup(s.nodePool.Id(), []cloudprovider.Instance{ - newInstanceWithState("node-1", cloudprovider.InstanceRunning), - newInstanceWithState("node-2", cloudprovider.InstanceRunning), - newInstanceWithState("node-3", cloudprovider.InstanceCreating), - }) - - expectInstances := []cloudprovider.Instance{ - newInstanceWithState("node-1", cloudprovider.InstanceRunning), - newInstanceWithState("node-2", cloudprovider.InstanceRunning), - newInstanceWithState("node-3", cloudprovider.InstanceCreating), - } - instances, err := s.manager.GetInstancesForNodeGroup(s.nodePool) - s.NoError(err) - s.ElementsMatch(expectInstances, instances) -} - func (s *ManagerTestSuite) TestGetNodeGroupForNode_NoMatchingNodes() { s.Nil(s.manager.GetNodeGroupForNode(newAPINode("node-1"))) } @@ -548,10 +520,6 @@ func (s *ManagerTestSuite) TestInitExplicitNodeGroups_OK() { size, found = s.manager.cache.GetNodeGroupSize(id) s.True(found) s.Equal(2, size) - s.ElementsMatch([]cloudprovider.Instance{ - newInstanceWithState("node-1", cloudprovider.InstanceRunning), - newInstanceWithState("node-2", cloudprovider.InstanceRunning), - }, s.manager.cache.GetInstances()) } func (s *ManagerTestSuite) TestRefresh_Error() { @@ -570,10 +538,5 @@ func (s *ManagerTestSuite) TestRefresh_OK() { }, nil).Once() s.manager.cache.AddNodeGroup(&nodePool{id: "test", min: 1, max: 3}) - s.Empty(s.manager.cache.GetInstances()) s.NoError(s.manager.Refresh()) - s.ElementsMatch([]cloudprovider.Instance{ - newInstanceWithState("1", cloudprovider.InstanceRunning), - newInstanceWithState("2", cloudprovider.InstanceCreating), - }, s.manager.cache.GetInstances()) } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/mock_api_client_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/mock_api_client_test.go index b92841cadde6..15a9510261c1 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/mock_api_client_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/mock_api_client_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by mockery v2.3.0. DO NOT EDIT. +// Code generated by mockery 2.12.1. DO NOT EDIT. package ionoscloud @@ -22,7 +22,9 @@ import ( context "context" mock "github.com/stretchr/testify/mock" - ionossdk "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" + ionos_cloud_sdk_go "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" + + testing "testing" ) // MockAPIClient is an autogenerated mock type for the APIClient type @@ -31,41 +33,41 @@ type MockAPIClient struct { } // K8sNodepoolsFindById provides a mock function with given fields: ctx, k8sClusterId, nodepoolId -func (_m *MockAPIClient) K8sNodepoolsFindById(ctx context.Context, k8sClusterId string, nodepoolId string) ionossdk.ApiK8sNodepoolsFindByIdRequest { +func (_m *MockAPIClient) K8sNodepoolsFindById(ctx context.Context, k8sClusterId string, nodepoolId string) ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest { ret := _m.Called(ctx, k8sClusterId, nodepoolId) - var r0 ionossdk.ApiK8sNodepoolsFindByIdRequest - if rf, ok := ret.Get(0).(func(context.Context, string, string) ionossdk.ApiK8sNodepoolsFindByIdRequest); ok { + var r0 ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest); ok { r0 = rf(ctx, k8sClusterId, nodepoolId) } else { - r0 = ret.Get(0).(ionossdk.ApiK8sNodepoolsFindByIdRequest) + r0 = ret.Get(0).(ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest) } return r0 } // K8sNodepoolsFindByIdExecute provides a mock function with given fields: r -func (_m *MockAPIClient) K8sNodepoolsFindByIdExecute(r ionossdk.ApiK8sNodepoolsFindByIdRequest) (ionossdk.KubernetesNodePool, *ionossdk.APIResponse, error) { +func (_m *MockAPIClient) K8sNodepoolsFindByIdExecute(r ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest) (ionos_cloud_sdk_go.KubernetesNodePool, *ionos_cloud_sdk_go.APIResponse, error) { ret := _m.Called(r) - var r0 ionossdk.KubernetesNodePool - if rf, ok := ret.Get(0).(func(ionossdk.ApiK8sNodepoolsFindByIdRequest) ionossdk.KubernetesNodePool); ok { + var r0 ionos_cloud_sdk_go.KubernetesNodePool + if rf, ok := ret.Get(0).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest) ionos_cloud_sdk_go.KubernetesNodePool); ok { r0 = rf(r) } else { - r0 = ret.Get(0).(ionossdk.KubernetesNodePool) + r0 = ret.Get(0).(ionos_cloud_sdk_go.KubernetesNodePool) } - var r1 *ionossdk.APIResponse - if rf, ok := ret.Get(1).(func(ionossdk.ApiK8sNodepoolsFindByIdRequest) *ionossdk.APIResponse); ok { + var r1 *ionos_cloud_sdk_go.APIResponse + if rf, ok := ret.Get(1).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest) *ionos_cloud_sdk_go.APIResponse); ok { r1 = rf(r) } else { if ret.Get(1) != nil { - r1 = ret.Get(1).(*ionossdk.APIResponse) + r1 = ret.Get(1).(*ionos_cloud_sdk_go.APIResponse) } } var r2 error - if rf, ok := ret.Get(2).(func(ionossdk.ApiK8sNodepoolsFindByIdRequest) error); ok { + if rf, ok := ret.Get(2).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsFindByIdRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -75,87 +77,78 @@ func (_m *MockAPIClient) K8sNodepoolsFindByIdExecute(r ionossdk.ApiK8sNodepoolsF } // K8sNodepoolsNodesDelete provides a mock function with given fields: ctx, k8sClusterId, nodepoolId, nodeId -func (_m *MockAPIClient) K8sNodepoolsNodesDelete(ctx context.Context, k8sClusterId string, nodepoolId string, nodeId string) ionossdk.ApiK8sNodepoolsNodesDeleteRequest { +func (_m *MockAPIClient) K8sNodepoolsNodesDelete(ctx context.Context, k8sClusterId string, nodepoolId string, nodeId string) ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest { ret := _m.Called(ctx, k8sClusterId, nodepoolId, nodeId) - var r0 ionossdk.ApiK8sNodepoolsNodesDeleteRequest - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ionossdk.ApiK8sNodepoolsNodesDeleteRequest); ok { + var r0 ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest); ok { r0 = rf(ctx, k8sClusterId, nodepoolId, nodeId) } else { - r0 = ret.Get(0).(ionossdk.ApiK8sNodepoolsNodesDeleteRequest) + r0 = ret.Get(0).(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest) } return r0 } // K8sNodepoolsNodesDeleteExecute provides a mock function with given fields: r -func (_m *MockAPIClient) K8sNodepoolsNodesDeleteExecute(r ionossdk.ApiK8sNodepoolsNodesDeleteRequest) (map[string]interface{}, *ionossdk.APIResponse, error) { +func (_m *MockAPIClient) K8sNodepoolsNodesDeleteExecute(r ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest) (*ionos_cloud_sdk_go.APIResponse, error) { ret := _m.Called(r) - var r0 map[string]interface{} - if rf, ok := ret.Get(0).(func(ionossdk.ApiK8sNodepoolsNodesDeleteRequest) map[string]interface{}); ok { + var r0 *ionos_cloud_sdk_go.APIResponse + if rf, ok := ret.Get(0).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest) *ionos_cloud_sdk_go.APIResponse); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]interface{}) + r0 = ret.Get(0).(*ionos_cloud_sdk_go.APIResponse) } } - var r1 *ionossdk.APIResponse - if rf, ok := ret.Get(1).(func(ionossdk.ApiK8sNodepoolsNodesDeleteRequest) *ionossdk.APIResponse); ok { + var r1 error + if rf, ok := ret.Get(1).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesDeleteRequest) error); ok { r1 = rf(r) } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*ionossdk.APIResponse) - } - } - - var r2 error - if rf, ok := ret.Get(2).(func(ionossdk.ApiK8sNodepoolsNodesDeleteRequest) error); ok { - r2 = rf(r) - } else { - r2 = ret.Error(2) + r1 = ret.Error(1) } - return r0, r1, r2 + return r0, r1 } // K8sNodepoolsNodesGet provides a mock function with given fields: ctx, k8sClusterId, nodepoolId -func (_m *MockAPIClient) K8sNodepoolsNodesGet(ctx context.Context, k8sClusterId string, nodepoolId string) ionossdk.ApiK8sNodepoolsNodesGetRequest { +func (_m *MockAPIClient) K8sNodepoolsNodesGet(ctx context.Context, k8sClusterId string, nodepoolId string) ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest { ret := _m.Called(ctx, k8sClusterId, nodepoolId) - var r0 ionossdk.ApiK8sNodepoolsNodesGetRequest - if rf, ok := ret.Get(0).(func(context.Context, string, string) ionossdk.ApiK8sNodepoolsNodesGetRequest); ok { + var r0 ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest); ok { r0 = rf(ctx, k8sClusterId, nodepoolId) } else { - r0 = ret.Get(0).(ionossdk.ApiK8sNodepoolsNodesGetRequest) + r0 = ret.Get(0).(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest) } return r0 } // K8sNodepoolsNodesGetExecute provides a mock function with given fields: r -func (_m *MockAPIClient) K8sNodepoolsNodesGetExecute(r ionossdk.ApiK8sNodepoolsNodesGetRequest) (ionossdk.KubernetesNodes, *ionossdk.APIResponse, error) { +func (_m *MockAPIClient) K8sNodepoolsNodesGetExecute(r ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest) (ionos_cloud_sdk_go.KubernetesNodes, *ionos_cloud_sdk_go.APIResponse, error) { ret := _m.Called(r) - var r0 ionossdk.KubernetesNodes - if rf, ok := ret.Get(0).(func(ionossdk.ApiK8sNodepoolsNodesGetRequest) ionossdk.KubernetesNodes); ok { + var r0 ionos_cloud_sdk_go.KubernetesNodes + if rf, ok := ret.Get(0).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest) ionos_cloud_sdk_go.KubernetesNodes); ok { r0 = rf(r) } else { - r0 = ret.Get(0).(ionossdk.KubernetesNodes) + r0 = ret.Get(0).(ionos_cloud_sdk_go.KubernetesNodes) } - var r1 *ionossdk.APIResponse - if rf, ok := ret.Get(1).(func(ionossdk.ApiK8sNodepoolsNodesGetRequest) *ionossdk.APIResponse); ok { + var r1 *ionos_cloud_sdk_go.APIResponse + if rf, ok := ret.Get(1).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest) *ionos_cloud_sdk_go.APIResponse); ok { r1 = rf(r) } else { if ret.Get(1) != nil { - r1 = ret.Get(1).(*ionossdk.APIResponse) + r1 = ret.Get(1).(*ionos_cloud_sdk_go.APIResponse) } } var r2 error - if rf, ok := ret.Get(2).(func(ionossdk.ApiK8sNodepoolsNodesGetRequest) error); ok { + if rf, ok := ret.Get(2).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsNodesGetRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -165,41 +158,41 @@ func (_m *MockAPIClient) K8sNodepoolsNodesGetExecute(r ionossdk.ApiK8sNodepoolsN } // K8sNodepoolsPut provides a mock function with given fields: ctx, k8sClusterId, nodepoolId -func (_m *MockAPIClient) K8sNodepoolsPut(ctx context.Context, k8sClusterId string, nodepoolId string) ionossdk.ApiK8sNodepoolsPutRequest { +func (_m *MockAPIClient) K8sNodepoolsPut(ctx context.Context, k8sClusterId string, nodepoolId string) ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest { ret := _m.Called(ctx, k8sClusterId, nodepoolId) - var r0 ionossdk.ApiK8sNodepoolsPutRequest - if rf, ok := ret.Get(0).(func(context.Context, string, string) ionossdk.ApiK8sNodepoolsPutRequest); ok { + var r0 ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest); ok { r0 = rf(ctx, k8sClusterId, nodepoolId) } else { - r0 = ret.Get(0).(ionossdk.ApiK8sNodepoolsPutRequest) + r0 = ret.Get(0).(ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest) } return r0 } // K8sNodepoolsPutExecute provides a mock function with given fields: r -func (_m *MockAPIClient) K8sNodepoolsPutExecute(r ionossdk.ApiK8sNodepoolsPutRequest) (ionossdk.KubernetesNodePoolForPut, *ionossdk.APIResponse, error) { +func (_m *MockAPIClient) K8sNodepoolsPutExecute(r ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest) (ionos_cloud_sdk_go.KubernetesNodePool, *ionos_cloud_sdk_go.APIResponse, error) { ret := _m.Called(r) - var r0 ionossdk.KubernetesNodePoolForPut - if rf, ok := ret.Get(0).(func(ionossdk.ApiK8sNodepoolsPutRequest) ionossdk.KubernetesNodePoolForPut); ok { + var r0 ionos_cloud_sdk_go.KubernetesNodePool + if rf, ok := ret.Get(0).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest) ionos_cloud_sdk_go.KubernetesNodePool); ok { r0 = rf(r) } else { - r0 = ret.Get(0).(ionossdk.KubernetesNodePoolForPut) + r0 = ret.Get(0).(ionos_cloud_sdk_go.KubernetesNodePool) } - var r1 *ionossdk.APIResponse - if rf, ok := ret.Get(1).(func(ionossdk.ApiK8sNodepoolsPutRequest) *ionossdk.APIResponse); ok { + var r1 *ionos_cloud_sdk_go.APIResponse + if rf, ok := ret.Get(1).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest) *ionos_cloud_sdk_go.APIResponse); ok { r1 = rf(r) } else { if ret.Get(1) != nil { - r1 = ret.Get(1).(*ionossdk.APIResponse) + r1 = ret.Get(1).(*ionos_cloud_sdk_go.APIResponse) } } var r2 error - if rf, ok := ret.Get(2).(func(ionossdk.ApiK8sNodepoolsPutRequest) error); ok { + if rf, ok := ret.Get(2).(func(ionos_cloud_sdk_go.ApiK8sNodepoolsPutRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -207,3 +200,13 @@ func (_m *MockAPIClient) K8sNodepoolsPutExecute(r ionossdk.ApiK8sNodepoolsPutReq return r0, r1, r2 } + +// NewMockAPIClient creates a new instance of MockAPIClient. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockAPIClient(t testing.TB) *MockAPIClient { + mock := &MockAPIClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/mock_ionos_cloud_manager_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/mock_ionos_cloud_manager_test.go index 63d1a45e3d75..95099fcaf349 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/mock_ionos_cloud_manager_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/mock_ionos_cloud_manager_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by mockery v2.3.0. DO NOT EDIT. +// Code generated by mockery 2.12.1. DO NOT EDIT. package ionoscloud @@ -22,6 +22,8 @@ import ( mock "github.com/stretchr/testify/mock" cloudprovider "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + testing "testing" + v1 "k8s.io/api/core/v1" ) @@ -173,3 +175,13 @@ func (_m *MockIonosCloudManager) TryLockNodeGroup(nodeGroup cloudprovider.NodeGr func (_m *MockIonosCloudManager) UnlockNodeGroup(nodeGroup cloudprovider.NodeGroup) { _m.Called(nodeGroup) } + +// NewMockIonosCloudManager creates a new instance of MockIonosCloudManager. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockIonosCloudManager(t testing.TB) *MockIonosCloudManager { + mock := &MockIonosCloudManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/utils.go b/cluster-autoscaler/cloudprovider/ionoscloud/utils.go index 527e4a5f6fd5..a153745a3274 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/utils.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/utils.go @@ -32,6 +32,8 @@ const ( ErrorCodeUnknownState = "UNKNOWN_STATE" ) +var errMissingNodeID = fmt.Errorf("missing node ID") + // convertToInstanceId converts an IonosCloud kubernetes node Id to a cloudprovider.Instance Id. func convertToInstanceId(nodeId string) string { return fmt.Sprintf("%s%s", ProviderIdPrefix, nodeId) @@ -43,29 +45,36 @@ func convertToNodeId(providerId string) string { } // convertToInstances converts a list IonosCloud kubernetes nodes to a list of cloudprovider.Instances. -func convertToInstances(nodes *ionos.KubernetesNodes) []cloudprovider.Instance { - instances := make([]cloudprovider.Instance, 0, len(*nodes.Items)) - for _, node := range *nodes.Items { - instances = append(instances, convertToInstance(node)) +func convertToInstances(nodes []ionos.KubernetesNode) ([]cloudprovider.Instance, error) { + instances := make([]cloudprovider.Instance, 0, len(nodes)) + for _, node := range nodes { + instance, err := convertToInstance(node) + if err != nil { + return nil, err + } + instances = append(instances, instance) } - return instances + return instances, nil } // to Instance converts an IonosCloud kubernetes node to a cloudprovider.Instance. -func convertToInstance(node ionos.KubernetesNode) cloudprovider.Instance { +func convertToInstance(node ionos.KubernetesNode) (cloudprovider.Instance, error) { + if node.Id == nil { + return cloudprovider.Instance{}, errMissingNodeID + } return cloudprovider.Instance{ Id: convertToInstanceId(*node.Id), Status: convertToInstanceStatus(*node.Metadata.State), - } + }, nil } // convertToInstanceStatus converts an IonosCloud kubernetes node state to a *cloudprovider.InstanceStatus. func convertToInstanceStatus(nodeState string) *cloudprovider.InstanceStatus { st := &cloudprovider.InstanceStatus{} switch nodeState { - case K8sNodeStateProvisioning, K8sNodeStateProvisioned, K8sNodeStateRebuilding: + case K8sNodeStateProvisioning, K8sNodeStateProvisioned: st.State = cloudprovider.InstanceCreating - case K8sNodeStateTerminating: + case K8sNodeStateTerminating, K8sNodeStateRebuilding: st.State = cloudprovider.InstanceDeleting case K8sNodeStateReady: st.State = cloudprovider.InstanceRunning diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/utils_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/utils_test.go index 17abdc622940..150483eac911 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/utils_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/utils_test.go @@ -87,7 +87,7 @@ var ( }, { Id: "ionos://3", Status: &cloudprovider.InstanceStatus{ - State: cloudprovider.InstanceCreating, + State: cloudprovider.InstanceDeleting, }, }, { Id: "ionos://4", @@ -123,13 +123,16 @@ func TestUtils_ConvertToNodeId(t *testing.T) { func TestUtils_ConvertToInstances(t *testing.T) { t.Run("Success", func(t *testing.T) { - in := ionos.KubernetesNodes{ - Items: &kubernetesNodes, - } want := cloudproviderInstances - got := convertToInstances(&in) + got, err := convertToInstances(kubernetesNodes) + require.NoError(t, err) require.Equal(t, want, got) }) + t.Run("Fail", func(t *testing.T) { + got, err := convertToInstances([]ionos.KubernetesNode{{}}) + require.ErrorIs(t, err, errMissingNodeID) + require.Empty(t, got) + }) } func TestUtils_ConvertToInstance(t *testing.T) { @@ -146,9 +149,14 @@ func TestUtils_ConvertToInstance(t *testing.T) { State: cloudprovider.InstanceRunning, }, } - got := convertToInstance(in) + got, err := convertToInstance(in) + require.NoError(t, err) require.Equal(t, want, got) }) + t.Run("Fail", func(t *testing.T) { + _, err := convertToInstance(ionos.KubernetesNode{}) + require.ErrorIs(t, err, errMissingNodeID) + }) } func TestUtils_ConvertToInstanceStatus(t *testing.T) { @@ -172,7 +180,7 @@ func TestUtils_ConvertToInstanceStatus(t *testing.T) { name: "success, ionos server rebuiling", in: K8sNodeStateRebuilding, want: &cloudprovider.InstanceStatus{ - State: cloudprovider.InstanceCreating, + State: cloudprovider.InstanceDeleting, }, }, { name: "success, ionos server terminating",