From c3428d71d6f60dee522faedc108fd6becb364c72 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Mon, 31 Jul 2023 11:32:51 +0200 Subject: [PATCH 1/9] chore: fix typo in example folder name (#200) * chore: fix typo in example folder name * chore: regenerate doc --- docs/resources/node_template.md | 8 +++++++- .../README.MD | 0 .../castai.tf | 0 .../eks.tf | 0 .../providers.tf | 0 .../tf.vars.example | 0 .../variables.tf | 0 .../versions.tf | 0 .../vpc.tf | 0 9 files changed, 7 insertions(+), 1 deletion(-) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/README.MD (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/castai.tf (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/eks.tf (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/providers.tf (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/tf.vars.example (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/variables.tf (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/versions.tf (100%) rename examples/eks/{eks_cluster_autoscaler_polices => eks_cluster_autoscaler_policies}/vpc.tf (100%) diff --git a/docs/resources/node_template.md b/docs/resources/node_template.md index ace80a31..c4c71058 100644 --- a/docs/resources/node_template.md +++ b/docs/resources/node_template.md @@ -28,6 +28,7 @@ CAST AI node template resource to manage node templates - `custom_label` (Block List, Max: 1, Deprecated) Custom label key/value to be added to nodes created from this template. (see [below for nested schema](#nestedblock--custom_label)) - `custom_labels` (Map of String) Custom labels to be added to nodes created from this template. If the field `custom_label` is present, the value of `custom_labels` will be ignored. - `custom_taints` (Block List) Custom taints to be added to the nodes created from this template. `shouldTaint` has to be `true` in order to create/update the node template with custom taints. If `shouldTaint` is `true`, but no custom taints are provided, the nodes will be tainted with the default node template taint. (see [below for nested schema](#nestedblock--custom_taints)) +- `is_default` (Boolean) Flag whether the node template is default. - `rebalancing_config_min_nodes` (Number) Minimum nodes that will be kept when rebalancing nodes using this node template. - `should_taint` (Boolean) Marks whether the templated nodes will have a taint. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) @@ -43,6 +44,7 @@ Optional: - `architectures` (List of String) List of acceptable instance CPU architectures, the default is amd64. Allowed values: amd64, arm64. - `compute_optimized` (Boolean) Compute optimized instance constraint - will only pick compute optimized nodes if true. +- `enable_spot_diversity` (Boolean) Enable/disable spot diversity policy. When enabled, autoscaler will try to balance between diverse and cost optimal instance types. - `fallback_restore_rate_seconds` (Number) Fallback restore rate in seconds: defines how much time should pass before spot fallback should be attempted to be restored to real spot. - `gpu` (Block List, Max: 1) (see [below for nested schema](#nestedblock--constraints--gpu)) - `instance_families` (Block List, Max: 1) (see [below for nested schema](#nestedblock--constraints--instance_families)) @@ -51,7 +53,11 @@ Optional: - `max_memory` (Number) Max Memory (Mib) per node. - `min_cpu` (Number) Min CPU cores per node. - `min_memory` (Number) Min Memory (Mib) per node. -- `spot` (Boolean) Spot instance constraint - true only spot, false only on-demand. +- `on_demand` (Boolean) Should include on-demand instances in the considered pool. +- `spot` (Boolean) Should include spot instances in the considered pool. +- `spot_diversity_price_increase_limit_percent` (Number) Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the optimal configuration. +- `spot_interruption_predictions_enabled` (Boolean) Enable/disable spot interruption predictions. +- `spot_interruption_predictions_type` (String) Spot interruption predictions type. Can be either "aws-rebalance-recommendations" or "interruption-predictions". - `storage_optimized` (Boolean) Storage optimized instance constraint - will only pick storage optimized nodes if true - `use_spot_fallbacks` (Boolean) Spot instance fallback constraint - when true, on-demand instances will be created, when spots are unavailable. diff --git a/examples/eks/eks_cluster_autoscaler_polices/README.MD b/examples/eks/eks_cluster_autoscaler_policies/README.MD similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/README.MD rename to examples/eks/eks_cluster_autoscaler_policies/README.MD diff --git a/examples/eks/eks_cluster_autoscaler_polices/castai.tf b/examples/eks/eks_cluster_autoscaler_policies/castai.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/castai.tf rename to examples/eks/eks_cluster_autoscaler_policies/castai.tf diff --git a/examples/eks/eks_cluster_autoscaler_polices/eks.tf b/examples/eks/eks_cluster_autoscaler_policies/eks.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/eks.tf rename to examples/eks/eks_cluster_autoscaler_policies/eks.tf diff --git a/examples/eks/eks_cluster_autoscaler_polices/providers.tf b/examples/eks/eks_cluster_autoscaler_policies/providers.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/providers.tf rename to examples/eks/eks_cluster_autoscaler_policies/providers.tf diff --git a/examples/eks/eks_cluster_autoscaler_polices/tf.vars.example b/examples/eks/eks_cluster_autoscaler_policies/tf.vars.example similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/tf.vars.example rename to examples/eks/eks_cluster_autoscaler_policies/tf.vars.example diff --git a/examples/eks/eks_cluster_autoscaler_polices/variables.tf b/examples/eks/eks_cluster_autoscaler_policies/variables.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/variables.tf rename to examples/eks/eks_cluster_autoscaler_policies/variables.tf diff --git a/examples/eks/eks_cluster_autoscaler_polices/versions.tf b/examples/eks/eks_cluster_autoscaler_policies/versions.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/versions.tf rename to examples/eks/eks_cluster_autoscaler_policies/versions.tf diff --git a/examples/eks/eks_cluster_autoscaler_polices/vpc.tf b/examples/eks/eks_cluster_autoscaler_policies/vpc.tf similarity index 100% rename from examples/eks/eks_cluster_autoscaler_polices/vpc.tf rename to examples/eks/eks_cluster_autoscaler_policies/vpc.tf From 798da1548cd457747d56739dff4f6aa862b8c09e Mon Sep 17 00:00:00 2001 From: Narunas Kapocius <36560566+Narunas-K@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:34:43 +0300 Subject: [PATCH 2/9] test: fix Acceptance test with providing routable subnets to Node Configurations (#204) * test: fix Acceptance test with providing routable subnets to Node Configurations --- castai/resource_node_configuration_eks_test.go | 18 +++++++----------- castai/resource_node_template_test.go | 8 +++++++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/castai/resource_node_configuration_eks_test.go b/castai/resource_node_configuration_eks_test.go index def32d7d..9415fe09 100644 --- a/castai/resource_node_configuration_eks_test.go +++ b/castai/resource_node_configuration_eks_test.go @@ -34,7 +34,7 @@ func TestAccResourceNodeConfiguration_eks(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "container_runtime", "DOCKERD"), resource.TestCheckResourceAttr(resourceName, "docker_config", "{\"insecure-registries\":[\"registry.com:5000\"],\"max-concurrent-downloads\":10}"), resource.TestCheckResourceAttr(resourceName, "kubelet_config", "{\"registryBurst\":20,\"registryPullQPS\":10}"), - resource.TestCheckResourceAttr(resourceName, "subnets.#", "2"), + resource.TestCheckResourceAttr(resourceName, "subnets.#", "3"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.env", "development"), resource.TestCheckResourceAttrSet(resourceName, "eks.0.instance_profile_arn"), @@ -100,7 +100,7 @@ resource "castai_node_configuration" "test" { cluster_id = castai_eks_cluster.test.id disk_cpu_ratio = 35 min_disk_size = 122 - subnets = aws_subnet.test[*].id + subnets = data.aws_subnets.core.ids init_script = base64encode(var.init_script) docker_config = jsonencode({ "insecure-registries" = ["registry.com:5000"], @@ -138,7 +138,7 @@ func testAccEKSNodeConfigurationUpdated(rName, clusterName string) string { resource "castai_node_configuration" "test" { name = %[1]q cluster_id = castai_eks_cluster.test.id - subnets = aws_subnet.test[*].id + subnets = data.aws_subnets.core.ids image = "amazon-eks-node-1.23-v20220824" container_runtime = "containerd" kubelet_config = jsonencode({ @@ -189,14 +189,10 @@ resource "aws_vpc" "test" { } } -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - map_public_ip_on_launch = true - vpc_id = aws_vpc.test.id - tags = { - Name = %[1]q - } +data "aws_subnets" "core" { + tags = { + Name = "*core-tf-acc-cluster/SubnetPublic*" + } } resource "aws_security_group" "test" { diff --git a/castai/resource_node_template_test.go b/castai/resource_node_template_test.go index 98d22716..70cd2985 100644 --- a/castai/resource_node_template_test.go +++ b/castai/resource_node_template_test.go @@ -425,11 +425,17 @@ func testAccCheckNodeTemplateDestroy(s *terraform.State) error { func testAccNodeConfig(rName string) string { return ConfigCompose(fmt.Sprintf(` +data "aws_subnets" "cost" { + tags = { + Name = "*cost-terraform-cluster/SubnetPublic*" + } +} + resource "castai_node_configuration" "test" { name = %[1]q cluster_id = castai_eks_cluster.test.id disk_cpu_ratio = 35 - subnets = aws_subnet.test[*].id + subnets = data.aws_subnets.cost.ids container_runtime = "dockerd" tags = { env = "development" From 0b057a366fa361d9f2c3d54e1831dbc7169ea6cf Mon Sep 17 00:00:00 2001 From: Jan Sykora Date: Tue, 1 Aug 2023 11:52:59 +0200 Subject: [PATCH 3/9] CO-2314: Remove default values for new fields (#201) --- castai/resource_node_template.go | 8 +++++--- castai/resource_node_template_test.go | 6 ++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/castai/resource_node_template.go b/castai/resource_node_template.go index 08333814..e00b430b 100644 --- a/castai/resource_node_template.go +++ b/castai/resource_node_template.go @@ -123,8 +123,8 @@ func resourceNodeTemplate() *schema.Resource { }, FieldNodeTemplateOnDemand: { Type: schema.TypeBool, - Default: false, Optional: true, + Computed: true, Description: "Should include on-demand instances in the considered pool.", }, FieldNodeTemplateUseSpotFallbacks: { @@ -147,7 +147,6 @@ func resourceNodeTemplate() *schema.Resource { }, FieldNodeTemplateSpotDiversityPriceIncreaseLimitPercent: { Type: schema.TypeInt, - Default: 20, Optional: true, Description: "Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the optimal configuration.", }, @@ -159,7 +158,6 @@ func resourceNodeTemplate() *schema.Resource { }, FieldNodeTemplateSpotInterruptionPredictionsType: { Type: schema.TypeString, - Default: "aws-rebalance-recommendations", Optional: true, Description: "Spot interruption predictions type. Can be either \"aws-rebalance-recommendations\" or \"interruption-predictions\".", ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"aws-rebalance-recommendations", "interruption-predictions"}, false)), @@ -882,6 +880,10 @@ func toTemplateConstraints(obj map[string]any) *sdk.NodetemplatesV1TemplateConst } if v, ok := obj[FieldNodeTemplateOnDemand].(bool); ok { out.OnDemand = toPtr(v) + } else { + if v, ok := obj[FieldNodeTemplateSpot].(bool); ok { + out.Spot = toPtr(!v) + } } if v, ok := obj[FieldNodeTemplateStorageOptimized].(bool); ok { out.StorageOptimized = toPtr(v) diff --git a/castai/resource_node_template_test.go b/castai/resource_node_template_test.go index 70cd2985..7b0dc8ec 100644 --- a/castai/resource_node_template_test.go +++ b/castai/resource_node_template_test.go @@ -244,10 +244,10 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "constraints.0.max_cpu", "100"), resource.TestCheckResourceAttr(resourceName, "constraints.0.use_spot_fallbacks", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot", "true"), + resource.TestCheckResourceAttr(resourceName, "constraints.0.on_demand", "false"), resource.TestCheckResourceAttr(resourceName, "constraints.0.architectures.#", "1"), resource.TestCheckResourceAttr(resourceName, "constraints.0.architectures.0", "amd64"), resource.TestCheckResourceAttr(resourceName, "is_default", "false"), - resource.TestCheckResourceAttr(resourceName, "constraints.0.on_demand", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.enable_spot_diversity", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot_diversity_price_increase_limit_percent", "21"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot_interruption_predictions_enabled", "true"), @@ -278,6 +278,7 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "custom_taints.0.value", "custom-taint-value-1"), resource.TestCheckResourceAttr(resourceName, "constraints.0.use_spot_fallbacks", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot", "true"), + resource.TestCheckResourceAttr(resourceName, "constraints.0.on_demand", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.instance_families.#", "0"), resource.TestCheckResourceAttr(resourceName, "constraints.0.gpu.0.manufacturers.#", "0"), resource.TestCheckResourceAttr(resourceName, "constraints.0.gpu.0.include_names.#", "0"), @@ -285,11 +286,9 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "constraints.0.min_cpu", "0"), resource.TestCheckResourceAttr(resourceName, "constraints.0.max_cpu", "0"), resource.TestCheckResourceAttr(resourceName, "constraints.0.use_spot_fallbacks", "true"), - resource.TestCheckResourceAttr(resourceName, "constraints.0.spot", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.architectures.#", "1"), resource.TestCheckResourceAttr(resourceName, "constraints.0.architectures.0", "arm64"), resource.TestCheckResourceAttr(resourceName, "is_default", "false"), - resource.TestCheckResourceAttr(resourceName, "constraints.0.on_demand", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.enable_spot_diversity", "true"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot_diversity_price_increase_limit_percent", "22"), resource.TestCheckResourceAttr(resourceName, "constraints.0.spot_interruption_predictions_enabled", "true"), @@ -334,7 +333,6 @@ func testAccNodeTemplateConfig(rName, clusterName string) string { constraints { fallback_restore_rate_seconds = 1800 spot = true - on_demand = true enable_spot_diversity = true spot_diversity_price_increase_limit_percent = 21 spot_interruption_predictions_enabled = true From 64cc8753132edc4a99ccc479fd737dce5d4547ea Mon Sep 17 00:00:00 2001 From: apasyniuk <58225282+apasyniuk@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:54:35 +0200 Subject: [PATCH 4/9] Apply wait for cluster ready options in examples (#205) --- examples/aks/aks_cluster/castai.tf | 2 ++ examples/aks/aks_cluster_autoscaler_policies/castai.tf | 4 +++- examples/aks/aks_cluster_azure_cni/castai.tf | 2 ++ examples/eks/eks_cluster_assumerole/castai.tf | 2 ++ examples/eks/eks_cluster_autoscaler_policies/castai.tf | 2 ++ examples/eks/eks_cluster_custom_iam/castai.tf | 2 ++ examples/gke/gke_cluster_autoscaler_policies/castai.tf | 2 ++ examples/gke/gke_cluster_zonal_autoscaler/castai.tf | 2 ++ 8 files changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/aks/aks_cluster/castai.tf b/examples/aks/aks_cluster/castai.tf index aa1036d6..6726ef93 100644 --- a/examples/aks/aks_cluster/castai.tf +++ b/examples/aks/aks_cluster/castai.tf @@ -22,6 +22,8 @@ module "castai-aks-cluster" { source = "castai/aks/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aks_cluster_name = var.cluster_name aks_cluster_region = var.cluster_region diff --git a/examples/aks/aks_cluster_autoscaler_policies/castai.tf b/examples/aks/aks_cluster_autoscaler_policies/castai.tf index 98608231..56f1f837 100644 --- a/examples/aks/aks_cluster_autoscaler_policies/castai.tf +++ b/examples/aks/aks_cluster_autoscaler_policies/castai.tf @@ -21,7 +21,9 @@ provider "helm" { module "castai-aks-cluster" { source = "castai/aks/castai" - api_url = var.castai_api_url + api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aks_cluster_name = var.cluster_name aks_cluster_region = var.cluster_region diff --git a/examples/aks/aks_cluster_azure_cni/castai.tf b/examples/aks/aks_cluster_azure_cni/castai.tf index a7114e76..9102c8dd 100644 --- a/examples/aks/aks_cluster_azure_cni/castai.tf +++ b/examples/aks/aks_cluster_azure_cni/castai.tf @@ -22,6 +22,8 @@ module "castai-aks-cluster" { source = "castai/aks/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aks_cluster_name = var.cluster_name aks_cluster_region = var.cluster_region diff --git a/examples/eks/eks_cluster_assumerole/castai.tf b/examples/eks/eks_cluster_assumerole/castai.tf index c587ed2b..687e3424 100644 --- a/examples/eks/eks_cluster_assumerole/castai.tf +++ b/examples/eks/eks_cluster_assumerole/castai.tf @@ -53,6 +53,8 @@ resource "castai_eks_clusterid" "cluster_id" { module "castai-eks-cluster" { source = "castai/eks-cluster/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aws_account_id = data.aws_caller_identity.current.account_id aws_cluster_region = var.cluster_region diff --git a/examples/eks/eks_cluster_autoscaler_policies/castai.tf b/examples/eks/eks_cluster_autoscaler_policies/castai.tf index 5f6d9794..eb39ee07 100644 --- a/examples/eks/eks_cluster_autoscaler_policies/castai.tf +++ b/examples/eks/eks_cluster_autoscaler_policies/castai.tf @@ -55,6 +55,8 @@ module "castai-eks-cluster" { source = "castai/eks-cluster/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aws_account_id = data.aws_caller_identity.current.account_id aws_cluster_region = var.cluster_region diff --git a/examples/eks/eks_cluster_custom_iam/castai.tf b/examples/eks/eks_cluster_custom_iam/castai.tf index 61439fb1..596aab3d 100644 --- a/examples/eks/eks_cluster_custom_iam/castai.tf +++ b/examples/eks/eks_cluster_custom_iam/castai.tf @@ -37,6 +37,8 @@ module "castai-eks-cluster" { source = "castai/eks-cluster/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true aws_account_id = data.aws_caller_identity.current.account_id aws_cluster_region = var.cluster_region diff --git a/examples/gke/gke_cluster_autoscaler_policies/castai.tf b/examples/gke/gke_cluster_autoscaler_policies/castai.tf index e5a92aa9..17fdcc79 100644 --- a/examples/gke/gke_cluster_autoscaler_policies/castai.tf +++ b/examples/gke/gke_cluster_autoscaler_policies/castai.tf @@ -29,6 +29,8 @@ module "castai-gke-cluster" { source = "castai/gke-cluster/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true project_id = var.project_id gke_cluster_name = var.cluster_name diff --git a/examples/gke/gke_cluster_zonal_autoscaler/castai.tf b/examples/gke/gke_cluster_zonal_autoscaler/castai.tf index 9b1ced66..53f588d1 100644 --- a/examples/gke/gke_cluster_zonal_autoscaler/castai.tf +++ b/examples/gke/gke_cluster_zonal_autoscaler/castai.tf @@ -29,6 +29,8 @@ module "castai-gke-cluster" { source = "castai/gke-cluster/castai" api_url = var.castai_api_url + castai_api_token = var.castai_api_token + wait_for_cluster_ready = true project_id = var.project_id gke_cluster_name = var.cluster_name gke_cluster_location = module.gke.location From 1e5369e9bd87ed2bf998c5b788c9f5de8a589a29 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Tue, 1 Aug 2023 15:23:50 +0200 Subject: [PATCH 5/9] chore: tests example against different tf versions (#206) * chore: tests example against different tf versions * chore: trigger CI * chore: don't allow to run build more then 1 * Update examples/aks/aks_cluster_autoscaler_policies/README.MD Co-authored-by: Jakub Burghardt --------- Co-authored-by: Jakub Burghardt --- .github/workflows/build.yml | 6 ++++++ .github/workflows/examples.yml | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89720d63..930d88ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,10 @@ name: Build + +# Only one instance of this job can be running +concurrency: + group: build-and-test + cancel-in-progress: true + on: pull_request: branches: [ '*' ] diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d9f3fd62..0a76f7bc 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,6 +7,9 @@ on: - 'examples/**' jobs: terraform_validation: + strategy: + matrix: + version: [1.0, 1.2, 1.3, 1.4, latest] runs-on: ubuntu-latest steps: @@ -15,7 +18,12 @@ jobs: - name: Set up Terraform uses: hashicorp/setup-terraform@v2 + with: + terraform_version: ${{ matrix.version }} + + - name: Print tf version + run: terraform version - name: Validate Terraform examples id: validate_examples - run: make validate-terraform-examples \ No newline at end of file + run: make validate-terraform-examples From 88b6ed430e3277ffb3afa78f7190980f68a84dfa Mon Sep 17 00:00:00 2001 From: Jan Sykora Date: Thu, 3 Aug 2023 11:34:48 +0200 Subject: [PATCH 6/9] Skip deletion of default node template + Add is_enabled flat to node template (#207) * feat: Skip deletion of default node template * feat: Add is_enabled flat to node template --- castai/resource_node_template.go | 31 +++++++++++ castai/resource_node_template_test.go | 76 +++++++++++++++++++++++++++ docs/resources/node_template.md | 1 + 3 files changed, 108 insertions(+) diff --git a/castai/resource_node_template.go b/castai/resource_node_template.go index e00b430b..4f3dc980 100644 --- a/castai/resource_node_template.go +++ b/castai/resource_node_template.go @@ -33,6 +33,7 @@ const ( FieldNodeTemplateIncludeNames = "include_names" FieldNodeTemplateInstanceFamilies = "instance_families" FieldNodeTemplateIsDefault = "is_default" + FieldNodeTemplateIsEnabled = "is_enabled" FieldNodeTemplateIsGpuOnly = "is_gpu_only" FieldNodeTemplateManufacturers = "manufacturers" FieldNodeTemplateMaxCount = "max_count" @@ -92,6 +93,12 @@ func resourceNodeTemplate() *schema.Resource { ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace), Description: "Name of the node template.", }, + FieldNodeTemplateIsEnabled: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Flag whether the node template is enabled and considered for autoscaling.", + }, FieldNodeTemplateIsDefault: { Type: schema.TypeBool, Optional: true, @@ -390,6 +397,9 @@ func resourceNodeTemplateRead(ctx context.Context, d *schema.ResourceData, meta if err := d.Set(FieldNodeTemplateName, nodeTemplate.Name); err != nil { return diag.FromErr(fmt.Errorf("setting name: %w", err)) } + if err := d.Set(FieldNodeTemplateIsEnabled, nodeTemplate.IsEnabled); err != nil { + return diag.FromErr(fmt.Errorf("setting is enabled: %w", err)) + } if err := d.Set(FieldNodeTemplateIsDefault, nodeTemplate.IsDefault); err != nil { return diag.FromErr(fmt.Errorf("setting is default: %w", err)) } @@ -535,6 +545,18 @@ func resourceNodeTemplateDelete(ctx context.Context, d *schema.ResourceData, met clusterID := d.Get(FieldClusterID).(string) name := d.Get(FieldNodeTemplateName).(string) + if isDefault, ok := d.Get(FieldNodeTemplateIsDefault).(bool); ok && isDefault { + return diag.Diagnostics{ + { + Severity: diag.Warning, + Summary: fmt.Sprintf("Skipping delete of \"%s\" node template", name), + Detail: "Default node templates cannot be deleted from CAST.ai. If you want to autoscaler to stop " + + "considering this node template, you can disable it (either from UI or by setting `is_enabled` " + + "flag to false).", + }, + } + } + resp, err := client.NodeTemplatesAPIDeleteNodeTemplateWithResponse(ctx, clusterID, name) if checkErr := sdk.CheckOKResponse(resp, err); checkErr != nil { return diag.FromErr(checkErr) @@ -554,6 +576,7 @@ func resourceNodeTemplateUpdate(ctx context.Context, d *schema.ResourceData, met FieldNodeTemplateCustomTaints, FieldNodeTemplateCustomInstancesEnabled, FieldNodeTemplateConstraints, + FieldNodeTemplateIsEnabled, ) { log.Printf("[INFO] Nothing to update in node configuration") return nil @@ -568,6 +591,10 @@ func resourceNodeTemplateUpdate(ctx context.Context, d *schema.ResourceData, met req.IsDefault = toPtr(v.(bool)) } + if v, ok := d.GetOk(FieldNodeTemplateIsEnabled); ok { + req.IsEnabled = toPtr(v.(bool)) + } + if v, ok := d.GetOk(FieldNodeTemplateConfigurationId); ok { req.ConfigurationId = toPtr(v.(string)) } @@ -639,6 +666,10 @@ func resourceNodeTemplateCreate(ctx context.Context, d *schema.ResourceData, met ShouldTaint: lo.ToPtr(d.Get(FieldNodeTemplateShouldTaint).(bool)), } + if v, ok := d.GetOk(FieldNodeTemplateIsEnabled); ok { + req.IsEnabled = lo.ToPtr(v.(bool)) + } + if v, ok := d.Get(FieldNodeTemplateRebalancingConfigMinNodes).(int32); ok { req.RebalancingConfig = &sdk.NodetemplatesV1RebalancingConfiguration{ MinNodes: lo.ToPtr(v), diff --git a/castai/resource_node_template_test.go b/castai/resource_node_template_test.go index 7b0dc8ec..6d931359 100644 --- a/castai/resource_node_template_test.go +++ b/castai/resource_node_template_test.go @@ -12,6 +12,7 @@ import ( "github.com/golang/mock/gomock" "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -41,6 +42,7 @@ func TestNodeTemplateResourceReadContext(t *testing.T) { "template": { "configurationId": "7dc4f922-29c9-4377-889c-0c8c5fb8d497", "configurationName": "default", + "isEnabled": true, "name": "gpu", "constraints": { "spot": false, @@ -171,6 +173,7 @@ custom_taints.1.effect = NoSchedule custom_taints.1.key = some-key-2 custom_taints.1.value = some-value-2 is_default = false +is_enabled = true name = gpu rebalancing_config_min_nodes = 0 should_taint = true @@ -211,6 +214,77 @@ func TestNodeTemplateResourceReadContextEmptyList(t *testing.T) { r.Equal(result[0].Summary, "failed to find node template with name: gpu") } +func TestNodeTemplateResourceDelete_defaultNodeTemplate(t *testing.T) { + r := require.New(t) + mockctrl := gomock.NewController(t) + mockClient := mock_sdk.NewMockClientInterface(mockctrl) + + ctx := context.Background() + provider := &ProviderConfig{ + api: &sdk.ClientWithResponses{ + ClientInterface: mockClient, + }, + } + + clusterId := "b6bfc074-a267-400f-b8f1-db0850c369b1" + body := io.NopCloser(bytes.NewReader([]byte(` + { + "items": [ + { + "template": { + "configurationId": "7dc4f922-29c9-4377-889c-0c8c5fb8d497", + "configurationName": "default", + "name": "default-by-castai", + "isEnabled": true, + "isDefault": true, + "constraints": { + "spot": false, + "onDemand": true, + "minCpu": 10, + "maxCpu": 10000, + "architectures": ["amd64", "arm64"] + }, + "version": "3", + "shouldTaint": true, + "customLabels": {}, + "customTaints": [], + "rebalancingConfig": { + "minNodes": 0 + }, + "customInstancesEnabled": true + } + } + ] + } + `))) + mockClient.EXPECT(). + NodeTemplatesAPIListNodeTemplates(gomock.Any(), clusterId, &sdk.NodeTemplatesAPIListNodeTemplatesParams{IncludeDefault: lo.ToPtr(true)}). + Return(&http.Response{StatusCode: 200, Body: body, Header: map[string][]string{"Content-Type": {"json"}}}, nil) + + resource := resourceNodeTemplate() + val := cty.ObjectVal(map[string]cty.Value{ + FieldClusterId: cty.StringVal(clusterId), + FieldNodeTemplateName: cty.StringVal("default-by-castai"), + }) + state := terraform.NewInstanceStateShimmedFromValue(val, 0) + state.ID = "default-by-castai" + + data := resource.Data(state) + result := resource.ReadContext(ctx, data, provider) + r.Nil(result) + r.False(result.HasError()) + + result = resource.DeleteContext(ctx, data, provider) + r.NotNil(result) + r.Len(result, 1) + r.False(result.HasError()) + r.Equal(diag.Warning, result[0].Severity) + r.Equal("Skipping delete of \"default-by-castai\" node template", result[0].Summary) + r.Equal("Default node templates cannot be deleted from CAST.ai. If you want to autoscaler to stop"+ + " considering this node template, you can disable it (either from UI or by setting `is_enabled` flag to"+ + " false).", result[0].Detail) +} + func TestAccResourceNodeTemplate_basic(t *testing.T) { rName := fmt.Sprintf("%v-node-template-%v", ResourcePrefix, acctest.RandString(8)) resourceName := "castai_node_template.test" @@ -225,6 +299,7 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { Config: testAccNodeTemplateConfig(rName, clusterName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "should_taint", "true"), resource.TestCheckResourceAttr(resourceName, "custom_instances_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "custom_label.#", "0"), @@ -267,6 +342,7 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { Config: testNodeTemplateUpdated(rName, clusterName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "should_taint", "true"), resource.TestCheckResourceAttr(resourceName, "custom_instances_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "custom_label.#", "0"), diff --git a/docs/resources/node_template.md b/docs/resources/node_template.md index c4c71058..ddcb1883 100644 --- a/docs/resources/node_template.md +++ b/docs/resources/node_template.md @@ -29,6 +29,7 @@ CAST AI node template resource to manage node templates - `custom_labels` (Map of String) Custom labels to be added to nodes created from this template. If the field `custom_label` is present, the value of `custom_labels` will be ignored. - `custom_taints` (Block List) Custom taints to be added to the nodes created from this template. `shouldTaint` has to be `true` in order to create/update the node template with custom taints. If `shouldTaint` is `true`, but no custom taints are provided, the nodes will be tainted with the default node template taint. (see [below for nested schema](#nestedblock--custom_taints)) - `is_default` (Boolean) Flag whether the node template is default. +- `is_enabled` (Boolean) Flag whether the node template is enabled and considered for autoscaling. - `rebalancing_config_min_nodes` (Number) Minimum nodes that will be kept when rebalancing nodes using this node template. - `should_taint` (Boolean) Marks whether the templated nodes will have a taint. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) From 24a364020cbb6b174c196bd3d49b6f359be079a6 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Tue, 8 Aug 2023 15:18:16 +0200 Subject: [PATCH 7/9] feat: add ability to encrypt ebs disk for CAST AI node (#210) * feat: add ability to encrypt ebs disk for CAST AI node * Apply suggestions from code review Co-authored-by: Narunas Kapocius <36560566+Narunas-K@users.noreply.github.com> --------- Co-authored-by: Narunas Kapocius <36560566+Narunas-K@users.noreply.github.com> --- castai/resource_node_configuration.go | 15 +++++++++++++++ castai/resource_node_configuration_eks_test.go | 2 ++ castai/sdk/api.gen.go | 3 ++- docs/resources/node_configuration.md | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/castai/resource_node_configuration.go b/castai/resource_node_configuration.go index 3e48d26f..50d7d83f 100644 --- a/castai/resource_node_configuration.go +++ b/castai/resource_node_configuration.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "net/http" + "regexp" "strings" "time" @@ -205,6 +206,12 @@ func resourceNodeConfiguration() *schema.Resource { ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(2)), Description: "Allow configure the IMDSv2 hop limit, the default is 2", }, + "volume_kms_key_arn": { + Type: schema.TypeString, + Optional: true, + Description: "AWS KMS key ARN for encrypting EBS volume attached to the node", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringMatch(regexp.MustCompile(`arn:aws:kms:.*`), "Must be a valid KMS key ARN")), + }, }, }, }, @@ -578,6 +585,10 @@ func toEKSConfig(obj map[string]interface{}) *sdk.NodeconfigV1EKSConfig { out.ImdsHopLimit = toPtr(int32(v)) } + if v, ok := obj["volume_kms_key_arn"].(string); ok && v != "" { + out.VolumeKmsKeyArn = toPtr(v) + } + return out } @@ -614,6 +625,10 @@ func flattenEKSConfig(config *sdk.NodeconfigV1EKSConfig) []map[string]interface{ m["imds_hop_limit"] = *config.ImdsHopLimit } + if v := config.VolumeKmsKeyArn; v != nil { + m["volume_kms_key_arn"] = toString(config.VolumeKmsKeyArn) + } + return []map[string]interface{}{m} } diff --git a/castai/resource_node_configuration_eks_test.go b/castai/resource_node_configuration_eks_test.go index 9415fe09..7d7bf593 100644 --- a/castai/resource_node_configuration_eks_test.go +++ b/castai/resource_node_configuration_eks_test.go @@ -46,6 +46,7 @@ func TestAccResourceNodeConfiguration_eks(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "eks.0.volume_throughput", "130"), resource.TestCheckResourceAttr(resourceName, "eks.0.imds_v1", "true"), resource.TestCheckResourceAttr(resourceName, "eks.0.imds_hop_limit", "3"), + resource.TestCheckResourceAttr(resourceName, "eks.0.volume_kms_key_arn", "arn:aws:kms:eu-central-1:012345:key/1d989ee1-59cd-4238-8018-79bae29d1109"), resource.TestCheckResourceAttr(resourceName, "aks.#", "0"), resource.TestCheckResourceAttr(resourceName, "kops.#", "0"), resource.TestCheckResourceAttr(resourceName, "gke.#", "0"), @@ -121,6 +122,7 @@ resource "castai_node_configuration" "test" { volume_type = "gp3" volume_iops = 3100 volume_throughput = 130 + volume_kms_key_arn = "arn:aws:kms:eu-central-1:012345:key/1d989ee1-59cd-4238-8018-79bae29d1109" imds_v1 = true imds_hop_limit = 3 } diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index 0f8b6896..7a478987 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -744,7 +744,8 @@ type NodeconfigV1EKSConfig struct { SecurityGroups *[]string `json:"securityGroups,omitempty"` // EBS volume IOPS value to be used for provisioned nodes. - VolumeIops *int32 `json:"volumeIops"` + VolumeIops *int32 `json:"volumeIops"` + VolumeKmsKeyArn *string `json:"volumeKmsKeyArn"` // EBS volume throughput in MiB/s to be used for provisioned nodes. VolumeThroughput *int32 `json:"volumeThroughput"` diff --git a/docs/resources/node_configuration.md b/docs/resources/node_configuration.md index e3e61167..3cd7728d 100644 --- a/docs/resources/node_configuration.md +++ b/docs/resources/node_configuration.md @@ -104,6 +104,7 @@ Optional: - `imds_v1` (Boolean) When the value is true both IMDSv1 and IMDSv2 are enabled. Setting the value to false disables permanently IMDSv1 and might affect legacy workloads running on the node created with this configuration. The default is true if the flag isn't provided - `key_pair_id` (String) AWS key pair ID to be used for CAST provisioned nodes. Has priority over ssh_public_key - `volume_iops` (Number) AWS EBS volume IOPS to be used for CAST provisioned nodes +- `volume_kms_key_arn` (String) AWS KMS key ARN for encrypting EBS volume attached to the node - `volume_throughput` (Number) AWS EBS volume throughput in MiB/s to be used for CAST provisioned nodes - `volume_type` (String) AWS EBS volume type to be used for CAST provisioned nodes. One of: gp3, io1, io2 From 2a6c02b6e2d6e59ab197727d0e2c25cd80aabf41 Mon Sep 17 00:00:00 2001 From: Laimonas Rastenis Date: Wed, 9 Aug 2023 08:40:06 +0300 Subject: [PATCH 8/9] feat: reservations support (#211) * feat: reservations support * docs: reservations csv description --------- Co-authored-by: Laimonas Rastenis --- .gitignore | 1 + Makefile | 2 +- castai/provider.go | 2 +- castai/reservations/fields.go | 63 + castai/reservations/mapping.go | 210 + castai/reservations/mapping_test.go | 414 ++ castai/resource_reservations.go | 290 + castai/resource_reservations_test.go | 247 + castai/sdk/api.gen.go | 432 ++ castai/sdk/client.gen.go | 6558 ++++++++++++----- castai/sdk/mock/client.go | 1059 ++- docs/resources/reservations.md | 103 + .../gke_cluster_autoscaler_policies/README.MD | 2 +- .../resources/castai_reservations/import.sh | 2 + .../castai_reservations/reservations.csv | 4 + .../resources/castai_reservations/resource.tf | 3 + templates/resources/reservations.md.tmpl | 60 + 17 files changed, 7481 insertions(+), 1971 deletions(-) create mode 100644 castai/reservations/fields.go create mode 100644 castai/reservations/mapping.go create mode 100644 castai/reservations/mapping_test.go create mode 100644 castai/resource_reservations.go create mode 100644 castai/resource_reservations_test.go create mode 100644 docs/resources/reservations.md create mode 100644 examples/resources/castai_reservations/import.sh create mode 100644 examples/resources/castai_reservations/reservations.csv create mode 100644 examples/resources/castai_reservations/resource.tf create mode 100644 templates/resources/reservations.md.tmpl diff --git a/.gitignore b/.gitignore index 26c4b86a..38d59f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ examples/localdev/* e2e/**/.env e2e/**/local.auto.tfvars terraform.tfstate +.DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile index 9156893c..2f3af05b 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ init-examples: generate-sdk: @echo "==> Generating castai sdk client" - @API_TAGS=ExternalClusterAPI,PoliciesAPI,NodeConfigurationAPI,NodeTemplatesAPI,AuthTokenAPI,ScheduledRebalancingAPI go generate castai/sdk/generate.go + @API_TAGS=ExternalClusterAPI,PoliciesAPI,NodeConfigurationAPI,NodeTemplatesAPI,AuthTokenAPI,ScheduledRebalancingAPI,InventoryAPI,UsersAPI go generate castai/sdk/generate.go # The following command also rewrites existing documentation generate-docs: diff --git a/castai/provider.go b/castai/provider.go index 7abbb0aa..fc942738 100644 --- a/castai/provider.go +++ b/castai/provider.go @@ -3,7 +3,6 @@ package castai import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -45,6 +44,7 @@ func Provider(version string) *schema.Provider { "castai_node_configuration": resourceNodeConfiguration(), "castai_node_configuration_default": resourceNodeConfigurationDefault(), "castai_eks_user_arn": resourceEKSClusterUserARN(), + "castai_reservations": resourceReservations(), }, DataSourcesMap: map[string]*schema.Resource{ diff --git a/castai/reservations/fields.go b/castai/reservations/fields.go new file mode 100644 index 00000000..dde5f45d --- /dev/null +++ b/castai/reservations/fields.go @@ -0,0 +1,63 @@ +package reservations + +const ( + FieldReservationsCSV = "reservations_csv" + FieldReservationsOrganizationId = "organization_id" + FieldReservations = "reservations" + FieldReservationName = "name" + FieldReservationProvider = "provider" + FieldReservationRegion = "region" + FieldReservationInstanceType = "instance_type" + FieldReservationPrice = "price" + FieldReservationCount = "count" + FieldReservationStartDate = "start_date" + FieldReservationEndDate = "end_date" + FieldReservationZoneId = "zone_id" + FieldReservationZoneName = "zone_name" + + // Azure specific fields + FieldReservationProductName = "product_name" + FieldReservationQuantity = "quantity" + FieldReservationPurchaseDate = "purchase_date" + FieldReservationExpirationDate = "expiration_date" + FieldReservationType = "type" + FieldReservationDeepLinkToReservation = "deep_link_to_reservation" +) + +var reservationResourceFields = []string{ + FieldReservationName, + FieldReservationProvider, + FieldReservationRegion, + FieldReservationInstanceType, + FieldReservationPrice, + FieldReservationCount, + FieldReservationStartDate, + FieldReservationEndDate, + FieldReservationZoneId, + FieldReservationZoneName, + FieldReservationProductName, + FieldReservationQuantity, + FieldReservationPurchaseDate, + FieldReservationExpirationDate, + FieldReservationType, + FieldReservationDeepLinkToReservation, +} + +var csvColumnAlias = map[string][]string{ + FieldReservationName: {FieldReservationName}, + FieldReservationProvider: {FieldReservationProvider}, + FieldReservationRegion: {FieldReservationRegion}, + FieldReservationInstanceType: {FieldReservationInstanceType, FieldReservationProductName}, + FieldReservationPrice: {FieldReservationPrice}, + FieldReservationCount: {FieldReservationCount, FieldReservationQuantity}, + FieldReservationStartDate: {FieldReservationStartDate, FieldReservationPurchaseDate}, + FieldReservationEndDate: {FieldReservationEndDate, FieldReservationExpirationDate}, + FieldReservationZoneId: {FieldReservationZoneId}, + FieldReservationZoneName: {FieldReservationZoneName}, + FieldReservationProductName: {FieldReservationProductName}, + FieldReservationQuantity: {FieldReservationQuantity}, + FieldReservationPurchaseDate: {FieldReservationPurchaseDate}, + FieldReservationExpirationDate: {FieldReservationExpirationDate}, + FieldReservationType: {FieldReservationType}, + FieldReservationDeepLinkToReservation: {FieldReservationDeepLinkToReservation}, +} diff --git a/castai/reservations/mapping.go b/castai/reservations/mapping.go new file mode 100644 index 00000000..1621baa8 --- /dev/null +++ b/castai/reservations/mapping.go @@ -0,0 +1,210 @@ +package reservations + +import ( + "fmt" + "github.com/castai/terraform-provider-castai/castai/sdk" + "github.com/samber/lo" + "strconv" + "strings" + "time" +) + +type ReservationResource map[string]*string + +func MapCsvRecordsToReservationResources(csvRecords [][]string) ([]*ReservationResource, error) { + var csvColumns []string + if len(csvRecords) > 0 { + csvColumns = csvRecords[0] + } + normalizedCsvColumnNames := lo.Map(csvColumns, func(column string, _ int) string { + return strings.ToLower(strings.ReplaceAll(column, " ", "_")) + }) + + reservationRecords := csvRecords[1:] + fieldIndexes := mapReservationsHeaderToReservationFieldIndexes(normalizedCsvColumnNames) + + reservations := make([]*ReservationResource, 0, len(reservationRecords)) + for _, record := range reservationRecords { + result, err := mapRecordToReservationResource(fieldIndexes, record) + if err != nil { + return nil, err + } + + reservations = append(reservations, result) + } + return reservations, nil +} + +func MapReservationDetailsToReservationResource(reservation sdk.CastaiInventoryV1beta1ReservationDetails) *ReservationResource { + return &ReservationResource{ + FieldReservationName: reservation.Name, + FieldReservationProvider: reservation.Provider, + FieldReservationRegion: reservation.Region, + FieldReservationInstanceType: reservation.InstanceType, + FieldReservationPrice: reservation.Price, + FieldReservationCount: int32ToString(reservation.Count), + FieldReservationStartDate: timeToString(reservation.StartDate), + FieldReservationEndDate: timeToString(reservation.EndDate), + FieldReservationZoneId: reservation.ZoneId, + FieldReservationZoneName: reservation.ZoneName, + } +} + +func MapReservationResourceToGenericReservation(resource ReservationResource) sdk.CastaiInventoryV1beta1GenericReservation { + return sdk.CastaiInventoryV1beta1GenericReservation{ + Name: resource[FieldReservationName], + Provider: resource[FieldReservationProvider], + Region: resource[FieldReservationRegion], + InstanceType: resource[FieldReservationInstanceType], + Price: resource[FieldReservationPrice], + Count: stringToInt32(resource[FieldReservationCount]), + StartDate: stringToTime(resource[FieldReservationStartDate]), + EndDate: stringToTime(resource[FieldReservationEndDate]), + ZoneId: resource[FieldReservationZoneId], + ZoneName: resource[FieldReservationZoneName], + Type: resource[FieldReservationType], + DeepLinkToReservation: resource[FieldReservationDeepLinkToReservation], + ProductName: resource[FieldReservationProductName], + ExpirationDate: stringToTime(resource[FieldReservationExpirationDate]), + PurchaseDate: stringToTime(resource[FieldReservationPurchaseDate]), + Quantity: stringToInt32(resource[FieldReservationQuantity]), + } +} + +func MapToReservationResourcesWithCommonFieldsOnly(reservationResources []*ReservationResource) []*ReservationResource { + return lo.Map(reservationResources, func(item *ReservationResource, _ int) *ReservationResource { + return &ReservationResource{ + FieldReservationName: (*item)[FieldReservationName], + FieldReservationProvider: (*item)[FieldReservationProvider], + FieldReservationRegion: (*item)[FieldReservationRegion], + FieldReservationInstanceType: (*item)[FieldReservationInstanceType], + FieldReservationPrice: (*item)[FieldReservationPrice], + FieldReservationCount: (*item)[FieldReservationCount], + FieldReservationStartDate: (*item)[FieldReservationStartDate], + FieldReservationEndDate: (*item)[FieldReservationEndDate], + FieldReservationZoneId: (*item)[FieldReservationZoneId], + FieldReservationZoneName: (*item)[FieldReservationZoneName], + } + }) +} + +func mapReservationsHeaderToReservationFieldIndexes(columns []string) map[string]int { + indexes := make(map[string]int, len(reservationResourceFields)) + for _, field := range reservationResourceFields { + index := -1 + aliases := csvColumnAlias[field] + for _, alias := range aliases { + _, fieldIdx, found := lo.FindIndexOf(columns, func(item string) bool { + return strings.ToLower(item) == alias + }) + + if found { + index = fieldIdx + break + } + } + + indexes[field] = index + } + return indexes +} + +func mapRecordToReservationResource(fieldIndexes map[string]int, record []string) (*ReservationResource, error) { + provider, err := getRecordReservationProvider(fieldIndexes, record) + if err != nil { + return nil, err + } + + return &ReservationResource{ + FieldReservationName: getRecordFieldStringValue(FieldReservationName, fieldIndexes, record), + FieldReservationProvider: provider, + FieldReservationRegion: getRecordFieldStringValue(FieldReservationRegion, fieldIndexes, record), + FieldReservationInstanceType: getRecordFieldStringValue(FieldReservationInstanceType, fieldIndexes, record), + FieldReservationPrice: getRecordFieldStringValue(FieldReservationPrice, fieldIndexes, record), + FieldReservationCount: getRecordFieldStringValue(FieldReservationCount, fieldIndexes, record), + FieldReservationStartDate: getRecordFieldStringValue(FieldReservationStartDate, fieldIndexes, record), + FieldReservationEndDate: getRecordFieldStringValue(FieldReservationEndDate, fieldIndexes, record), + FieldReservationZoneId: getRecordFieldStringValue(FieldReservationZoneId, fieldIndexes, record), + FieldReservationZoneName: getRecordFieldStringValue(FieldReservationZoneName, fieldIndexes, record), + FieldReservationProductName: getRecordFieldStringValue(FieldReservationProductName, fieldIndexes, record), + FieldReservationQuantity: getRecordFieldStringValue(FieldReservationQuantity, fieldIndexes, record), + FieldReservationPurchaseDate: getRecordFieldStringValue(FieldReservationPurchaseDate, fieldIndexes, record), + FieldReservationExpirationDate: getRecordFieldStringValue(FieldReservationExpirationDate, fieldIndexes, record), + FieldReservationType: getRecordFieldStringValue(FieldReservationType, fieldIndexes, record), + FieldReservationDeepLinkToReservation: getRecordFieldStringValue(FieldReservationDeepLinkToReservation, fieldIndexes, record), + }, nil +} + +func getRecordReservationProvider(fieldIndexes map[string]int, record []string) (*string, error) { + provider := getRecordFieldStringValue(FieldReservationProvider, fieldIndexes, record) + if provider != nil && *provider != "" { + return provider, nil + } + + deepLinkToReservation := getRecordFieldStringValue(FieldReservationDeepLinkToReservation, fieldIndexes, record) + if deepLinkToReservation != nil && strings.Contains(*deepLinkToReservation, "azure") { + return lo.ToPtr("azure"), nil + } + + return nil, fmt.Errorf("reservation provider could not be determined: %v", record) +} + +func getRecordFieldStringValue(field string, fieldIndexes map[string]int, record []string) *string { + index, found := fieldIndexes[field] + if !found || index == -1 { + return nil + } + value := record[index] + if value == "" { + return nil + } + + return &value +} + +func timeToString(t *time.Time) *string { + if t == nil { + return nil + } + + result := t.Format(time.RFC3339) + + return &result +} + +func stringToInt32(t *string) *int32 { + if t == nil || *t == "" { + return nil + } + + parsed, err := strconv.Atoi(*t) + if err != nil { + return nil + } + result := int32(parsed) + + return &result +} + +func int32ToString(t *int32) *string { + if t == nil { + return nil + } + + result := strconv.Itoa(int(*t)) + + return &result +} + +func stringToTime(t *string) *time.Time { + if t == nil || *t == "" { + return nil + } + + result, err := time.Parse(time.RFC3339, *t) + if err != nil { + return nil + } + + return &result +} diff --git a/castai/reservations/mapping_test.go b/castai/reservations/mapping_test.go new file mode 100644 index 00000000..804e7ef1 --- /dev/null +++ b/castai/reservations/mapping_test.go @@ -0,0 +1,414 @@ +package reservations + +import ( + "github.com/castai/terraform-provider-castai/castai/sdk" + "github.com/samber/lo" + "github.com/stretchr/testify/require" + "testing" + "time" +) + +func TestMapCsvRecordsToReservationResources(t *testing.T) { + type args struct { + csvRecords [][]string + } + tests := map[string]struct { + args args + want []*ReservationResource + expectErrMessageContains *string + }{ + "should map reservation resources when generic reservation records are provided": { + args: args{ + csvRecords: [][]string{ + {"name", "provider", "region", "instance_type", "price", "count", "start_date", "end_date", "zone_id", "zone_name"}, + {"reservation1", "aws", "us-east-1", "c5n.large", "", "3", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + {"reservation2", "aws", "us-east-1", "c5n.large", "", "2", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + {"reservation3", "aws", "us-east-1", "c5n.large", "", "1", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + }, + }, + want: []*ReservationResource{ + { + FieldReservationName: lo.ToPtr("reservation1"), + FieldReservationProvider: lo.ToPtr("aws"), + FieldReservationRegion: lo.ToPtr("us-east-1"), + FieldReservationInstanceType: lo.ToPtr("c5n.large"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("3"), + FieldReservationStartDate: lo.ToPtr("2020-01-01T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: nil, + FieldReservationQuantity: nil, + FieldReservationPurchaseDate: nil, + FieldReservationExpirationDate: nil, + FieldReservationType: nil, + FieldReservationDeepLinkToReservation: nil, + }, + { + FieldReservationName: lo.ToPtr("reservation2"), + FieldReservationProvider: lo.ToPtr("aws"), + FieldReservationRegion: lo.ToPtr("us-east-1"), + FieldReservationInstanceType: lo.ToPtr("c5n.large"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("2"), + FieldReservationStartDate: lo.ToPtr("2020-01-01T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: nil, + FieldReservationQuantity: nil, + FieldReservationPurchaseDate: nil, + FieldReservationExpirationDate: nil, + FieldReservationType: nil, + FieldReservationDeepLinkToReservation: nil, + }, + { + FieldReservationName: lo.ToPtr("reservation3"), + FieldReservationProvider: lo.ToPtr("aws"), + FieldReservationRegion: lo.ToPtr("us-east-1"), + FieldReservationInstanceType: lo.ToPtr("c5n.large"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("1"), + FieldReservationStartDate: lo.ToPtr("2020-01-01T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: nil, + FieldReservationQuantity: nil, + FieldReservationPurchaseDate: nil, + FieldReservationExpirationDate: nil, + FieldReservationType: nil, + FieldReservationDeepLinkToReservation: nil, + }, + }, + }, + "should map reservation resources when Azure reservation records are provided": { + args: args{ + csvRecords: [][]string{ + {"Name", "Reservation Id", "Reservation order Id", "Status", "Expiration date", "Purchase date", "Term", "Scope", "Scope subscription", "Scope resource group", "Type", "Product name", "Region", "Quantity", "Utilization % 1 Day", "Utilization % 7 Day", "Utilization % 30 Day", "Deep link to reservation"}, + {"VM_RI_01-01-2023_01-01", "3b3de39c-bc44-4d69-be2d-69527dfe9958", "630226bb-5170-4b95-90b0-f222757130c1", "Succeeded", "2050-01-01T00:00:00Z", "2023-01-11T00:00:00Z", "P3Y", "Single subscription", "8faa0959-093b-4612-8686-a996ac19db00", "All resource groups", "VirtualMachines", "Standard_D32as_v4", "eastus", "3", "100", "100", "100", "https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/883afd52-54c8-4bc6-a0f2-ccbaf7b84bda/overview"}, + {"VM_RI_01-01-2023_01-02", "3b3de39c-bc44-4d69-be2d-69527dfe9958", "630226bb-5170-4b95-90b0-f222757130c1", "Succeeded", "2050-01-01T00:00:00Z", "2023-01-11T00:00:00Z", "P3Y", "Single subscription", "8faa0959-093b-4612-8686-a996ac19db00", "All resource groups", "VirtualMachines", "Standard_D32as_v4", "eastus", "2", "100", "100", "100", "https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/25b95bdb-b78b-4973-a60c-71e70f158eca/overview"}, + {"VM_RI_01-01-2023_01-03", "3b3de39c-bc44-4d69-be2d-69527dfe9958", "630226bb-5170-4b95-90b0-f222757130c1", "Succeeded", "2050-01-01T00:00:00Z", "2023-01-11T00:00:00Z", "P3Y", "Single subscription", "8faa0959-093b-4612-8686-a996ac19db00", "All resource groups", "VirtualMachines", "Standard_D32as_v4", "eastus", "1", "100", "100", "100", "https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/1745741b-f3c6-46a9-ad16-b93775a1bc38/overview"}, + }, + }, + want: []*ReservationResource{ + { + FieldReservationName: lo.ToPtr("VM_RI_01-01-2023_01-01"), + FieldReservationProvider: lo.ToPtr("azure"), + FieldReservationRegion: lo.ToPtr("eastus"), + FieldReservationInstanceType: lo.ToPtr("Standard_D32as_v4"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("3"), + FieldReservationStartDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: lo.ToPtr("Standard_D32as_v4"), + FieldReservationQuantity: lo.ToPtr("3"), + FieldReservationPurchaseDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationExpirationDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationType: lo.ToPtr("VirtualMachines"), + FieldReservationDeepLinkToReservation: lo.ToPtr("https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/883afd52-54c8-4bc6-a0f2-ccbaf7b84bda/overview"), + }, + { + FieldReservationName: lo.ToPtr("VM_RI_01-01-2023_01-02"), + FieldReservationProvider: lo.ToPtr("azure"), + FieldReservationRegion: lo.ToPtr("eastus"), + FieldReservationInstanceType: lo.ToPtr("Standard_D32as_v4"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("2"), + FieldReservationStartDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: lo.ToPtr("Standard_D32as_v4"), + FieldReservationQuantity: lo.ToPtr("2"), + FieldReservationPurchaseDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationExpirationDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationType: lo.ToPtr("VirtualMachines"), + FieldReservationDeepLinkToReservation: lo.ToPtr("https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/25b95bdb-b78b-4973-a60c-71e70f158eca/overview"), + }, + { + FieldReservationName: lo.ToPtr("VM_RI_01-01-2023_01-03"), + FieldReservationProvider: lo.ToPtr("azure"), + FieldReservationRegion: lo.ToPtr("eastus"), + FieldReservationInstanceType: lo.ToPtr("Standard_D32as_v4"), + FieldReservationPrice: nil, + FieldReservationCount: lo.ToPtr("1"), + FieldReservationStartDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationEndDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationZoneId: nil, + FieldReservationZoneName: nil, + FieldReservationProductName: lo.ToPtr("Standard_D32as_v4"), + FieldReservationQuantity: lo.ToPtr("1"), + FieldReservationPurchaseDate: lo.ToPtr("2023-01-11T00:00:00Z"), + FieldReservationExpirationDate: lo.ToPtr("2050-01-01T00:00:00Z"), + FieldReservationType: lo.ToPtr("VirtualMachines"), + FieldReservationDeepLinkToReservation: lo.ToPtr("https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/1745741b-f3c6-46a9-ad16-b93775a1bc38/overview"), + }, + }, + }, + "should return an error when reservation provider could not be determined": { + args: args{ + csvRecords: [][]string{ + {"name", "provider", "region", "instance_type", "price", "count", "start_date", "end_date", "zone_id", "zone_name"}, + {"reservation1", "aws", "us-east-1", "c5n.large", "", "3", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + {"reservation2", "", "us-east-1", "c5n.large", "", "2", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + {"reservation3", "aws", "us-east-1", "c5n.large", "", "1", "2020-01-01T00:00:00Z", "2050-01-01T00:00:00Z", "", ""}, + }, + }, + expectErrMessageContains: lo.ToPtr("reservation provider could not be determined: [reservation2"), + }, + } + + for testName, tt := range tests { + t.Run(testName, func(t *testing.T) { + r := require.New(t) + + got, err := MapCsvRecordsToReservationResources(tt.args.csvRecords) + + if tt.expectErrMessageContains != nil { + r.Error(err) + r.Contains(err.Error(), *tt.expectErrMessageContains) + } else { + r.NoError(err) + r.ElementsMatch(tt.want, got) + } + }) + } +} + +func TestMapReservationDetailsToReservationResource(t *testing.T) { + now := time.Now() + commonFields := []string{ + FieldReservationName, + FieldReservationProvider, + FieldReservationRegion, + FieldReservationInstanceType, + FieldReservationPrice, + FieldReservationCount, + FieldReservationStartDate, + FieldReservationEndDate, + FieldReservationZoneId, + FieldReservationZoneName, + } + + type args struct { + reservation sdk.CastaiInventoryV1beta1ReservationDetails + } + tests := map[string]struct { + args args + want *ReservationResource + }{ + "should map common fields from reservation": { + args: args{ + reservation: sdk.CastaiInventoryV1beta1ReservationDetails{ + Name: lo.ToPtr("reservation"), + Provider: lo.ToPtr("gcp"), + Region: lo.ToPtr("region"), + InstanceType: lo.ToPtr("it"), + Price: lo.ToPtr("1"), + Count: lo.ToPtr(int32(1)), + StartDate: lo.ToPtr(now), + EndDate: lo.ToPtr(now), + ZoneId: lo.ToPtr("zone id"), + ZoneName: lo.ToPtr("zone name"), + }, + }, + want: &ReservationResource{ + FieldReservationName: lo.ToPtr("reservation"), + FieldReservationProvider: lo.ToPtr("gcp"), + FieldReservationRegion: lo.ToPtr("region"), + FieldReservationInstanceType: lo.ToPtr("it"), + FieldReservationPrice: lo.ToPtr("1"), + FieldReservationCount: lo.ToPtr("1"), + FieldReservationStartDate: lo.ToPtr(now.Format(time.RFC3339)), + FieldReservationEndDate: lo.ToPtr(now.Format(time.RFC3339)), + FieldReservationZoneId: lo.ToPtr("zone id"), + FieldReservationZoneName: lo.ToPtr("zone name"), + }, + }, + } + + for testName, tt := range tests { + t.Run(testName, func(t *testing.T) { + r := require.New(t) + got := MapReservationDetailsToReservationResource(tt.args.reservation) + + r.Equal(tt.want, got) + for key, value := range *got { + if !lo.Contains(commonFields, key) && value != nil { + r.Nilf(value, "expected '%s' to not be set", key) + } + } + }) + } +} + +func Test_mapReservationsHeaderToReservationFieldIndexes(t *testing.T) { + type args struct { + columns []string + } + tests := map[string]struct { + args args + want map[string]int + }{ + "should map field indexes when column names match primary field alias": { + args: args{ + columns: []string{ + FieldReservationName, + FieldReservationProvider, + FieldReservationRegion, + FieldReservationInstanceType, + FieldReservationPrice, + FieldReservationCount, + FieldReservationStartDate, + FieldReservationEndDate, + FieldReservationZoneId, + FieldReservationZoneName, + FieldReservationProductName, + FieldReservationQuantity, + FieldReservationPurchaseDate, + FieldReservationExpirationDate, + FieldReservationType, + FieldReservationDeepLinkToReservation, + }, + }, + want: map[string]int{ + FieldReservationName: 0, + FieldReservationProvider: 1, + FieldReservationRegion: 2, + FieldReservationInstanceType: 3, + FieldReservationPrice: 4, + FieldReservationCount: 5, + FieldReservationStartDate: 6, + FieldReservationEndDate: 7, + FieldReservationZoneId: 8, + FieldReservationZoneName: 9, + FieldReservationProductName: 10, + FieldReservationQuantity: 11, + FieldReservationPurchaseDate: 12, + FieldReservationExpirationDate: 13, + FieldReservationType: 14, + FieldReservationDeepLinkToReservation: 15, + }, + }, + "should map field indexes when column names match secondary alias field": { + args: args{ + columns: []string{ + FieldReservationName, + FieldReservationProvider, + FieldReservationRegion, + FieldReservationPrice, + FieldReservationZoneId, + FieldReservationZoneName, + FieldReservationProductName, + FieldReservationQuantity, + FieldReservationPurchaseDate, + FieldReservationExpirationDate, + FieldReservationType, + FieldReservationDeepLinkToReservation, + }, + }, + want: map[string]int{ + FieldReservationName: 0, + FieldReservationProvider: 1, + FieldReservationRegion: 2, + FieldReservationPrice: 3, + FieldReservationZoneId: 4, + FieldReservationZoneName: 5, + FieldReservationInstanceType: 6, + FieldReservationProductName: 6, + FieldReservationQuantity: 7, + FieldReservationCount: 7, + FieldReservationStartDate: 8, + FieldReservationPurchaseDate: 8, + FieldReservationEndDate: 9, + FieldReservationExpirationDate: 9, + FieldReservationType: 10, + FieldReservationDeepLinkToReservation: 11, + }, + }, + } + for testName, tt := range tests { + t.Run(testName, func(t *testing.T) { + r := require.New(t) + + got := mapReservationsHeaderToReservationFieldIndexes(tt.args.columns) + + r.Equal(tt.want, got) + }) + } +} + +func Test_getRecordReservationProvider(t *testing.T) { + type args struct { + fieldIndexes map[string]int + record []string + } + tests := map[string]struct { + args args + want *string + expectErrMessageContains *string + }{ + "should use aws provider when record provider is aws": { + args: args{ + fieldIndexes: map[string]int{ + FieldReservationProvider: 0, + }, + record: []string{"aws"}, + }, + want: lo.ToPtr("aws"), + }, + "should use azure provider when record provider is azure": { + args: args{ + fieldIndexes: map[string]int{ + FieldReservationProvider: 0, + }, + record: []string{"azure"}, + }, + want: lo.ToPtr("azure"), + }, + "should use gcp provider when record provider is gcp": { + args: args{ + fieldIndexes: map[string]int{ + FieldReservationProvider: 0, + }, + record: []string{"gcp"}, + }, + want: lo.ToPtr("gcp"), + }, + "should determine azure provider when deep link to reservation is provided": { + args: args{ + fieldIndexes: map[string]int{ + FieldReservationDeepLinkToReservation: 0, + }, + record: []string{"https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/883afd52-54c8-4bc6-a0f2-ccbaf7b84bda/overview"}, + }, + want: lo.ToPtr("azure"), + }, + "should return an error if provider could not be determined": { + args: args{ + fieldIndexes: map[string]int{}, + record: []string{}, + }, + expectErrMessageContains: lo.ToPtr("reservation provider could not be determined"), + }, + } + + for testName, tt := range tests { + t.Run(testName, func(t *testing.T) { + r := require.New(t) + + got, err := getRecordReservationProvider(tt.args.fieldIndexes, tt.args.record) + + if tt.expectErrMessageContains != nil { + r.Error(err) + r.Contains(err.Error(), *tt.expectErrMessageContains) + } else { + r.Equal(tt.want, got) + } + }) + } +} diff --git a/castai/resource_reservations.go b/castai/resource_reservations.go new file mode 100644 index 00000000..e5ac8b41 --- /dev/null +++ b/castai/resource_reservations.go @@ -0,0 +1,290 @@ +package castai + +import ( + "context" + "encoding/csv" + "fmt" + "github.com/castai/terraform-provider-castai/castai/reservations" + "github.com/castai/terraform-provider-castai/castai/sdk" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/samber/lo" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceReservations() *schema.Resource { + return &schema.Resource{ + ReadContext: resourceCastaiReservationsRead, + CreateContext: resourceCastaiReservationsCreate, + UpdateContext: resourceCastaiReservationsUpdate, + DeleteContext: resourceCastaiReservationsDelete, + Importer: &schema.ResourceImporter{ + StateContext: reservationsStateImporter, + }, + Description: "Reservation represents cloud service provider reserved instances that can be used by CAST AI autoscaler.", + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(2 * time.Minute), + Update: schema.DefaultTimeout(2 * time.Minute), + }, + CustomizeDiff: reservationsDiff, + Schema: map[string]*schema.Schema{ + reservations.FieldReservationsCSV: { + Type: schema.TypeString, + Required: true, + Description: "csv file containing reservations", + }, + reservations.FieldReservationsOrganizationId: { + Type: schema.TypeString, + Optional: true, + Description: "organization", + }, + reservations.FieldReservations: { + Type: schema.TypeList, + Computed: true, + Optional: false, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + reservations.FieldReservationCount: { + Type: schema.TypeString, + Required: true, + Description: "amount of reserved instances", + }, + reservations.FieldReservationInstanceType: { + Type: schema.TypeString, + Required: true, + Description: "reserved instance type", + }, + reservations.FieldReservationName: { + Type: schema.TypeString, + Required: true, + Description: "unique reservation name in region for specific instance type", + }, + reservations.FieldReservationPrice: { + Type: schema.TypeString, + Required: true, + Description: "reservation price", + }, + reservations.FieldReservationProvider: { + Type: schema.TypeString, + Required: true, + Description: "reservation cloud provider (gcp, aws, azure)", + }, + reservations.FieldReservationRegion: { + Type: schema.TypeString, + Required: true, + Description: "reservation region", + }, + reservations.FieldReservationZoneId: { + Type: schema.TypeString, + Optional: true, + Description: "reservation zone id", + }, + reservations.FieldReservationZoneName: { + Type: schema.TypeString, + Optional: true, + Description: "reservation zone name", + }, + reservations.FieldReservationStartDate: { + Type: schema.TypeString, + ValidateDiagFunc: validation.ToDiagFunc(validation.IsRFC3339Time), + Required: true, + Description: "start date of reservation", + }, + reservations.FieldReservationEndDate: { + Type: schema.TypeString, + ValidateDiagFunc: validation.ToDiagFunc(validation.IsRFC3339Time), + Optional: true, + Description: "end date of reservation", + }, + }, + }, + }, + }, + } +} + +func reservationsDiff(_ context.Context, diff *schema.ResourceDiff, _ any) error { + reservationsCsv, _ := diff.GetOk(reservations.FieldReservationsCSV) + reservationResources, err := mapReservationsCsvToReservationResources(reservationsCsv.(string)) + if err != nil { + return err + } + + return diff.SetNew(reservations.FieldReservations, reservations.MapToReservationResourcesWithCommonFieldsOnly(reservationResources)) +} + +func reservationsStateImporter(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) { + organizationId, err := uuid.Parse(d.Id()) + if err != nil { + return nil, err + } + + if err := d.Set(reservations.FieldReservationsOrganizationId, organizationId.String()); err != nil { + return nil, err + } + + if err := populateReservationsResourceData(ctx, d, meta, organizationId.String()); err != nil { + return nil, err + } + + return []*schema.ResourceData{d}, nil +} + +func resourceCastaiReservationsRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + log.Printf("[INFO] Get reservations call start") + defer log.Printf("[INFO] Get reservations call end") + + organizationId, err := getOrganizationId(ctx, d, meta) + if err != nil { + return diag.FromErr(err) + } + + if err := populateReservationsResourceData(ctx, d, meta, organizationId); err != nil { + return diag.FromErr(err) + } + + return nil +} + +func resourceCastaiReservationsDelete(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + organizationId, err := getOrganizationId(ctx, data, meta) + if err != nil { + return diag.FromErr(err) + } + + err = upsertReservations(ctx, meta, organizationId, []*reservations.ReservationResource{}) + if err != nil { + return diag.FromErr(err) + } + + data.SetId(organizationId) + return nil +} + +func resourceCastaiReservationsUpdate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[INFO] Update reservations call start") + defer log.Printf("[INFO] Update reservations call end") + + return resourceCastaiReservationsUpsert(ctx, data, meta) +} + +func resourceCastaiReservationsCreate(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + log.Printf("[INFO] Create reservations call start") + defer log.Printf("[INFO] Create reservations call end") + + return resourceCastaiReservationsUpsert(ctx, data, meta) +} + +func resourceCastaiReservationsUpsert(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics { + organizationId, err := getOrganizationId(ctx, data, meta) + if err != nil { + return diag.FromErr(err) + } + + reservationsCsv, _ := data.GetOk(reservations.FieldReservationsCSV) + reservationResources, err := mapReservationsCsvToReservationResources(reservationsCsv.(string)) + if err != nil { + return diag.FromErr(err) + } + + err = upsertReservations(ctx, meta, organizationId, reservationResources) + if err != nil { + return diag.FromErr(err) + } + + data.SetId(organizationId) + + return resourceCastaiReservationsRead(ctx, data, meta) +} + +func upsertReservations(ctx context.Context, meta interface{}, organizationId string, reservationResources []*reservations.ReservationResource) error { + client := meta.(*ProviderConfig).api + mappedReservations := lo.Map(reservationResources, func(item *reservations.ReservationResource, _ int) sdk.CastaiInventoryV1beta1GenericReservation { + return reservations.MapReservationResourceToGenericReservation(*item) + }) + + response, err := client.InventoryAPIOverwriteReservationsWithResponse(ctx, organizationId, sdk.InventoryAPIOverwriteReservationsJSONRequestBody{ + Items: &mappedReservations, + }) + if checkErr := sdk.CheckOKResponse(response, err); checkErr != nil { + return fmt.Errorf("upserting reservations: %w", checkErr) + } + + return nil +} + +func populateReservationsResourceData(ctx context.Context, d *schema.ResourceData, meta any, organizationId string) error { + organizationReservations, err := getOrganizationReservationResources(ctx, meta, organizationId) + if err != nil { + return err + } + + if err := d.Set(reservations.FieldReservations, organizationReservations); err != nil { + return fmt.Errorf("setting reservations: %w", err) + } + + return nil +} + +func mapReservationsCsvToReservationResources(reservationsCsv string) ([]*reservations.ReservationResource, error) { + csvReader := csv.NewReader(strings.NewReader(reservationsCsv)) + csvRecords, err := csvReader.ReadAll() + if err != nil { + return nil, fmt.Errorf("parsing reservations csv: %w", err) + } + + result, err := reservations.MapCsvRecordsToReservationResources(csvRecords) + if err != nil { + return nil, fmt.Errorf("parsing reservations csv: %w", err) + } + + return result, nil +} + +func getOrganizationReservationResources(ctx context.Context, meta any, organizationId string) ([]*reservations.ReservationResource, error) { + client := meta.(*ProviderConfig).api + + response, err := client.InventoryAPIGetReservationsWithResponse(ctx, organizationId) + if checkErr := sdk.CheckOKResponse(response, err); checkErr != nil { + return nil, fmt.Errorf("fetching reservations: %w", checkErr) + } + + return lo.Map(*response.JSON200.Reservations, func(item sdk.CastaiInventoryV1beta1ReservationDetails, _ int) *reservations.ReservationResource { + return reservations.MapReservationDetailsToReservationResource(item) + }), nil +} + +func getOrganizationId(ctx context.Context, d *schema.ResourceData, meta any) (string, error) { + client := meta.(*ProviderConfig).api + + organizationUid, found := d.GetOk(reservations.FieldReservationsOrganizationId) + if found { + organizationId, err := uuid.Parse(organizationUid.(string)) + if err != nil { + return "", err + } + + return organizationId.String(), nil + } + + response, err := client.ListOrganizationsWithResponse(ctx) + if checkErr := sdk.CheckOKResponse(response, err); checkErr != nil { + return "", fmt.Errorf("fetching organizations: %w", checkErr) + } + + if len(response.JSON200.Organizations) > 1 { + return "", fmt.Errorf("found more than 1 organization, you can specify exact organization using 'organization_id' attribute") + } + + for _, organization := range response.JSON200.Organizations { + return *organization.Id, nil + } + + return "", fmt.Errorf("no organizations found") +} diff --git a/castai/resource_reservations_test.go b/castai/resource_reservations_test.go new file mode 100644 index 00000000..2c8c1ed1 --- /dev/null +++ b/castai/resource_reservations_test.go @@ -0,0 +1,247 @@ +package castai + +import ( + "bytes" + "context" + "encoding/json" + "github.com/castai/terraform-provider-castai/castai/reservations" + "github.com/castai/terraform-provider-castai/castai/sdk" + mock_sdk "github.com/castai/terraform-provider-castai/castai/sdk/mock" + "github.com/golang/mock/gomock" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/samber/lo" + "github.com/stretchr/testify/require" + "io" + "net/http" + "testing" +) + +func TestReservations_Azure_BasicReservationsCSV(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + + ProviderFactories: providerFactories, + Steps: []resource.TestStep{ + { + Config: makeAzureInitialReservationsConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.#", "2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.name", "VM_RI_01-01-2023_01-01"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.name", "VM_RI_01-01-2023_01-02"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.provider", "azure"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.provider", "azure"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.count", "1"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.count", "2"), + ), + }, + { + ResourceName: "castai_reservations.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{reservations.FieldReservationsCSV}, + }, + { + Config: makeAzureUpdatedReservationsConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.#", "3"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.name", "VM_RI_01-01-2023_01-01"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.name", "VM_RI_01-01-2023_01-02"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.name", "VM_RI_01-01-2023_01-03"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.provider", "azure"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.provider", "azure"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.provider", "azure"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.count", "3"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.count", "2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.count", "1"), + ), + }, + }, + }) +} + +func TestReservations_Generic_BasicReservationsCSV(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + + ProviderFactories: providerFactories, + Steps: []resource.TestStep{ + { + Config: makeGenericInitialReservationsConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.#", "2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.name", "reservation1"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.name", "reservation2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.provider", "aws"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.provider", "aws"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.count", "1"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.count", "2"), + ), + }, + { + ResourceName: "castai_reservations.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{reservations.FieldReservationsCSV}, + }, + { + Config: makeGenericUpdatedReservationsConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.#", "3"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.name", "reservation1"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.name", "reservation2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.name", "reservation3"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.provider", "aws"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.provider", "aws"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.provider", "aws"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.0.count", "3"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.1.count", "2"), + resource.TestCheckResourceAttr("castai_reservations.test", "reservations.2.count", "1"), + ), + }, + }, + }) +} + +func makeAzureInitialReservationsConfig() string { + return ` +resource "castai_reservations" "test" { + reservations_csv = < to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +type Response interface { + Status() string + StatusCode() int + GetBody() []byte +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type AuthTokenAPIListAuthTokensResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiAuthtokenV1beta1ListAuthTokensResponse +} + +// Status returns HTTPResponse.Status +func (r AuthTokenAPIListAuthTokensResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthTokenAPIListAuthTokensResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r AuthTokenAPIListAuthTokensResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type AuthTokenAPICreateAuthTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiAuthtokenV1beta1AuthToken +} + +// Status returns HTTPResponse.Status +func (r AuthTokenAPICreateAuthTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthTokenAPICreateAuthTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r AuthTokenAPICreateAuthTokenResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type AuthTokenAPIDeleteAuthTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiAuthtokenV1beta1DeleteAuthTokenResponse +} + +// Status returns HTTPResponse.Status +func (r AuthTokenAPIDeleteAuthTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthTokenAPIDeleteAuthTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r AuthTokenAPIDeleteAuthTokenResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type AuthTokenAPIGetAuthTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiAuthtokenV1beta1AuthToken +} + +// Status returns HTTPResponse.Status +func (r AuthTokenAPIGetAuthTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthTokenAPIGetAuthTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r AuthTokenAPIGetAuthTokenResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type AuthTokenAPIUpdateAuthTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiAuthtokenV1beta1AuthToken +} + +// Status returns HTTPResponse.Status +func (r AuthTokenAPIUpdateAuthTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthTokenAPIUpdateAuthTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r AuthTokenAPIUpdateAuthTokenResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type CreateInvitationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NewInvitationsResponse +} + +// Status returns HTTPResponse.Status +func (r CreateInvitationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateInvitationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r CreateInvitationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type ClaimInvitationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *map[string]interface{} +} + +// Status returns HTTPResponse.Status +func (r ClaimInvitationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ClaimInvitationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ClaimInvitationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeTemplatesAPIFilterInstanceTypesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodetemplatesV1FilterInstanceTypesResponse +} + +// Status returns HTTPResponse.Status +func (r NodeTemplatesAPIFilterInstanceTypesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeTemplatesAPIFilterInstanceTypesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeTemplatesAPIFilterInstanceTypesResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPIListConfigurationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1ListConfigurationsResponse +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPIListConfigurationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPIListConfigurationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPIListConfigurationsResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPICreateConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1NodeConfiguration +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPICreateConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPICreateConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPICreateConfigurationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPIGetSuggestedConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1GetSuggestedConfigurationResponse +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPIDeleteConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1DeleteConfigurationResponse +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPIDeleteConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPIDeleteConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPIDeleteConfigurationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPIGetConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1NodeConfiguration +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPIGetConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPIGetConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPIGetConfigurationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPIUpdateConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1NodeConfiguration +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPIUpdateConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPIUpdateConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPIUpdateConfigurationResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeConfigurationAPISetDefaultResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodeconfigV1NodeConfiguration +} + +// Status returns HTTPResponse.Status +func (r NodeConfigurationAPISetDefaultResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeConfigurationAPISetDefaultResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeConfigurationAPISetDefaultResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type PoliciesAPIGetClusterNodeConstraintsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PoliciesV1GetClusterNodeConstraintsResponse +} + +// Status returns HTTPResponse.Status +func (r PoliciesAPIGetClusterNodeConstraintsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PoliciesAPIGetClusterNodeConstraintsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r PoliciesAPIGetClusterNodeConstraintsResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeTemplatesAPIListNodeTemplatesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodetemplatesV1ListNodeTemplatesResponse +} + +// Status returns HTTPResponse.Status +func (r NodeTemplatesAPIListNodeTemplatesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r NodeTemplatesAPIListNodeTemplatesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeTemplatesAPIListNodeTemplatesResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type NodeTemplatesAPICreateNodeTemplateResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodetemplatesV1NodeTemplate +} + +// Status returns HTTPResponse.Status +func (r NodeTemplatesAPICreateNodeTemplateResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ScheduledRebalancingAPIPreviewRebalancingSchedule request with any body - ScheduledRebalancingAPIPreviewRebalancingScheduleWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r NodeTemplatesAPICreateNodeTemplateResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPIPreviewRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeTemplatesAPICreateNodeTemplateResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPIListClusters request - ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *ExternalClusterAPIListClustersParams) (*ExternalClusterAPIListClustersResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - // ExternalClusterAPIRegisterCluster request with any body - ExternalClusterAPIRegisterClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ExternalClusterAPIRegisterClusterResponse, error) +type NodeTemplatesAPIDeleteNodeTemplateResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodetemplatesV1DeleteNodeTemplateResponse +} - ExternalClusterAPIRegisterClusterWithResponse(ctx context.Context, body ExternalClusterAPIRegisterClusterJSONRequestBody) (*ExternalClusterAPIRegisterClusterResponse, error) +// Status returns HTTPResponse.Status +func (r NodeTemplatesAPIDeleteNodeTemplateResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // GetExternalClusterOperation request - GetExternalClusterOperationWithResponse(ctx context.Context, id string) (*GetExternalClusterOperationResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r NodeTemplatesAPIDeleteNodeTemplateResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ExternalClusterAPIDeleteCluster request - ExternalClusterAPIDeleteClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteClusterResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeTemplatesAPIDeleteNodeTemplateResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPIGetCluster request - ExternalClusterAPIGetClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetClusterResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - // ExternalClusterAPIUpdateCluster request with any body - ExternalClusterAPIUpdateClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIUpdateClusterResponse, error) +type NodeTemplatesAPIUpdateNodeTemplateResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NodetemplatesV1NodeTemplate +} - ExternalClusterAPIUpdateClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterJSONRequestBody) (*ExternalClusterAPIUpdateClusterResponse, error) +// Status returns HTTPResponse.Status +func (r NodeTemplatesAPIUpdateNodeTemplateResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ExternalClusterAPIDeleteAssumeRolePrincipal request - ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteAssumeRolePrincipalResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r NodeTemplatesAPIUpdateNodeTemplateResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ExternalClusterAPIGetAssumeRolePrincipal request - ExternalClusterAPIGetAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRolePrincipalResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r NodeTemplatesAPIUpdateNodeTemplateResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPICreateAssumeRolePrincipal request - ExternalClusterAPICreateAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateAssumeRolePrincipalResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type PoliciesAPIGetClusterPoliciesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PoliciesV1Policies +} + +// Status returns HTTPResponse.Status +func (r PoliciesAPIGetClusterPoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PoliciesAPIGetClusterPoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r PoliciesAPIGetClusterPoliciesResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type PoliciesAPIUpsertClusterPoliciesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PoliciesV1Policies +} + +// Status returns HTTPResponse.Status +func (r PoliciesAPIUpsertClusterPoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PoliciesAPIUpsertClusterPoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r PoliciesAPIUpsertClusterPoliciesResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type ScheduledRebalancingAPIListRebalancingJobsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1ListRebalancingJobsResponse +} + +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPIListRebalancingJobsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPIListRebalancingJobsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPIListRebalancingJobsResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type ScheduledRebalancingAPICreateRebalancingJobResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1RebalancingJob +} + +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPICreateRebalancingJobResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPICreateRebalancingJobResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPICreateRebalancingJobResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type ScheduledRebalancingAPIDeleteRebalancingJobResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1DeleteRebalancingJobResponse +} + +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + +type ScheduledRebalancingAPIGetRebalancingJobResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1RebalancingJob +} + +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPIGetRebalancingJobResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ExternalClusterAPIGetAssumeRoleUser request - ExternalClusterAPIGetAssumeRoleUserWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRoleUserResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPIGetRebalancingJobResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ExternalClusterAPIGetCleanupScript request - ExternalClusterAPIGetCleanupScriptWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetCleanupScriptResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPIGetRebalancingJobResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPIGetCredentialsScript request - ExternalClusterAPIGetCredentialsScriptWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIGetCredentialsScriptParams) (*ExternalClusterAPIGetCredentialsScriptResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - // ExternalClusterAPIDisconnectCluster request with any body - ExternalClusterAPIDisconnectClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIDisconnectClusterResponse, error) +type ScheduledRebalancingAPIUpdateRebalancingJobResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1RebalancingJob +} - ExternalClusterAPIDisconnectClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIDisconnectClusterJSONRequestBody) (*ExternalClusterAPIDisconnectClusterResponse, error) +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ExternalClusterAPIHandleCloudEvent request with any body - ExternalClusterAPIHandleCloudEventWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIHandleCloudEventResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - ExternalClusterAPIHandleCloudEventWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIHandleCloudEventJSONRequestBody) (*ExternalClusterAPIHandleCloudEventResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPIListNodes request - ExternalClusterAPIListNodesWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIListNodesParams) (*ExternalClusterAPIListNodesResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - // ExternalClusterAPIAddNode request with any body - ExternalClusterAPIAddNodeWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIAddNodeResponse, error) +type ScheduledRebalancingAPIPreviewRebalancingScheduleResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScheduledrebalancingV1PreviewRebalancingScheduleResponse +} - ExternalClusterAPIAddNodeWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIAddNodeJSONRequestBody) (*ExternalClusterAPIAddNodeResponse, error) +// Status returns HTTPResponse.Status +func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ExternalClusterAPIDeleteNode request - ExternalClusterAPIDeleteNodeWithResponse(ctx context.Context, clusterId string, nodeId string, params *ExternalClusterAPIDeleteNodeParams) (*ExternalClusterAPIDeleteNodeResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ExternalClusterAPIGetNode request - ExternalClusterAPIGetNodeWithResponse(ctx context.Context, clusterId string, nodeId string) (*ExternalClusterAPIGetNodeResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) GetBody() []byte { + return r.Body +} - // ExternalClusterAPIDrainNode request with any body - ExternalClusterAPIDrainNodeWithBodyWithResponse(ctx context.Context, clusterId string, nodeId string, contentType string, body io.Reader) (*ExternalClusterAPIDrainNodeResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - ExternalClusterAPIDrainNodeWithResponse(ctx context.Context, clusterId string, nodeId string, body ExternalClusterAPIDrainNodeJSONRequestBody) (*ExternalClusterAPIDrainNodeResponse, error) +type ExternalClusterAPIListClustersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ExternalclusterV1ListClustersResponse +} - // ExternalClusterAPIReconcileCluster request - ExternalClusterAPIReconcileClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIReconcileClusterResponse, error) +// Status returns HTTPResponse.Status +func (r ExternalClusterAPIListClustersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ExternalClusterAPICreateClusterToken request - ExternalClusterAPICreateClusterTokenWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateClusterTokenResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ExternalClusterAPIListClustersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ScheduledRebalancingAPIListRebalancingSchedules request - ScheduledRebalancingAPIListRebalancingSchedulesWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListRebalancingSchedulesResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ExternalClusterAPIListClustersResponse) GetBody() []byte { + return r.Body +} - // ScheduledRebalancingAPICreateRebalancingSchedule request with any body - ScheduledRebalancingAPICreateRebalancingScheduleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - ScheduledRebalancingAPICreateRebalancingScheduleWithResponse(ctx context.Context, body ScheduledRebalancingAPICreateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) +type ExternalClusterAPIRegisterClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ExternalclusterV1Cluster +} - // ScheduledRebalancingAPIUpdateRebalancingSchedule request with any body - ScheduledRebalancingAPIUpdateRebalancingScheduleWithBodyWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, contentType string, body io.Reader) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) +// Status returns HTTPResponse.Status +func (r ExternalClusterAPIRegisterClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - ScheduledRebalancingAPIUpdateRebalancingScheduleWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, body ScheduledRebalancingAPIUpdateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ExternalClusterAPIRegisterClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // ScheduledRebalancingAPIDeleteRebalancingSchedule request - ScheduledRebalancingAPIDeleteRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIDeleteRebalancingScheduleResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ExternalClusterAPIRegisterClusterResponse) GetBody() []byte { + return r.Body +} - // ScheduledRebalancingAPIGetRebalancingSchedule request - ScheduledRebalancingAPIGetRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIGetRebalancingScheduleResponse, error) +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - // ExternalClusterAPIGetCleanupScriptTemplate request - ExternalClusterAPIGetCleanupScriptTemplateWithResponse(ctx context.Context, provider string) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) +type GetExternalClusterOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationResponse +} - // ExternalClusterAPIGetCredentialsScriptTemplate request - ExternalClusterAPIGetCredentialsScriptTemplateWithResponse(ctx context.Context, provider string, params *ExternalClusterAPIGetCredentialsScriptTemplateParams) (*ExternalClusterAPIGetCredentialsScriptTemplateResponse, error) +// Status returns HTTPResponse.Status +func (r GetExternalClusterOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ScheduledRebalancingAPIListAvailableRebalancingTZ request - ScheduledRebalancingAPIListAvailableRebalancingTZWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListAvailableRebalancingTZResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetExternalClusterOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type Response interface { - Status() string - StatusCode() int - GetBody() []byte +// Body returns body of byte array +func (r GetExternalClusterOperationResponse) GetBody() []byte { + return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AuthTokenAPIListAuthTokensResponse struct { +type ExternalClusterAPIDeleteClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CastaiAuthtokenV1beta1ListAuthTokensResponse } // Status returns HTTPResponse.Status -func (r AuthTokenAPIListAuthTokensResponse) Status() string { +func (r ExternalClusterAPIDeleteClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3822,7 +6045,7 @@ func (r AuthTokenAPIListAuthTokensResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AuthTokenAPIListAuthTokensResponse) StatusCode() int { +func (r ExternalClusterAPIDeleteClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3831,20 +6054,20 @@ func (r AuthTokenAPIListAuthTokensResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r AuthTokenAPIListAuthTokensResponse) GetBody() []byte { +func (r ExternalClusterAPIDeleteClusterResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AuthTokenAPICreateAuthTokenResponse struct { +type ExternalClusterAPIGetClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CastaiAuthtokenV1beta1AuthToken + JSON200 *ExternalclusterV1Cluster } // Status returns HTTPResponse.Status -func (r AuthTokenAPICreateAuthTokenResponse) Status() string { +func (r ExternalClusterAPIGetClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3852,7 +6075,7 @@ func (r AuthTokenAPICreateAuthTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AuthTokenAPICreateAuthTokenResponse) StatusCode() int { +func (r ExternalClusterAPIGetClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3861,20 +6084,20 @@ func (r AuthTokenAPICreateAuthTokenResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r AuthTokenAPICreateAuthTokenResponse) GetBody() []byte { +func (r ExternalClusterAPIGetClusterResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AuthTokenAPIDeleteAuthTokenResponse struct { +type ExternalClusterAPIUpdateClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CastaiAuthtokenV1beta1DeleteAuthTokenResponse + JSON200 *ExternalclusterV1Cluster } // Status returns HTTPResponse.Status -func (r AuthTokenAPIDeleteAuthTokenResponse) Status() string { +func (r ExternalClusterAPIUpdateClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3882,7 +6105,7 @@ func (r AuthTokenAPIDeleteAuthTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AuthTokenAPIDeleteAuthTokenResponse) StatusCode() int { +func (r ExternalClusterAPIUpdateClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3891,20 +6114,20 @@ func (r AuthTokenAPIDeleteAuthTokenResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r AuthTokenAPIDeleteAuthTokenResponse) GetBody() []byte { +func (r ExternalClusterAPIUpdateClusterResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AuthTokenAPIGetAuthTokenResponse struct { +type ExternalClusterAPIDeleteAssumeRolePrincipalResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CastaiAuthtokenV1beta1AuthToken + JSON200 *ExternalclusterV1DeleteAssumeRolePrincipalResponse } // Status returns HTTPResponse.Status -func (r AuthTokenAPIGetAuthTokenResponse) Status() string { +func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3912,7 +6135,7 @@ func (r AuthTokenAPIGetAuthTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AuthTokenAPIGetAuthTokenResponse) StatusCode() int { +func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3921,20 +6144,20 @@ func (r AuthTokenAPIGetAuthTokenResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r AuthTokenAPIGetAuthTokenResponse) GetBody() []byte { +func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AuthTokenAPIUpdateAuthTokenResponse struct { +type ExternalClusterAPIGetAssumeRolePrincipalResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CastaiAuthtokenV1beta1AuthToken + JSON200 *ExternalclusterV1GetAssumeRolePrincipalResponse } // Status returns HTTPResponse.Status -func (r AuthTokenAPIUpdateAuthTokenResponse) Status() string { +func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3942,7 +6165,7 @@ func (r AuthTokenAPIUpdateAuthTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AuthTokenAPIUpdateAuthTokenResponse) StatusCode() int { +func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3951,20 +6174,20 @@ func (r AuthTokenAPIUpdateAuthTokenResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r AuthTokenAPIUpdateAuthTokenResponse) GetBody() []byte { +func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeTemplatesAPIFilterInstanceTypesResponse struct { +type ExternalClusterAPICreateAssumeRolePrincipalResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodetemplatesV1FilterInstanceTypesResponse + JSON200 *ExternalclusterV1CreateAssumeRolePrincipalResponse } // Status returns HTTPResponse.Status -func (r NodeTemplatesAPIFilterInstanceTypesResponse) Status() string { +func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3972,7 +6195,7 @@ func (r NodeTemplatesAPIFilterInstanceTypesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeTemplatesAPIFilterInstanceTypesResponse) StatusCode() int { +func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -3981,20 +6204,20 @@ func (r NodeTemplatesAPIFilterInstanceTypesResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeTemplatesAPIFilterInstanceTypesResponse) GetBody() []byte { +func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPIListConfigurationsResponse struct { +type ExternalClusterAPIGetAssumeRoleUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1ListConfigurationsResponse + JSON200 *ExternalclusterV1GetAssumeRoleUserResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPIListConfigurationsResponse) Status() string { +func (r ExternalClusterAPIGetAssumeRoleUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4002,7 +6225,7 @@ func (r NodeConfigurationAPIListConfigurationsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPIListConfigurationsResponse) StatusCode() int { +func (r ExternalClusterAPIGetAssumeRoleUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4011,20 +6234,20 @@ func (r NodeConfigurationAPIListConfigurationsResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPIListConfigurationsResponse) GetBody() []byte { +func (r ExternalClusterAPIGetAssumeRoleUserResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPICreateConfigurationResponse struct { +type ExternalClusterAPIGetCleanupScriptResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1NodeConfiguration + JSON200 *ExternalclusterV1GetCleanupScriptResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPICreateConfigurationResponse) Status() string { +func (r ExternalClusterAPIGetCleanupScriptResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4032,7 +6255,7 @@ func (r NodeConfigurationAPICreateConfigurationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPICreateConfigurationResponse) StatusCode() int { +func (r ExternalClusterAPIGetCleanupScriptResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4041,20 +6264,20 @@ func (r NodeConfigurationAPICreateConfigurationResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPICreateConfigurationResponse) GetBody() []byte { +func (r ExternalClusterAPIGetCleanupScriptResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPIGetSuggestedConfigurationResponse struct { +type ExternalClusterAPIGetCredentialsScriptResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1GetSuggestedConfigurationResponse + JSON200 *ExternalclusterV1GetCredentialsScriptResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) Status() string { +func (r ExternalClusterAPIGetCredentialsScriptResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4062,7 +6285,7 @@ func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) StatusCode() int { +func (r ExternalClusterAPIGetCredentialsScriptResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4071,20 +6294,20 @@ func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) StatusCode() int // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPIGetSuggestedConfigurationResponse) GetBody() []byte { +func (r ExternalClusterAPIGetCredentialsScriptResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPIDeleteConfigurationResponse struct { +type ExternalClusterAPIDisconnectClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1DeleteConfigurationResponse + JSON200 *ExternalclusterV1Cluster } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPIDeleteConfigurationResponse) Status() string { +func (r ExternalClusterAPIDisconnectClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4092,7 +6315,7 @@ func (r NodeConfigurationAPIDeleteConfigurationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPIDeleteConfigurationResponse) StatusCode() int { +func (r ExternalClusterAPIDisconnectClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4101,20 +6324,20 @@ func (r NodeConfigurationAPIDeleteConfigurationResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPIDeleteConfigurationResponse) GetBody() []byte { +func (r ExternalClusterAPIDisconnectClusterResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPIGetConfigurationResponse struct { +type ExternalClusterAPIHandleCloudEventResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1NodeConfiguration + JSON200 *ExternalclusterV1HandleCloudEventResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPIGetConfigurationResponse) Status() string { +func (r ExternalClusterAPIHandleCloudEventResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4122,7 +6345,7 @@ func (r NodeConfigurationAPIGetConfigurationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPIGetConfigurationResponse) StatusCode() int { +func (r ExternalClusterAPIHandleCloudEventResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4131,20 +6354,20 @@ func (r NodeConfigurationAPIGetConfigurationResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPIGetConfigurationResponse) GetBody() []byte { +func (r ExternalClusterAPIHandleCloudEventResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPIUpdateConfigurationResponse struct { +type ExternalClusterAPIListNodesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1NodeConfiguration + JSON200 *ExternalclusterV1ListNodesResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPIUpdateConfigurationResponse) Status() string { +func (r ExternalClusterAPIListNodesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4152,7 +6375,7 @@ func (r NodeConfigurationAPIUpdateConfigurationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPIUpdateConfigurationResponse) StatusCode() int { +func (r ExternalClusterAPIListNodesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4161,20 +6384,20 @@ func (r NodeConfigurationAPIUpdateConfigurationResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPIUpdateConfigurationResponse) GetBody() []byte { +func (r ExternalClusterAPIListNodesResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeConfigurationAPISetDefaultResponse struct { +type ExternalClusterAPIAddNodeResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodeconfigV1NodeConfiguration + JSON200 *ExternalclusterV1AddNodeResponse } // Status returns HTTPResponse.Status -func (r NodeConfigurationAPISetDefaultResponse) Status() string { +func (r ExternalClusterAPIAddNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4182,7 +6405,7 @@ func (r NodeConfigurationAPISetDefaultResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeConfigurationAPISetDefaultResponse) StatusCode() int { +func (r ExternalClusterAPIAddNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4191,20 +6414,20 @@ func (r NodeConfigurationAPISetDefaultResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeConfigurationAPISetDefaultResponse) GetBody() []byte { +func (r ExternalClusterAPIAddNodeResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type PoliciesAPIGetClusterNodeConstraintsResponse struct { +type ExternalClusterAPIDeleteNodeResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PoliciesV1GetClusterNodeConstraintsResponse + JSON200 *ExternalclusterV1DeleteNodeResponse } // Status returns HTTPResponse.Status -func (r PoliciesAPIGetClusterNodeConstraintsResponse) Status() string { +func (r ExternalClusterAPIDeleteNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4212,7 +6435,7 @@ func (r PoliciesAPIGetClusterNodeConstraintsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PoliciesAPIGetClusterNodeConstraintsResponse) StatusCode() int { +func (r ExternalClusterAPIDeleteNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4221,20 +6444,20 @@ func (r PoliciesAPIGetClusterNodeConstraintsResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r PoliciesAPIGetClusterNodeConstraintsResponse) GetBody() []byte { +func (r ExternalClusterAPIDeleteNodeResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeTemplatesAPIListNodeTemplatesResponse struct { +type ExternalClusterAPIGetNodeResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodetemplatesV1ListNodeTemplatesResponse + JSON200 *ExternalclusterV1Node } // Status returns HTTPResponse.Status -func (r NodeTemplatesAPIListNodeTemplatesResponse) Status() string { +func (r ExternalClusterAPIGetNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4242,7 +6465,7 @@ func (r NodeTemplatesAPIListNodeTemplatesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeTemplatesAPIListNodeTemplatesResponse) StatusCode() int { +func (r ExternalClusterAPIGetNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4251,20 +6474,20 @@ func (r NodeTemplatesAPIListNodeTemplatesResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeTemplatesAPIListNodeTemplatesResponse) GetBody() []byte { +func (r ExternalClusterAPIGetNodeResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeTemplatesAPICreateNodeTemplateResponse struct { +type ExternalClusterAPIDrainNodeResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodetemplatesV1NodeTemplate + JSON200 *ExternalclusterV1DrainNodeResponse } // Status returns HTTPResponse.Status -func (r NodeTemplatesAPICreateNodeTemplateResponse) Status() string { +func (r ExternalClusterAPIDrainNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4272,7 +6495,7 @@ func (r NodeTemplatesAPICreateNodeTemplateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeTemplatesAPICreateNodeTemplateResponse) StatusCode() int { +func (r ExternalClusterAPIDrainNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4281,20 +6504,20 @@ func (r NodeTemplatesAPICreateNodeTemplateResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeTemplatesAPICreateNodeTemplateResponse) GetBody() []byte { +func (r ExternalClusterAPIDrainNodeResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeTemplatesAPIDeleteNodeTemplateResponse struct { +type ExternalClusterAPIReconcileClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodetemplatesV1DeleteNodeTemplateResponse + JSON200 *ExternalclusterV1ReconcileClusterResponse } // Status returns HTTPResponse.Status -func (r NodeTemplatesAPIDeleteNodeTemplateResponse) Status() string { +func (r ExternalClusterAPIReconcileClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4302,7 +6525,7 @@ func (r NodeTemplatesAPIDeleteNodeTemplateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeTemplatesAPIDeleteNodeTemplateResponse) StatusCode() int { +func (r ExternalClusterAPIReconcileClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4311,20 +6534,20 @@ func (r NodeTemplatesAPIDeleteNodeTemplateResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeTemplatesAPIDeleteNodeTemplateResponse) GetBody() []byte { +func (r ExternalClusterAPIReconcileClusterResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type NodeTemplatesAPIUpdateNodeTemplateResponse struct { +type ExternalClusterAPICreateClusterTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *NodetemplatesV1NodeTemplate + JSON200 *ExternalclusterV1CreateClusterTokenResponse } // Status returns HTTPResponse.Status -func (r NodeTemplatesAPIUpdateNodeTemplateResponse) Status() string { +func (r ExternalClusterAPICreateClusterTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4332,7 +6555,7 @@ func (r NodeTemplatesAPIUpdateNodeTemplateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r NodeTemplatesAPIUpdateNodeTemplateResponse) StatusCode() int { +func (r ExternalClusterAPICreateClusterTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4341,20 +6564,20 @@ func (r NodeTemplatesAPIUpdateNodeTemplateResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r NodeTemplatesAPIUpdateNodeTemplateResponse) GetBody() []byte { +func (r ExternalClusterAPICreateClusterTokenResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type PoliciesAPIGetClusterPoliciesResponse struct { +type CurrentUserProfileResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PoliciesV1Policies + JSON200 *UserProfileResponse } // Status returns HTTPResponse.Status -func (r PoliciesAPIGetClusterPoliciesResponse) Status() string { +func (r CurrentUserProfileResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4362,7 +6585,7 @@ func (r PoliciesAPIGetClusterPoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PoliciesAPIGetClusterPoliciesResponse) StatusCode() int { +func (r CurrentUserProfileResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4371,20 +6594,20 @@ func (r PoliciesAPIGetClusterPoliciesResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r PoliciesAPIGetClusterPoliciesResponse) GetBody() []byte { +func (r CurrentUserProfileResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type PoliciesAPIUpsertClusterPoliciesResponse struct { +type UpdateCurrentUserProfileResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PoliciesV1Policies + JSON200 *UserProfile } // Status returns HTTPResponse.Status -func (r PoliciesAPIUpsertClusterPoliciesResponse) Status() string { +func (r UpdateCurrentUserProfileResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4392,7 +6615,7 @@ func (r PoliciesAPIUpsertClusterPoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PoliciesAPIUpsertClusterPoliciesResponse) StatusCode() int { +func (r UpdateCurrentUserProfileResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4401,20 +6624,20 @@ func (r PoliciesAPIUpsertClusterPoliciesResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r PoliciesAPIUpsertClusterPoliciesResponse) GetBody() []byte { +func (r UpdateCurrentUserProfileResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPIListRebalancingJobsResponse struct { +type ListOrganizationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1ListRebalancingJobsResponse + JSON200 *OrganizationsList } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIListRebalancingJobsResponse) Status() string { +func (r ListOrganizationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4422,7 +6645,7 @@ func (r ScheduledRebalancingAPIListRebalancingJobsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIListRebalancingJobsResponse) StatusCode() int { +func (r ListOrganizationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4431,20 +6654,20 @@ func (r ScheduledRebalancingAPIListRebalancingJobsResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPIListRebalancingJobsResponse) GetBody() []byte { +func (r ListOrganizationsResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPICreateRebalancingJobResponse struct { +type CreateOrganizationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingJob + JSON200 *Organization } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPICreateRebalancingJobResponse) Status() string { +func (r CreateOrganizationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4452,7 +6675,7 @@ func (r ScheduledRebalancingAPICreateRebalancingJobResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPICreateRebalancingJobResponse) StatusCode() int { +func (r CreateOrganizationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4461,20 +6684,20 @@ func (r ScheduledRebalancingAPICreateRebalancingJobResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPICreateRebalancingJobResponse) GetBody() []byte { +func (r CreateOrganizationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPIDeleteRebalancingJobResponse struct { +type DeleteOrganizationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1DeleteRebalancingJobResponse + JSON200 *Organization } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) Status() string { +func (r DeleteOrganizationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4482,7 +6705,7 @@ func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) StatusCode() int { +func (r DeleteOrganizationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4491,20 +6714,20 @@ func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPIDeleteRebalancingJobResponse) GetBody() []byte { +func (r DeleteOrganizationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPIGetRebalancingJobResponse struct { +type GetOrganizationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingJob + JSON200 *Organization } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIGetRebalancingJobResponse) Status() string { +func (r GetOrganizationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4512,7 +6735,7 @@ func (r ScheduledRebalancingAPIGetRebalancingJobResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIGetRebalancingJobResponse) StatusCode() int { +func (r GetOrganizationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4521,20 +6744,20 @@ func (r ScheduledRebalancingAPIGetRebalancingJobResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPIGetRebalancingJobResponse) GetBody() []byte { +func (r GetOrganizationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPIUpdateRebalancingJobResponse struct { +type UpdateOrganizationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingJob + JSON200 *Organization } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) Status() string { +func (r UpdateOrganizationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4542,7 +6765,7 @@ func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) StatusCode() int { +func (r UpdateOrganizationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4551,20 +6774,20 @@ func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPIUpdateRebalancingJobResponse) GetBody() []byte { +func (r UpdateOrganizationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ScheduledRebalancingAPIPreviewRebalancingScheduleResponse struct { +type GetOrganizationUsersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1PreviewRebalancingScheduleResponse + JSON200 *OrganizationUsersList } // Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) Status() string { +func (r GetOrganizationUsersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4572,7 +6795,7 @@ func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) Status() stri } // StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) StatusCode() int { +func (r GetOrganizationUsersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4581,20 +6804,20 @@ func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) StatusCode() // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ScheduledRebalancingAPIPreviewRebalancingScheduleResponse) GetBody() []byte { +func (r GetOrganizationUsersResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIListClustersResponse struct { +type CreateOrganizationUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1ListClustersResponse + JSON200 *OrganizationUser } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIListClustersResponse) Status() string { +func (r CreateOrganizationUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4602,7 +6825,7 @@ func (r ExternalClusterAPIListClustersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIListClustersResponse) StatusCode() int { +func (r CreateOrganizationUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4611,20 +6834,20 @@ func (r ExternalClusterAPIListClustersResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIListClustersResponse) GetBody() []byte { +func (r CreateOrganizationUserResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIRegisterClusterResponse struct { +type DeleteOrganizationUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1Cluster + JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIRegisterClusterResponse) Status() string { +func (r DeleteOrganizationUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4632,7 +6855,7 @@ func (r ExternalClusterAPIRegisterClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIRegisterClusterResponse) StatusCode() int { +func (r DeleteOrganizationUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4641,20 +6864,20 @@ func (r ExternalClusterAPIRegisterClusterResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIRegisterClusterResponse) GetBody() []byte { +func (r DeleteOrganizationUserResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type GetExternalClusterOperationResponse struct { +type UpdateOrganizationUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *OperationResponse + JSON200 *OrganizationUser } // Status returns HTTPResponse.Status -func (r GetExternalClusterOperationResponse) Status() string { +func (r UpdateOrganizationUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4662,7 +6885,7 @@ func (r GetExternalClusterOperationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetExternalClusterOperationResponse) StatusCode() int { +func (r UpdateOrganizationUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4671,19 +6894,20 @@ func (r GetExternalClusterOperationResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r GetExternalClusterOperationResponse) GetBody() []byte { +func (r UpdateOrganizationUserResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIDeleteClusterResponse struct { +type InventoryAPISyncClusterResourcesResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIDeleteClusterResponse) Status() string { +func (r InventoryAPISyncClusterResourcesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4691,7 +6915,7 @@ func (r ExternalClusterAPIDeleteClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIDeleteClusterResponse) StatusCode() int { +func (r InventoryAPISyncClusterResourcesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4700,20 +6924,20 @@ func (r ExternalClusterAPIDeleteClusterResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIDeleteClusterResponse) GetBody() []byte { +func (r InventoryAPISyncClusterResourcesResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetClusterResponse struct { +type InventoryAPIGetReservationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1Cluster + JSON200 *CastaiInventoryV1beta1GetReservationsResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetClusterResponse) Status() string { +func (r InventoryAPIGetReservationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4721,7 +6945,7 @@ func (r ExternalClusterAPIGetClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetClusterResponse) StatusCode() int { +func (r InventoryAPIGetReservationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4730,20 +6954,20 @@ func (r ExternalClusterAPIGetClusterResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetClusterResponse) GetBody() []byte { +func (r InventoryAPIGetReservationsResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIUpdateClusterResponse struct { +type InventoryAPIAddReservationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1Cluster + JSON200 *CastaiInventoryV1beta1AddReservationResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIUpdateClusterResponse) Status() string { +func (r InventoryAPIAddReservationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4751,7 +6975,7 @@ func (r ExternalClusterAPIUpdateClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIUpdateClusterResponse) StatusCode() int { +func (r InventoryAPIAddReservationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4760,20 +6984,20 @@ func (r ExternalClusterAPIUpdateClusterResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIUpdateClusterResponse) GetBody() []byte { +func (r InventoryAPIAddReservationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIDeleteAssumeRolePrincipalResponse struct { +type InventoryAPIGetReservationsBalanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1DeleteAssumeRolePrincipalResponse + JSON200 *CastaiInventoryV1beta1GetReservationsBalanceResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) Status() string { +func (r InventoryAPIGetReservationsBalanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4781,7 +7005,7 @@ func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) StatusCode() int { +func (r InventoryAPIGetReservationsBalanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4790,20 +7014,20 @@ func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIDeleteAssumeRolePrincipalResponse) GetBody() []byte { +func (r InventoryAPIGetReservationsBalanceResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetAssumeRolePrincipalResponse struct { +type InventoryAPIOverwriteReservationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1GetAssumeRolePrincipalResponse + JSON200 *CastaiInventoryV1beta1OverwriteReservationsResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) Status() string { +func (r InventoryAPIOverwriteReservationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4811,7 +7035,7 @@ func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) StatusCode() int { +func (r InventoryAPIOverwriteReservationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4820,20 +7044,20 @@ func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetAssumeRolePrincipalResponse) GetBody() []byte { +func (r InventoryAPIOverwriteReservationsResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPICreateAssumeRolePrincipalResponse struct { +type InventoryAPIDeleteReservationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1CreateAssumeRolePrincipalResponse + JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) Status() string { +func (r InventoryAPIDeleteReservationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4841,7 +7065,7 @@ func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) StatusCode() int { +func (r InventoryAPIDeleteReservationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4850,20 +7074,20 @@ func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPICreateAssumeRolePrincipalResponse) GetBody() []byte { +func (r InventoryAPIDeleteReservationResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetAssumeRoleUserResponse struct { +type InventoryAPIGetResourceUsageResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1GetAssumeRoleUserResponse + JSON200 *CastaiInventoryV1beta1GetResourceUsageResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetAssumeRoleUserResponse) Status() string { +func (r InventoryAPIGetResourceUsageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4871,7 +7095,7 @@ func (r ExternalClusterAPIGetAssumeRoleUserResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetAssumeRoleUserResponse) StatusCode() int { +func (r InventoryAPIGetResourceUsageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4880,20 +7104,20 @@ func (r ExternalClusterAPIGetAssumeRoleUserResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetAssumeRoleUserResponse) GetBody() []byte { +func (r InventoryAPIGetResourceUsageResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetCleanupScriptResponse struct { +type ScheduledRebalancingAPIListRebalancingSchedulesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1GetCleanupScriptResponse + JSON200 *ScheduledrebalancingV1ListRebalancingSchedulesResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetCleanupScriptResponse) Status() string { +func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4901,7 +7125,7 @@ func (r ExternalClusterAPIGetCleanupScriptResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetCleanupScriptResponse) StatusCode() int { +func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4910,20 +7134,20 @@ func (r ExternalClusterAPIGetCleanupScriptResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetCleanupScriptResponse) GetBody() []byte { +func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetCredentialsScriptResponse struct { +type ScheduledRebalancingAPICreateRebalancingScheduleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1GetCredentialsScriptResponse + JSON200 *ScheduledrebalancingV1RebalancingSchedule } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetCredentialsScriptResponse) Status() string { +func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4931,7 +7155,7 @@ func (r ExternalClusterAPIGetCredentialsScriptResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetCredentialsScriptResponse) StatusCode() int { +func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4940,20 +7164,20 @@ func (r ExternalClusterAPIGetCredentialsScriptResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetCredentialsScriptResponse) GetBody() []byte { +func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIDisconnectClusterResponse struct { +type ScheduledRebalancingAPIUpdateRebalancingScheduleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1Cluster + JSON200 *ScheduledrebalancingV1RebalancingSchedule } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIDisconnectClusterResponse) Status() string { +func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4961,7 +7185,7 @@ func (r ExternalClusterAPIDisconnectClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIDisconnectClusterResponse) StatusCode() int { +func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4970,20 +7194,20 @@ func (r ExternalClusterAPIDisconnectClusterResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIDisconnectClusterResponse) GetBody() []byte { +func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIHandleCloudEventResponse struct { +type ScheduledRebalancingAPIDeleteRebalancingScheduleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1HandleCloudEventResponse + JSON200 *ScheduledrebalancingV1DeleteRebalancingScheduleResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIHandleCloudEventResponse) Status() string { +func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4991,7 +7215,7 @@ func (r ExternalClusterAPIHandleCloudEventResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIHandleCloudEventResponse) StatusCode() int { +func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5000,20 +7224,20 @@ func (r ExternalClusterAPIHandleCloudEventResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIHandleCloudEventResponse) GetBody() []byte { +func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIListNodesResponse struct { +type ScheduledRebalancingAPIGetRebalancingScheduleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1ListNodesResponse + JSON200 *ScheduledrebalancingV1RebalancingSchedule } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIListNodesResponse) Status() string { +func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5021,7 +7245,7 @@ func (r ExternalClusterAPIListNodesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIListNodesResponse) StatusCode() int { +func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5030,20 +7254,19 @@ func (r ExternalClusterAPIListNodesResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIListNodesResponse) GetBody() []byte { +func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIAddNodeResponse struct { +type ExternalClusterAPIGetCleanupScriptTemplateResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1AddNodeResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIAddNodeResponse) Status() string { +func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5051,7 +7274,7 @@ func (r ExternalClusterAPIAddNodeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIAddNodeResponse) StatusCode() int { +func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5060,20 +7283,19 @@ func (r ExternalClusterAPIAddNodeResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIAddNodeResponse) GetBody() []byte { +func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIDeleteNodeResponse struct { +type ExternalClusterAPIGetCredentialsScriptTemplateResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1DeleteNodeResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIDeleteNodeResponse) Status() string { +func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5081,7 +7303,7 @@ func (r ExternalClusterAPIDeleteNodeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIDeleteNodeResponse) StatusCode() int { +func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5090,20 +7312,20 @@ func (r ExternalClusterAPIDeleteNodeResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIDeleteNodeResponse) GetBody() []byte { +func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIGetNodeResponse struct { +type ScheduledRebalancingAPIListAvailableRebalancingTZResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ExternalclusterV1Node + JSON200 *ScheduledrebalancingV1ListAvailableRebalancingTZResponse } // Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetNodeResponse) Status() string { +func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5111,7 +7333,7 @@ func (r ExternalClusterAPIGetNodeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetNodeResponse) StatusCode() int { +func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5120,1003 +7342,1447 @@ func (r ExternalClusterAPIGetNodeResponse) StatusCode() int { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 // Body returns body of byte array -func (r ExternalClusterAPIGetNodeResponse) GetBody() []byte { +func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) GetBody() []byte { return r.Body } // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type ExternalClusterAPIDrainNodeResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ExternalclusterV1DrainNodeResponse +// AuthTokenAPIListAuthTokensWithResponse request returning *AuthTokenAPIListAuthTokensResponse +func (c *ClientWithResponses) AuthTokenAPIListAuthTokensWithResponse(ctx context.Context, params *AuthTokenAPIListAuthTokensParams) (*AuthTokenAPIListAuthTokensResponse, error) { + rsp, err := c.AuthTokenAPIListAuthTokens(ctx, params) + if err != nil { + return nil, err + } + return ParseAuthTokenAPIListAuthTokensResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExternalClusterAPIDrainNodeResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// AuthTokenAPICreateAuthTokenWithBodyWithResponse request with arbitrary body returning *AuthTokenAPICreateAuthTokenResponse +func (c *ClientWithResponses) AuthTokenAPICreateAuthTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*AuthTokenAPICreateAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPICreateAuthTokenWithBody(ctx, contentType, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseAuthTokenAPICreateAuthTokenResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIDrainNodeResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) AuthTokenAPICreateAuthTokenWithResponse(ctx context.Context, body AuthTokenAPICreateAuthTokenJSONRequestBody) (*AuthTokenAPICreateAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPICreateAuthToken(ctx, body) + if err != nil { + return nil, err + } + return ParseAuthTokenAPICreateAuthTokenResponse(rsp) +} + +// AuthTokenAPIDeleteAuthTokenWithResponse request returning *AuthTokenAPIDeleteAuthTokenResponse +func (c *ClientWithResponses) AuthTokenAPIDeleteAuthTokenWithResponse(ctx context.Context, id string) (*AuthTokenAPIDeleteAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPIDeleteAuthToken(ctx, id) + if err != nil { + return nil, err + } + return ParseAuthTokenAPIDeleteAuthTokenResponse(rsp) +} + +// AuthTokenAPIGetAuthTokenWithResponse request returning *AuthTokenAPIGetAuthTokenResponse +func (c *ClientWithResponses) AuthTokenAPIGetAuthTokenWithResponse(ctx context.Context, id string) (*AuthTokenAPIGetAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPIGetAuthToken(ctx, id) + if err != nil { + return nil, err + } + return ParseAuthTokenAPIGetAuthTokenResponse(rsp) +} + +// AuthTokenAPIUpdateAuthTokenWithBodyWithResponse request with arbitrary body returning *AuthTokenAPIUpdateAuthTokenResponse +func (c *ClientWithResponses) AuthTokenAPIUpdateAuthTokenWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*AuthTokenAPIUpdateAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPIUpdateAuthTokenWithBody(ctx, id, contentType, body) + if err != nil { + return nil, err + } + return ParseAuthTokenAPIUpdateAuthTokenResponse(rsp) +} + +func (c *ClientWithResponses) AuthTokenAPIUpdateAuthTokenWithResponse(ctx context.Context, id string, body AuthTokenAPIUpdateAuthTokenJSONRequestBody) (*AuthTokenAPIUpdateAuthTokenResponse, error) { + rsp, err := c.AuthTokenAPIUpdateAuthToken(ctx, id, body) + if err != nil { + return nil, err + } + return ParseAuthTokenAPIUpdateAuthTokenResponse(rsp) +} + +// CreateInvitationWithBodyWithResponse request with arbitrary body returning *CreateInvitationResponse +func (c *ClientWithResponses) CreateInvitationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateInvitationResponse, error) { + rsp, err := c.CreateInvitationWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseCreateInvitationResponse(rsp) +} + +func (c *ClientWithResponses) CreateInvitationWithResponse(ctx context.Context, body CreateInvitationJSONRequestBody) (*CreateInvitationResponse, error) { + rsp, err := c.CreateInvitation(ctx, body) + if err != nil { + return nil, err + } + return ParseCreateInvitationResponse(rsp) +} + +// ClaimInvitationWithBodyWithResponse request with arbitrary body returning *ClaimInvitationResponse +func (c *ClientWithResponses) ClaimInvitationWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*ClaimInvitationResponse, error) { + rsp, err := c.ClaimInvitationWithBody(ctx, id, contentType, body) + if err != nil { + return nil, err + } + return ParseClaimInvitationResponse(rsp) +} + +func (c *ClientWithResponses) ClaimInvitationWithResponse(ctx context.Context, id string, body ClaimInvitationJSONRequestBody) (*ClaimInvitationResponse, error) { + rsp, err := c.ClaimInvitation(ctx, id, body) + if err != nil { + return nil, err + } + return ParseClaimInvitationResponse(rsp) +} + +// NodeTemplatesAPIFilterInstanceTypesWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPIFilterInstanceTypesResponse +func (c *ClientWithResponses) NodeTemplatesAPIFilterInstanceTypesWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { + rsp, err := c.NodeTemplatesAPIFilterInstanceTypesWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp) +} + +func (c *ClientWithResponses) NodeTemplatesAPIFilterInstanceTypesWithResponse(ctx context.Context, clusterId string, body NodeTemplatesAPIFilterInstanceTypesJSONRequestBody) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { + rsp, err := c.NodeTemplatesAPIFilterInstanceTypes(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp) +} + +// NodeConfigurationAPIListConfigurationsWithResponse request returning *NodeConfigurationAPIListConfigurationsResponse +func (c *ClientWithResponses) NodeConfigurationAPIListConfigurationsWithResponse(ctx context.Context, clusterId string) (*NodeConfigurationAPIListConfigurationsResponse, error) { + rsp, err := c.NodeConfigurationAPIListConfigurations(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIListConfigurationsResponse(rsp) +} + +// NodeConfigurationAPICreateConfigurationWithBodyWithResponse request with arbitrary body returning *NodeConfigurationAPICreateConfigurationResponse +func (c *ClientWithResponses) NodeConfigurationAPICreateConfigurationWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeConfigurationAPICreateConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPICreateConfigurationWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPICreateConfigurationResponse(rsp) +} + +func (c *ClientWithResponses) NodeConfigurationAPICreateConfigurationWithResponse(ctx context.Context, clusterId string, body NodeConfigurationAPICreateConfigurationJSONRequestBody) (*NodeConfigurationAPICreateConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPICreateConfiguration(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPICreateConfigurationResponse(rsp) +} + +// NodeConfigurationAPIGetSuggestedConfigurationWithResponse request returning *NodeConfigurationAPIGetSuggestedConfigurationResponse +func (c *ClientWithResponses) NodeConfigurationAPIGetSuggestedConfigurationWithResponse(ctx context.Context, clusterId string) (*NodeConfigurationAPIGetSuggestedConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPIGetSuggestedConfiguration(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIGetSuggestedConfigurationResponse(rsp) +} + +// NodeConfigurationAPIDeleteConfigurationWithResponse request returning *NodeConfigurationAPIDeleteConfigurationResponse +func (c *ClientWithResponses) NodeConfigurationAPIDeleteConfigurationWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPIDeleteConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPIDeleteConfiguration(ctx, clusterId, id) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIDeleteConfigurationResponse(rsp) +} + +// NodeConfigurationAPIGetConfigurationWithResponse request returning *NodeConfigurationAPIGetConfigurationResponse +func (c *ClientWithResponses) NodeConfigurationAPIGetConfigurationWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPIGetConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPIGetConfiguration(ctx, clusterId, id) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIGetConfigurationResponse(rsp) +} + +// NodeConfigurationAPIUpdateConfigurationWithBodyWithResponse request with arbitrary body returning *NodeConfigurationAPIUpdateConfigurationResponse +func (c *ClientWithResponses) NodeConfigurationAPIUpdateConfigurationWithBodyWithResponse(ctx context.Context, clusterId string, id string, contentType string, body io.Reader) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPIUpdateConfigurationWithBody(ctx, clusterId, id, contentType, body) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp) +} + +func (c *ClientWithResponses) NodeConfigurationAPIUpdateConfigurationWithResponse(ctx context.Context, clusterId string, id string, body NodeConfigurationAPIUpdateConfigurationJSONRequestBody) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { + rsp, err := c.NodeConfigurationAPIUpdateConfiguration(ctx, clusterId, id, body) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp) +} + +// NodeConfigurationAPISetDefaultWithResponse request returning *NodeConfigurationAPISetDefaultResponse +func (c *ClientWithResponses) NodeConfigurationAPISetDefaultWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPISetDefaultResponse, error) { + rsp, err := c.NodeConfigurationAPISetDefault(ctx, clusterId, id) + if err != nil { + return nil, err + } + return ParseNodeConfigurationAPISetDefaultResponse(rsp) +} + +// PoliciesAPIGetClusterNodeConstraintsWithResponse request returning *PoliciesAPIGetClusterNodeConstraintsResponse +func (c *ClientWithResponses) PoliciesAPIGetClusterNodeConstraintsWithResponse(ctx context.Context, clusterId string) (*PoliciesAPIGetClusterNodeConstraintsResponse, error) { + rsp, err := c.PoliciesAPIGetClusterNodeConstraints(ctx, clusterId) + if err != nil { + return nil, err + } + return ParsePoliciesAPIGetClusterNodeConstraintsResponse(rsp) +} + +// NodeTemplatesAPIListNodeTemplatesWithResponse request returning *NodeTemplatesAPIListNodeTemplatesResponse +func (c *ClientWithResponses) NodeTemplatesAPIListNodeTemplatesWithResponse(ctx context.Context, clusterId string, params *NodeTemplatesAPIListNodeTemplatesParams) (*NodeTemplatesAPIListNodeTemplatesResponse, error) { + rsp, err := c.NodeTemplatesAPIListNodeTemplates(ctx, clusterId, params) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPIListNodeTemplatesResponse(rsp) +} + +// NodeTemplatesAPICreateNodeTemplateWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPICreateNodeTemplateResponse +func (c *ClientWithResponses) NodeTemplatesAPICreateNodeTemplateWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { + rsp, err := c.NodeTemplatesAPICreateNodeTemplateWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp) +} + +func (c *ClientWithResponses) NodeTemplatesAPICreateNodeTemplateWithResponse(ctx context.Context, clusterId string, body NodeTemplatesAPICreateNodeTemplateJSONRequestBody) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { + rsp, err := c.NodeTemplatesAPICreateNodeTemplate(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp) +} + +// NodeTemplatesAPIDeleteNodeTemplateWithResponse request returning *NodeTemplatesAPIDeleteNodeTemplateResponse +func (c *ClientWithResponses) NodeTemplatesAPIDeleteNodeTemplateWithResponse(ctx context.Context, clusterId string, nodeTemplateName string) (*NodeTemplatesAPIDeleteNodeTemplateResponse, error) { + rsp, err := c.NodeTemplatesAPIDeleteNodeTemplate(ctx, clusterId, nodeTemplateName) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPIDeleteNodeTemplateResponse(rsp) +} + +// NodeTemplatesAPIUpdateNodeTemplateWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPIUpdateNodeTemplateResponse +func (c *ClientWithResponses) NodeTemplatesAPIUpdateNodeTemplateWithBodyWithResponse(ctx context.Context, clusterId string, nodeTemplateName string, contentType string, body io.Reader) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { + rsp, err := c.NodeTemplatesAPIUpdateNodeTemplateWithBody(ctx, clusterId, nodeTemplateName, contentType, body) + if err != nil { + return nil, err } - return 0 + return ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ExternalClusterAPIDrainNodeResponse) GetBody() []byte { - return r.Body +func (c *ClientWithResponses) NodeTemplatesAPIUpdateNodeTemplateWithResponse(ctx context.Context, clusterId string, nodeTemplateName string, body NodeTemplatesAPIUpdateNodeTemplateJSONRequestBody) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { + rsp, err := c.NodeTemplatesAPIUpdateNodeTemplate(ctx, clusterId, nodeTemplateName, body) + if err != nil { + return nil, err + } + return ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ExternalClusterAPIReconcileClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ExternalclusterV1ReconcileClusterResponse +// PoliciesAPIGetClusterPoliciesWithResponse request returning *PoliciesAPIGetClusterPoliciesResponse +func (c *ClientWithResponses) PoliciesAPIGetClusterPoliciesWithResponse(ctx context.Context, clusterId string) (*PoliciesAPIGetClusterPoliciesResponse, error) { + rsp, err := c.PoliciesAPIGetClusterPolicies(ctx, clusterId) + if err != nil { + return nil, err + } + return ParsePoliciesAPIGetClusterPoliciesResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExternalClusterAPIReconcileClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// PoliciesAPIUpsertClusterPoliciesWithBodyWithResponse request with arbitrary body returning *PoliciesAPIUpsertClusterPoliciesResponse +func (c *ClientWithResponses) PoliciesAPIUpsertClusterPoliciesWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { + rsp, err := c.PoliciesAPIUpsertClusterPoliciesWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIReconcileClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) PoliciesAPIUpsertClusterPoliciesWithResponse(ctx context.Context, clusterId string, body PoliciesAPIUpsertClusterPoliciesJSONRequestBody) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { + rsp, err := c.PoliciesAPIUpsertClusterPolicies(ctx, clusterId, body) + if err != nil { + return nil, err } - return 0 + return ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ExternalClusterAPIReconcileClusterResponse) GetBody() []byte { - return r.Body +// ScheduledRebalancingAPIListRebalancingJobsWithResponse request returning *ScheduledRebalancingAPIListRebalancingJobsResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIListRebalancingJobsWithResponse(ctx context.Context, clusterId string) (*ScheduledRebalancingAPIListRebalancingJobsResponse, error) { + rsp, err := c.ScheduledRebalancingAPIListRebalancingJobs(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseScheduledRebalancingAPIListRebalancingJobsResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ExternalClusterAPICreateClusterTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ExternalclusterV1CreateClusterTokenResponse +// ScheduledRebalancingAPICreateRebalancingJobWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPICreateRebalancingJobResponse +func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingJobWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPICreateRebalancingJobWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExternalClusterAPICreateClusterTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingJobWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPICreateRebalancingJobJSONRequestBody) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPICreateRebalancingJob(ctx, clusterId, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPICreateClusterTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ScheduledRebalancingAPIDeleteRebalancingJobWithResponse request returning *ScheduledRebalancingAPIDeleteRebalancingJobResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIDeleteRebalancingJobWithResponse(ctx context.Context, clusterId string, id string) (*ScheduledRebalancingAPIDeleteRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPIDeleteRebalancingJob(ctx, clusterId, id) + if err != nil { + return nil, err } - return 0 + return ParseScheduledRebalancingAPIDeleteRebalancingJobResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ExternalClusterAPICreateClusterTokenResponse) GetBody() []byte { - return r.Body +// ScheduledRebalancingAPIGetRebalancingJobWithResponse request returning *ScheduledRebalancingAPIGetRebalancingJobResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIGetRebalancingJobWithResponse(ctx context.Context, clusterId string, id string) (*ScheduledRebalancingAPIGetRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPIGetRebalancingJob(ctx, clusterId, id) + if err != nil { + return nil, err + } + return ParseScheduledRebalancingAPIGetRebalancingJobResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ScheduledRebalancingAPIListRebalancingSchedulesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1ListRebalancingSchedulesResponse +// ScheduledRebalancingAPIUpdateRebalancingJobWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIUpdateRebalancingJobResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingJobWithBodyWithResponse(ctx context.Context, clusterId string, id string, contentType string, body io.Reader) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingJobWithBody(ctx, clusterId, id, contentType, body) + if err != nil { + return nil, err + } + return ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingJobWithResponse(ctx context.Context, clusterId string, id string, body ScheduledRebalancingAPIUpdateRebalancingJobJSONRequestBody) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { + rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingJob(ctx, clusterId, id, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ScheduledRebalancingAPIPreviewRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIPreviewRebalancingScheduleResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIPreviewRebalancingScheduleWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIPreviewRebalancingScheduleWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err } - return 0 + return ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPIListRebalancingSchedulesResponse) GetBody() []byte { - return r.Body +func (c *ClientWithResponses) ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPIPreviewRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIPreviewRebalancingSchedule(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ScheduledRebalancingAPICreateRebalancingScheduleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingSchedule +// ExternalClusterAPIListClustersWithResponse request returning *ExternalClusterAPIListClustersResponse +func (c *ClientWithResponses) ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *ExternalClusterAPIListClustersParams) (*ExternalClusterAPIListClustersResponse, error) { + rsp, err := c.ExternalClusterAPIListClusters(ctx, params) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIListClustersResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPIRegisterClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIRegisterClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIRegisterClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ExternalClusterAPIRegisterClusterResponse, error) { + rsp, err := c.ExternalClusterAPIRegisterClusterWithBody(ctx, contentType, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPIRegisterClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) ExternalClusterAPIRegisterClusterWithResponse(ctx context.Context, body ExternalClusterAPIRegisterClusterJSONRequestBody) (*ExternalClusterAPIRegisterClusterResponse, error) { + rsp, err := c.ExternalClusterAPIRegisterCluster(ctx, body) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIRegisterClusterResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPICreateRebalancingScheduleResponse) GetBody() []byte { - return r.Body +// GetExternalClusterOperationWithResponse request returning *GetExternalClusterOperationResponse +func (c *ClientWithResponses) GetExternalClusterOperationWithResponse(ctx context.Context, id string) (*GetExternalClusterOperationResponse, error) { + rsp, err := c.GetExternalClusterOperation(ctx, id) + if err != nil { + return nil, err + } + return ParseGetExternalClusterOperationResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ScheduledRebalancingAPIUpdateRebalancingScheduleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingSchedule +// ExternalClusterAPIDeleteClusterWithResponse request returning *ExternalClusterAPIDeleteClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIDeleteClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteClusterResponse, error) { + rsp, err := c.ExternalClusterAPIDeleteCluster(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIDeleteClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPIGetClusterWithResponse request returning *ExternalClusterAPIGetClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIGetClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetClusterResponse, error) { + rsp, err := c.ExternalClusterAPIGetCluster(ctx, clusterId) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPIGetClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ExternalClusterAPIUpdateClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIUpdateClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIUpdateClusterResponse, error) { + rsp, err := c.ExternalClusterAPIUpdateClusterWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIUpdateClusterResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPIUpdateRebalancingScheduleResponse) GetBody() []byte { - return r.Body +func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterJSONRequestBody) (*ExternalClusterAPIUpdateClusterResponse, error) { + rsp, err := c.ExternalClusterAPIUpdateCluster(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIUpdateClusterResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse request returning *ExternalClusterAPIDeleteAssumeRolePrincipalResponse +func (c *ClientWithResponses) ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteAssumeRolePrincipalResponse, error) { + rsp, err := c.ExternalClusterAPIDeleteAssumeRolePrincipal(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse(rsp) +} -type ScheduledRebalancingAPIDeleteRebalancingScheduleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1DeleteRebalancingScheduleResponse +// ExternalClusterAPIGetAssumeRolePrincipalWithResponse request returning *ExternalClusterAPIGetAssumeRolePrincipalResponse +func (c *ClientWithResponses) ExternalClusterAPIGetAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRolePrincipalResponse, error) { + rsp, err := c.ExternalClusterAPIGetAssumeRolePrincipal(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIGetAssumeRolePrincipalResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPICreateAssumeRolePrincipalWithResponse request returning *ExternalClusterAPICreateAssumeRolePrincipalResponse +func (c *ClientWithResponses) ExternalClusterAPICreateAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateAssumeRolePrincipalResponse, error) { + rsp, err := c.ExternalClusterAPICreateAssumeRolePrincipal(ctx, clusterId) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPICreateAssumeRolePrincipalResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ExternalClusterAPIGetAssumeRoleUserWithResponse request returning *ExternalClusterAPIGetAssumeRoleUserResponse +func (c *ClientWithResponses) ExternalClusterAPIGetAssumeRoleUserWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRoleUserResponse, error) { + rsp, err := c.ExternalClusterAPIGetAssumeRoleUser(ctx, clusterId) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIGetAssumeRoleUserResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPIDeleteRebalancingScheduleResponse) GetBody() []byte { - return r.Body +// ExternalClusterAPIGetCleanupScriptWithResponse request returning *ExternalClusterAPIGetCleanupScriptResponse +func (c *ClientWithResponses) ExternalClusterAPIGetCleanupScriptWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetCleanupScriptResponse, error) { + rsp, err := c.ExternalClusterAPIGetCleanupScript(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIGetCleanupScriptResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ScheduledRebalancingAPIGetRebalancingScheduleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1RebalancingSchedule +// ExternalClusterAPIGetCredentialsScriptWithResponse request returning *ExternalClusterAPIGetCredentialsScriptResponse +func (c *ClientWithResponses) ExternalClusterAPIGetCredentialsScriptWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIGetCredentialsScriptParams) (*ExternalClusterAPIGetCredentialsScriptResponse, error) { + rsp, err := c.ExternalClusterAPIGetCredentialsScript(ctx, clusterId, params) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIGetCredentialsScriptResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPIDisconnectClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIDisconnectClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIDisconnectClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIDisconnectClusterResponse, error) { + rsp, err := c.ExternalClusterAPIDisconnectClusterWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPIDisconnectClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) ExternalClusterAPIDisconnectClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIDisconnectClusterJSONRequestBody) (*ExternalClusterAPIDisconnectClusterResponse, error) { + rsp, err := c.ExternalClusterAPIDisconnectCluster(ctx, clusterId, body) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIDisconnectClusterResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPIGetRebalancingScheduleResponse) GetBody() []byte { - return r.Body +// ExternalClusterAPIHandleCloudEventWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIHandleCloudEventResponse +func (c *ClientWithResponses) ExternalClusterAPIHandleCloudEventWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIHandleCloudEventResponse, error) { + rsp, err := c.ExternalClusterAPIHandleCloudEventWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIHandleCloudEventResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ExternalClusterAPIGetCleanupScriptTemplateResponse struct { - Body []byte - HTTPResponse *http.Response +func (c *ClientWithResponses) ExternalClusterAPIHandleCloudEventWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIHandleCloudEventJSONRequestBody) (*ExternalClusterAPIHandleCloudEventResponse, error) { + rsp, err := c.ExternalClusterAPIHandleCloudEvent(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIHandleCloudEventResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPIListNodesWithResponse request returning *ExternalClusterAPIListNodesResponse +func (c *ClientWithResponses) ExternalClusterAPIListNodesWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIListNodesParams) (*ExternalClusterAPIListNodesResponse, error) { + rsp, err := c.ExternalClusterAPIListNodes(ctx, clusterId, params) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPIListNodesResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ExternalClusterAPIAddNodeWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIAddNodeResponse +func (c *ClientWithResponses) ExternalClusterAPIAddNodeWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIAddNodeResponse, error) { + rsp, err := c.ExternalClusterAPIAddNodeWithBody(ctx, clusterId, contentType, body) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIAddNodeResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ExternalClusterAPIGetCleanupScriptTemplateResponse) GetBody() []byte { - return r.Body +func (c *ClientWithResponses) ExternalClusterAPIAddNodeWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIAddNodeJSONRequestBody) (*ExternalClusterAPIAddNodeResponse, error) { + rsp, err := c.ExternalClusterAPIAddNode(ctx, clusterId, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIAddNodeResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ExternalClusterAPIGetCredentialsScriptTemplateResponse struct { - Body []byte - HTTPResponse *http.Response +// ExternalClusterAPIDeleteNodeWithResponse request returning *ExternalClusterAPIDeleteNodeResponse +func (c *ClientWithResponses) ExternalClusterAPIDeleteNodeWithResponse(ctx context.Context, clusterId string, nodeId string, params *ExternalClusterAPIDeleteNodeParams) (*ExternalClusterAPIDeleteNodeResponse, error) { + rsp, err := c.ExternalClusterAPIDeleteNode(ctx, clusterId, nodeId, params) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIDeleteNodeResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPIGetNodeWithResponse request returning *ExternalClusterAPIGetNodeResponse +func (c *ClientWithResponses) ExternalClusterAPIGetNodeWithResponse(ctx context.Context, clusterId string, nodeId string) (*ExternalClusterAPIGetNodeResponse, error) { + rsp, err := c.ExternalClusterAPIGetNode(ctx, clusterId, nodeId) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPIGetNodeResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ExternalClusterAPIDrainNodeWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIDrainNodeResponse +func (c *ClientWithResponses) ExternalClusterAPIDrainNodeWithBodyWithResponse(ctx context.Context, clusterId string, nodeId string, contentType string, body io.Reader) (*ExternalClusterAPIDrainNodeResponse, error) { + rsp, err := c.ExternalClusterAPIDrainNodeWithBody(ctx, clusterId, nodeId, contentType, body) + if err != nil { + return nil, err } - return 0 + return ParseExternalClusterAPIDrainNodeResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ExternalClusterAPIGetCredentialsScriptTemplateResponse) GetBody() []byte { - return r.Body +func (c *ClientWithResponses) ExternalClusterAPIDrainNodeWithResponse(ctx context.Context, clusterId string, nodeId string, body ExternalClusterAPIDrainNodeJSONRequestBody) (*ExternalClusterAPIDrainNodeResponse, error) { + rsp, err := c.ExternalClusterAPIDrainNode(ctx, clusterId, nodeId, body) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIDrainNodeResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -type ScheduledRebalancingAPIListAvailableRebalancingTZResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ScheduledrebalancingV1ListAvailableRebalancingTZResponse +// ExternalClusterAPIReconcileClusterWithResponse request returning *ExternalClusterAPIReconcileClusterResponse +func (c *ClientWithResponses) ExternalClusterAPIReconcileClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIReconcileClusterResponse, error) { + rsp, err := c.ExternalClusterAPIReconcileCluster(ctx, clusterId) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIReconcileClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ExternalClusterAPICreateClusterTokenWithResponse request returning *ExternalClusterAPICreateClusterTokenResponse +func (c *ClientWithResponses) ExternalClusterAPICreateClusterTokenWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateClusterTokenResponse, error) { + rsp, err := c.ExternalClusterAPICreateClusterToken(ctx, clusterId) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseExternalClusterAPICreateClusterTokenResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CurrentUserProfileWithResponse request returning *CurrentUserProfileResponse +func (c *ClientWithResponses) CurrentUserProfileWithResponse(ctx context.Context) (*CurrentUserProfileResponse, error) { + rsp, err := c.CurrentUserProfile(ctx) + if err != nil { + return nil, err } - return 0 + return ParseCurrentUserProfileResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r ScheduledRebalancingAPIListAvailableRebalancingTZResponse) GetBody() []byte { - return r.Body +// UpdateCurrentUserProfileWithBodyWithResponse request with arbitrary body returning *UpdateCurrentUserProfileResponse +func (c *ClientWithResponses) UpdateCurrentUserProfileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*UpdateCurrentUserProfileResponse, error) { + rsp, err := c.UpdateCurrentUserProfileWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseUpdateCurrentUserProfileResponse(rsp) } -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - -// AuthTokenAPIListAuthTokensWithResponse request returning *AuthTokenAPIListAuthTokensResponse -func (c *ClientWithResponses) AuthTokenAPIListAuthTokensWithResponse(ctx context.Context, params *AuthTokenAPIListAuthTokensParams) (*AuthTokenAPIListAuthTokensResponse, error) { - rsp, err := c.AuthTokenAPIListAuthTokens(ctx, params) +func (c *ClientWithResponses) UpdateCurrentUserProfileWithResponse(ctx context.Context, body UpdateCurrentUserProfileJSONRequestBody) (*UpdateCurrentUserProfileResponse, error) { + rsp, err := c.UpdateCurrentUserProfile(ctx, body) if err != nil { return nil, err } - return ParseAuthTokenAPIListAuthTokensResponse(rsp) + return ParseUpdateCurrentUserProfileResponse(rsp) } -// AuthTokenAPICreateAuthTokenWithBodyWithResponse request with arbitrary body returning *AuthTokenAPICreateAuthTokenResponse -func (c *ClientWithResponses) AuthTokenAPICreateAuthTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*AuthTokenAPICreateAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPICreateAuthTokenWithBody(ctx, contentType, body) +// ListOrganizationsWithResponse request returning *ListOrganizationsResponse +func (c *ClientWithResponses) ListOrganizationsWithResponse(ctx context.Context) (*ListOrganizationsResponse, error) { + rsp, err := c.ListOrganizations(ctx) if err != nil { return nil, err } - return ParseAuthTokenAPICreateAuthTokenResponse(rsp) + return ParseListOrganizationsResponse(rsp) } -func (c *ClientWithResponses) AuthTokenAPICreateAuthTokenWithResponse(ctx context.Context, body AuthTokenAPICreateAuthTokenJSONRequestBody) (*AuthTokenAPICreateAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPICreateAuthToken(ctx, body) +// CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse +func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body) if err != nil { return nil, err } - return ParseAuthTokenAPICreateAuthTokenResponse(rsp) + return ParseCreateOrganizationResponse(rsp) } -// AuthTokenAPIDeleteAuthTokenWithResponse request returning *AuthTokenAPIDeleteAuthTokenResponse -func (c *ClientWithResponses) AuthTokenAPIDeleteAuthTokenWithResponse(ctx context.Context, id string) (*AuthTokenAPIDeleteAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPIDeleteAuthToken(ctx, id) +func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganization(ctx, body) if err != nil { return nil, err } - return ParseAuthTokenAPIDeleteAuthTokenResponse(rsp) + return ParseCreateOrganizationResponse(rsp) } -// AuthTokenAPIGetAuthTokenWithResponse request returning *AuthTokenAPIGetAuthTokenResponse -func (c *ClientWithResponses) AuthTokenAPIGetAuthTokenWithResponse(ctx context.Context, id string) (*AuthTokenAPIGetAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPIGetAuthToken(ctx, id) +// DeleteOrganizationWithResponse request returning *DeleteOrganizationResponse +func (c *ClientWithResponses) DeleteOrganizationWithResponse(ctx context.Context, id string) (*DeleteOrganizationResponse, error) { + rsp, err := c.DeleteOrganization(ctx, id) if err != nil { return nil, err } - return ParseAuthTokenAPIGetAuthTokenResponse(rsp) + return ParseDeleteOrganizationResponse(rsp) } -// AuthTokenAPIUpdateAuthTokenWithBodyWithResponse request with arbitrary body returning *AuthTokenAPIUpdateAuthTokenResponse -func (c *ClientWithResponses) AuthTokenAPIUpdateAuthTokenWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*AuthTokenAPIUpdateAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPIUpdateAuthTokenWithBody(ctx, id, contentType, body) +// GetOrganizationWithResponse request returning *GetOrganizationResponse +func (c *ClientWithResponses) GetOrganizationWithResponse(ctx context.Context, id string) (*GetOrganizationResponse, error) { + rsp, err := c.GetOrganization(ctx, id) if err != nil { return nil, err } - return ParseAuthTokenAPIUpdateAuthTokenResponse(rsp) + return ParseGetOrganizationResponse(rsp) } -func (c *ClientWithResponses) AuthTokenAPIUpdateAuthTokenWithResponse(ctx context.Context, id string, body AuthTokenAPIUpdateAuthTokenJSONRequestBody) (*AuthTokenAPIUpdateAuthTokenResponse, error) { - rsp, err := c.AuthTokenAPIUpdateAuthToken(ctx, id, body) +// UpdateOrganizationWithBodyWithResponse request with arbitrary body returning *UpdateOrganizationResponse +func (c *ClientWithResponses) UpdateOrganizationWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*UpdateOrganizationResponse, error) { + rsp, err := c.UpdateOrganizationWithBody(ctx, id, contentType, body) if err != nil { return nil, err } - return ParseAuthTokenAPIUpdateAuthTokenResponse(rsp) + return ParseUpdateOrganizationResponse(rsp) } -// NodeTemplatesAPIFilterInstanceTypesWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPIFilterInstanceTypesResponse -func (c *ClientWithResponses) NodeTemplatesAPIFilterInstanceTypesWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { - rsp, err := c.NodeTemplatesAPIFilterInstanceTypesWithBody(ctx, clusterId, contentType, body) +func (c *ClientWithResponses) UpdateOrganizationWithResponse(ctx context.Context, id string, body UpdateOrganizationJSONRequestBody) (*UpdateOrganizationResponse, error) { + rsp, err := c.UpdateOrganization(ctx, id, body) if err != nil { return nil, err } - return ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp) + return ParseUpdateOrganizationResponse(rsp) } -func (c *ClientWithResponses) NodeTemplatesAPIFilterInstanceTypesWithResponse(ctx context.Context, clusterId string, body NodeTemplatesAPIFilterInstanceTypesJSONRequestBody) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { - rsp, err := c.NodeTemplatesAPIFilterInstanceTypes(ctx, clusterId, body) +// GetOrganizationUsersWithResponse request returning *GetOrganizationUsersResponse +func (c *ClientWithResponses) GetOrganizationUsersWithResponse(ctx context.Context, id string) (*GetOrganizationUsersResponse, error) { + rsp, err := c.GetOrganizationUsers(ctx, id) if err != nil { return nil, err } - return ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp) + return ParseGetOrganizationUsersResponse(rsp) } -// NodeConfigurationAPIListConfigurationsWithResponse request returning *NodeConfigurationAPIListConfigurationsResponse -func (c *ClientWithResponses) NodeConfigurationAPIListConfigurationsWithResponse(ctx context.Context, clusterId string) (*NodeConfigurationAPIListConfigurationsResponse, error) { - rsp, err := c.NodeConfigurationAPIListConfigurations(ctx, clusterId) +// CreateOrganizationUserWithBodyWithResponse request with arbitrary body returning *CreateOrganizationUserResponse +func (c *ClientWithResponses) CreateOrganizationUserWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader) (*CreateOrganizationUserResponse, error) { + rsp, err := c.CreateOrganizationUserWithBody(ctx, id, contentType, body) if err != nil { return nil, err } - return ParseNodeConfigurationAPIListConfigurationsResponse(rsp) + return ParseCreateOrganizationUserResponse(rsp) } -// NodeConfigurationAPICreateConfigurationWithBodyWithResponse request with arbitrary body returning *NodeConfigurationAPICreateConfigurationResponse -func (c *ClientWithResponses) NodeConfigurationAPICreateConfigurationWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeConfigurationAPICreateConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPICreateConfigurationWithBody(ctx, clusterId, contentType, body) +func (c *ClientWithResponses) CreateOrganizationUserWithResponse(ctx context.Context, id string, body CreateOrganizationUserJSONRequestBody) (*CreateOrganizationUserResponse, error) { + rsp, err := c.CreateOrganizationUser(ctx, id, body) if err != nil { return nil, err } - return ParseNodeConfigurationAPICreateConfigurationResponse(rsp) + return ParseCreateOrganizationUserResponse(rsp) } -func (c *ClientWithResponses) NodeConfigurationAPICreateConfigurationWithResponse(ctx context.Context, clusterId string, body NodeConfigurationAPICreateConfigurationJSONRequestBody) (*NodeConfigurationAPICreateConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPICreateConfiguration(ctx, clusterId, body) +// DeleteOrganizationUserWithResponse request returning *DeleteOrganizationUserResponse +func (c *ClientWithResponses) DeleteOrganizationUserWithResponse(ctx context.Context, id string, userId string) (*DeleteOrganizationUserResponse, error) { + rsp, err := c.DeleteOrganizationUser(ctx, id, userId) if err != nil { return nil, err } - return ParseNodeConfigurationAPICreateConfigurationResponse(rsp) + return ParseDeleteOrganizationUserResponse(rsp) } -// NodeConfigurationAPIGetSuggestedConfigurationWithResponse request returning *NodeConfigurationAPIGetSuggestedConfigurationResponse -func (c *ClientWithResponses) NodeConfigurationAPIGetSuggestedConfigurationWithResponse(ctx context.Context, clusterId string) (*NodeConfigurationAPIGetSuggestedConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPIGetSuggestedConfiguration(ctx, clusterId) +// UpdateOrganizationUserWithBodyWithResponse request with arbitrary body returning *UpdateOrganizationUserResponse +func (c *ClientWithResponses) UpdateOrganizationUserWithBodyWithResponse(ctx context.Context, id string, userId string, contentType string, body io.Reader) (*UpdateOrganizationUserResponse, error) { + rsp, err := c.UpdateOrganizationUserWithBody(ctx, id, userId, contentType, body) + if err != nil { + return nil, err + } + return ParseUpdateOrganizationUserResponse(rsp) +} + +func (c *ClientWithResponses) UpdateOrganizationUserWithResponse(ctx context.Context, id string, userId string, body UpdateOrganizationUserJSONRequestBody) (*UpdateOrganizationUserResponse, error) { + rsp, err := c.UpdateOrganizationUser(ctx, id, userId, body) if err != nil { return nil, err } - return ParseNodeConfigurationAPIGetSuggestedConfigurationResponse(rsp) + return ParseUpdateOrganizationUserResponse(rsp) } -// NodeConfigurationAPIDeleteConfigurationWithResponse request returning *NodeConfigurationAPIDeleteConfigurationResponse -func (c *ClientWithResponses) NodeConfigurationAPIDeleteConfigurationWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPIDeleteConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPIDeleteConfiguration(ctx, clusterId, id) +// InventoryAPISyncClusterResourcesWithResponse request returning *InventoryAPISyncClusterResourcesResponse +func (c *ClientWithResponses) InventoryAPISyncClusterResourcesWithResponse(ctx context.Context, organizationId string, clusterId string) (*InventoryAPISyncClusterResourcesResponse, error) { + rsp, err := c.InventoryAPISyncClusterResources(ctx, organizationId, clusterId) if err != nil { return nil, err } - return ParseNodeConfigurationAPIDeleteConfigurationResponse(rsp) + return ParseInventoryAPISyncClusterResourcesResponse(rsp) } -// NodeConfigurationAPIGetConfigurationWithResponse request returning *NodeConfigurationAPIGetConfigurationResponse -func (c *ClientWithResponses) NodeConfigurationAPIGetConfigurationWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPIGetConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPIGetConfiguration(ctx, clusterId, id) +// InventoryAPIGetReservationsWithResponse request returning *InventoryAPIGetReservationsResponse +func (c *ClientWithResponses) InventoryAPIGetReservationsWithResponse(ctx context.Context, organizationId string) (*InventoryAPIGetReservationsResponse, error) { + rsp, err := c.InventoryAPIGetReservations(ctx, organizationId) if err != nil { return nil, err } - return ParseNodeConfigurationAPIGetConfigurationResponse(rsp) + return ParseInventoryAPIGetReservationsResponse(rsp) } -// NodeConfigurationAPIUpdateConfigurationWithBodyWithResponse request with arbitrary body returning *NodeConfigurationAPIUpdateConfigurationResponse -func (c *ClientWithResponses) NodeConfigurationAPIUpdateConfigurationWithBodyWithResponse(ctx context.Context, clusterId string, id string, contentType string, body io.Reader) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPIUpdateConfigurationWithBody(ctx, clusterId, id, contentType, body) +// InventoryAPIAddReservationWithBodyWithResponse request with arbitrary body returning *InventoryAPIAddReservationResponse +func (c *ClientWithResponses) InventoryAPIAddReservationWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader) (*InventoryAPIAddReservationResponse, error) { + rsp, err := c.InventoryAPIAddReservationWithBody(ctx, organizationId, contentType, body) if err != nil { return nil, err } - return ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp) + return ParseInventoryAPIAddReservationResponse(rsp) } -func (c *ClientWithResponses) NodeConfigurationAPIUpdateConfigurationWithResponse(ctx context.Context, clusterId string, id string, body NodeConfigurationAPIUpdateConfigurationJSONRequestBody) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { - rsp, err := c.NodeConfigurationAPIUpdateConfiguration(ctx, clusterId, id, body) +func (c *ClientWithResponses) InventoryAPIAddReservationWithResponse(ctx context.Context, organizationId string, body InventoryAPIAddReservationJSONRequestBody) (*InventoryAPIAddReservationResponse, error) { + rsp, err := c.InventoryAPIAddReservation(ctx, organizationId, body) if err != nil { return nil, err } - return ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp) + return ParseInventoryAPIAddReservationResponse(rsp) } -// NodeConfigurationAPISetDefaultWithResponse request returning *NodeConfigurationAPISetDefaultResponse -func (c *ClientWithResponses) NodeConfigurationAPISetDefaultWithResponse(ctx context.Context, clusterId string, id string) (*NodeConfigurationAPISetDefaultResponse, error) { - rsp, err := c.NodeConfigurationAPISetDefault(ctx, clusterId, id) +// InventoryAPIGetReservationsBalanceWithResponse request returning *InventoryAPIGetReservationsBalanceResponse +func (c *ClientWithResponses) InventoryAPIGetReservationsBalanceWithResponse(ctx context.Context, organizationId string) (*InventoryAPIGetReservationsBalanceResponse, error) { + rsp, err := c.InventoryAPIGetReservationsBalance(ctx, organizationId) if err != nil { return nil, err } - return ParseNodeConfigurationAPISetDefaultResponse(rsp) + return ParseInventoryAPIGetReservationsBalanceResponse(rsp) } -// PoliciesAPIGetClusterNodeConstraintsWithResponse request returning *PoliciesAPIGetClusterNodeConstraintsResponse -func (c *ClientWithResponses) PoliciesAPIGetClusterNodeConstraintsWithResponse(ctx context.Context, clusterId string) (*PoliciesAPIGetClusterNodeConstraintsResponse, error) { - rsp, err := c.PoliciesAPIGetClusterNodeConstraints(ctx, clusterId) +// InventoryAPIOverwriteReservationsWithBodyWithResponse request with arbitrary body returning *InventoryAPIOverwriteReservationsResponse +func (c *ClientWithResponses) InventoryAPIOverwriteReservationsWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader) (*InventoryAPIOverwriteReservationsResponse, error) { + rsp, err := c.InventoryAPIOverwriteReservationsWithBody(ctx, organizationId, contentType, body) if err != nil { return nil, err } - return ParsePoliciesAPIGetClusterNodeConstraintsResponse(rsp) + return ParseInventoryAPIOverwriteReservationsResponse(rsp) } -// NodeTemplatesAPIListNodeTemplatesWithResponse request returning *NodeTemplatesAPIListNodeTemplatesResponse -func (c *ClientWithResponses) NodeTemplatesAPIListNodeTemplatesWithResponse(ctx context.Context, clusterId string, params *NodeTemplatesAPIListNodeTemplatesParams) (*NodeTemplatesAPIListNodeTemplatesResponse, error) { - rsp, err := c.NodeTemplatesAPIListNodeTemplates(ctx, clusterId, params) +func (c *ClientWithResponses) InventoryAPIOverwriteReservationsWithResponse(ctx context.Context, organizationId string, body InventoryAPIOverwriteReservationsJSONRequestBody) (*InventoryAPIOverwriteReservationsResponse, error) { + rsp, err := c.InventoryAPIOverwriteReservations(ctx, organizationId, body) if err != nil { return nil, err } - return ParseNodeTemplatesAPIListNodeTemplatesResponse(rsp) + return ParseInventoryAPIOverwriteReservationsResponse(rsp) } -// NodeTemplatesAPICreateNodeTemplateWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPICreateNodeTemplateResponse -func (c *ClientWithResponses) NodeTemplatesAPICreateNodeTemplateWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { - rsp, err := c.NodeTemplatesAPICreateNodeTemplateWithBody(ctx, clusterId, contentType, body) +// InventoryAPIDeleteReservationWithResponse request returning *InventoryAPIDeleteReservationResponse +func (c *ClientWithResponses) InventoryAPIDeleteReservationWithResponse(ctx context.Context, organizationId string, reservationId string) (*InventoryAPIDeleteReservationResponse, error) { + rsp, err := c.InventoryAPIDeleteReservation(ctx, organizationId, reservationId) if err != nil { return nil, err } - return ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp) + return ParseInventoryAPIDeleteReservationResponse(rsp) } -func (c *ClientWithResponses) NodeTemplatesAPICreateNodeTemplateWithResponse(ctx context.Context, clusterId string, body NodeTemplatesAPICreateNodeTemplateJSONRequestBody) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { - rsp, err := c.NodeTemplatesAPICreateNodeTemplate(ctx, clusterId, body) +// InventoryAPIGetResourceUsageWithResponse request returning *InventoryAPIGetResourceUsageResponse +func (c *ClientWithResponses) InventoryAPIGetResourceUsageWithResponse(ctx context.Context, organizationId string) (*InventoryAPIGetResourceUsageResponse, error) { + rsp, err := c.InventoryAPIGetResourceUsage(ctx, organizationId) if err != nil { return nil, err } - return ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp) + return ParseInventoryAPIGetResourceUsageResponse(rsp) } -// NodeTemplatesAPIDeleteNodeTemplateWithResponse request returning *NodeTemplatesAPIDeleteNodeTemplateResponse -func (c *ClientWithResponses) NodeTemplatesAPIDeleteNodeTemplateWithResponse(ctx context.Context, clusterId string, nodeTemplateName string) (*NodeTemplatesAPIDeleteNodeTemplateResponse, error) { - rsp, err := c.NodeTemplatesAPIDeleteNodeTemplate(ctx, clusterId, nodeTemplateName) +// ScheduledRebalancingAPIListRebalancingSchedulesWithResponse request returning *ScheduledRebalancingAPIListRebalancingSchedulesResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIListRebalancingSchedulesWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListRebalancingSchedulesResponse, error) { + rsp, err := c.ScheduledRebalancingAPIListRebalancingSchedules(ctx) if err != nil { return nil, err } - return ParseNodeTemplatesAPIDeleteNodeTemplateResponse(rsp) + return ParseScheduledRebalancingAPIListRebalancingSchedulesResponse(rsp) } -// NodeTemplatesAPIUpdateNodeTemplateWithBodyWithResponse request with arbitrary body returning *NodeTemplatesAPIUpdateNodeTemplateResponse -func (c *ClientWithResponses) NodeTemplatesAPIUpdateNodeTemplateWithBodyWithResponse(ctx context.Context, clusterId string, nodeTemplateName string, contentType string, body io.Reader) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { - rsp, err := c.NodeTemplatesAPIUpdateNodeTemplateWithBody(ctx, clusterId, nodeTemplateName, contentType, body) +// ScheduledRebalancingAPICreateRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPICreateRebalancingScheduleResponse +func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingScheduleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPICreateRebalancingScheduleWithBody(ctx, contentType, body) if err != nil { return nil, err } - return ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp) + return ParseScheduledRebalancingAPICreateRebalancingScheduleResponse(rsp) } -func (c *ClientWithResponses) NodeTemplatesAPIUpdateNodeTemplateWithResponse(ctx context.Context, clusterId string, nodeTemplateName string, body NodeTemplatesAPIUpdateNodeTemplateJSONRequestBody) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { - rsp, err := c.NodeTemplatesAPIUpdateNodeTemplate(ctx, clusterId, nodeTemplateName, body) +func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingScheduleWithResponse(ctx context.Context, body ScheduledRebalancingAPICreateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPICreateRebalancingSchedule(ctx, body) if err != nil { return nil, err } - return ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp) + return ParseScheduledRebalancingAPICreateRebalancingScheduleResponse(rsp) } -// PoliciesAPIGetClusterPoliciesWithResponse request returning *PoliciesAPIGetClusterPoliciesResponse -func (c *ClientWithResponses) PoliciesAPIGetClusterPoliciesWithResponse(ctx context.Context, clusterId string) (*PoliciesAPIGetClusterPoliciesResponse, error) { - rsp, err := c.PoliciesAPIGetClusterPolicies(ctx, clusterId) +// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIUpdateRebalancingScheduleResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBodyWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, contentType string, body io.Reader) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx, params, contentType, body) if err != nil { return nil, err } - return ParsePoliciesAPIGetClusterPoliciesResponse(rsp) + return ParseScheduledRebalancingAPIUpdateRebalancingScheduleResponse(rsp) } -// PoliciesAPIUpsertClusterPoliciesWithBodyWithResponse request with arbitrary body returning *PoliciesAPIUpsertClusterPoliciesResponse -func (c *ClientWithResponses) PoliciesAPIUpsertClusterPoliciesWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { - rsp, err := c.PoliciesAPIUpsertClusterPoliciesWithBody(ctx, clusterId, contentType, body) +func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingScheduleWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, body ScheduledRebalancingAPIUpdateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx, params, body) if err != nil { return nil, err } - return ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp) + return ParseScheduledRebalancingAPIUpdateRebalancingScheduleResponse(rsp) } -func (c *ClientWithResponses) PoliciesAPIUpsertClusterPoliciesWithResponse(ctx context.Context, clusterId string, body PoliciesAPIUpsertClusterPoliciesJSONRequestBody) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { - rsp, err := c.PoliciesAPIUpsertClusterPolicies(ctx, clusterId, body) +// ScheduledRebalancingAPIDeleteRebalancingScheduleWithResponse request returning *ScheduledRebalancingAPIDeleteRebalancingScheduleResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIDeleteRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIDeleteRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIDeleteRebalancingSchedule(ctx, id) if err != nil { return nil, err } - return ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp) + return ParseScheduledRebalancingAPIDeleteRebalancingScheduleResponse(rsp) } -// ScheduledRebalancingAPIListRebalancingJobsWithResponse request returning *ScheduledRebalancingAPIListRebalancingJobsResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIListRebalancingJobsWithResponse(ctx context.Context, clusterId string) (*ScheduledRebalancingAPIListRebalancingJobsResponse, error) { - rsp, err := c.ScheduledRebalancingAPIListRebalancingJobs(ctx, clusterId) +// ScheduledRebalancingAPIGetRebalancingScheduleWithResponse request returning *ScheduledRebalancingAPIGetRebalancingScheduleResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIGetRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIGetRebalancingScheduleResponse, error) { + rsp, err := c.ScheduledRebalancingAPIGetRebalancingSchedule(ctx, id) if err != nil { return nil, err } - return ParseScheduledRebalancingAPIListRebalancingJobsResponse(rsp) + return ParseScheduledRebalancingAPIGetRebalancingScheduleResponse(rsp) } -// ScheduledRebalancingAPICreateRebalancingJobWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPICreateRebalancingJobResponse -func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingJobWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPICreateRebalancingJobWithBody(ctx, clusterId, contentType, body) +// ExternalClusterAPIGetCleanupScriptTemplateWithResponse request returning *ExternalClusterAPIGetCleanupScriptTemplateResponse +func (c *ClientWithResponses) ExternalClusterAPIGetCleanupScriptTemplateWithResponse(ctx context.Context, provider string) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) { + rsp, err := c.ExternalClusterAPIGetCleanupScriptTemplate(ctx, provider) if err != nil { return nil, err } - return ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp) + return ParseExternalClusterAPIGetCleanupScriptTemplateResponse(rsp) } -func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingJobWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPICreateRebalancingJobJSONRequestBody) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPICreateRebalancingJob(ctx, clusterId, body) +// ExternalClusterAPIGetCredentialsScriptTemplateWithResponse request returning *ExternalClusterAPIGetCredentialsScriptTemplateResponse +func (c *ClientWithResponses) ExternalClusterAPIGetCredentialsScriptTemplateWithResponse(ctx context.Context, provider string, params *ExternalClusterAPIGetCredentialsScriptTemplateParams) (*ExternalClusterAPIGetCredentialsScriptTemplateResponse, error) { + rsp, err := c.ExternalClusterAPIGetCredentialsScriptTemplate(ctx, provider, params) if err != nil { return nil, err } - return ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp) + return ParseExternalClusterAPIGetCredentialsScriptTemplateResponse(rsp) } -// ScheduledRebalancingAPIDeleteRebalancingJobWithResponse request returning *ScheduledRebalancingAPIDeleteRebalancingJobResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIDeleteRebalancingJobWithResponse(ctx context.Context, clusterId string, id string) (*ScheduledRebalancingAPIDeleteRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPIDeleteRebalancingJob(ctx, clusterId, id) +// ScheduledRebalancingAPIListAvailableRebalancingTZWithResponse request returning *ScheduledRebalancingAPIListAvailableRebalancingTZResponse +func (c *ClientWithResponses) ScheduledRebalancingAPIListAvailableRebalancingTZWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListAvailableRebalancingTZResponse, error) { + rsp, err := c.ScheduledRebalancingAPIListAvailableRebalancingTZ(ctx) if err != nil { return nil, err } - return ParseScheduledRebalancingAPIDeleteRebalancingJobResponse(rsp) + return ParseScheduledRebalancingAPIListAvailableRebalancingTZResponse(rsp) } -// ScheduledRebalancingAPIGetRebalancingJobWithResponse request returning *ScheduledRebalancingAPIGetRebalancingJobResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIGetRebalancingJobWithResponse(ctx context.Context, clusterId string, id string) (*ScheduledRebalancingAPIGetRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPIGetRebalancingJob(ctx, clusterId, id) +// ParseAuthTokenAPIListAuthTokensResponse parses an HTTP response from a AuthTokenAPIListAuthTokensWithResponse call +func ParseAuthTokenAPIListAuthTokensResponse(rsp *http.Response) (*AuthTokenAPIListAuthTokensResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIGetRebalancingJobResponse(rsp) + + response := &AuthTokenAPIListAuthTokensResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiAuthtokenV1beta1ListAuthTokensResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ScheduledRebalancingAPIUpdateRebalancingJobWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIUpdateRebalancingJobResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingJobWithBodyWithResponse(ctx context.Context, clusterId string, id string, contentType string, body io.Reader) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingJobWithBody(ctx, clusterId, id, contentType, body) +// ParseAuthTokenAPICreateAuthTokenResponse parses an HTTP response from a AuthTokenAPICreateAuthTokenWithResponse call +func ParseAuthTokenAPICreateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPICreateAuthTokenResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp) + + response := &AuthTokenAPICreateAuthTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiAuthtokenV1beta1AuthToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingJobWithResponse(ctx context.Context, clusterId string, id string, body ScheduledRebalancingAPIUpdateRebalancingJobJSONRequestBody) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { - rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingJob(ctx, clusterId, id, body) +// ParseAuthTokenAPIDeleteAuthTokenResponse parses an HTTP response from a AuthTokenAPIDeleteAuthTokenWithResponse call +func ParseAuthTokenAPIDeleteAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIDeleteAuthTokenResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp) + + response := &AuthTokenAPIDeleteAuthTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiAuthtokenV1beta1DeleteAuthTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ScheduledRebalancingAPIPreviewRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIPreviewRebalancingScheduleResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIPreviewRebalancingScheduleWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIPreviewRebalancingScheduleWithBody(ctx, clusterId, contentType, body) +// ParseAuthTokenAPIGetAuthTokenResponse parses an HTTP response from a AuthTokenAPIGetAuthTokenWithResponse call +func ParseAuthTokenAPIGetAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIGetAuthTokenResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp) + + response := &AuthTokenAPIGetAuthTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiAuthtokenV1beta1AuthToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPIPreviewRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIPreviewRebalancingSchedule(ctx, clusterId, body) +// ParseAuthTokenAPIUpdateAuthTokenResponse parses an HTTP response from a AuthTokenAPIUpdateAuthTokenWithResponse call +func ParseAuthTokenAPIUpdateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIUpdateAuthTokenResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp) + + response := &AuthTokenAPIUpdateAuthTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiAuthtokenV1beta1AuthToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ExternalClusterAPIListClustersWithResponse request returning *ExternalClusterAPIListClustersResponse -func (c *ClientWithResponses) ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *ExternalClusterAPIListClustersParams) (*ExternalClusterAPIListClustersResponse, error) { - rsp, err := c.ExternalClusterAPIListClusters(ctx, params) +// ParseCreateInvitationResponse parses an HTTP response from a CreateInvitationWithResponse call +func ParseCreateInvitationResponse(rsp *http.Response) (*CreateInvitationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIListClustersResponse(rsp) + + response := &CreateInvitationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NewInvitationsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ExternalClusterAPIRegisterClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIRegisterClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIRegisterClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ExternalClusterAPIRegisterClusterResponse, error) { - rsp, err := c.ExternalClusterAPIRegisterClusterWithBody(ctx, contentType, body) +// ParseClaimInvitationResponse parses an HTTP response from a ClaimInvitationWithResponse call +func ParseClaimInvitationResponse(rsp *http.Response) (*ClaimInvitationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIRegisterClusterResponse(rsp) -} -func (c *ClientWithResponses) ExternalClusterAPIRegisterClusterWithResponse(ctx context.Context, body ExternalClusterAPIRegisterClusterJSONRequestBody) (*ExternalClusterAPIRegisterClusterResponse, error) { - rsp, err := c.ExternalClusterAPIRegisterCluster(ctx, body) - if err != nil { - return nil, err + response := &ClaimInvitationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIRegisterClusterResponse(rsp) -} -// GetExternalClusterOperationWithResponse request returning *GetExternalClusterOperationResponse -func (c *ClientWithResponses) GetExternalClusterOperationWithResponse(ctx context.Context, id string) (*GetExternalClusterOperationResponse, error) { - rsp, err := c.GetExternalClusterOperation(ctx, id) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest map[string]interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseGetExternalClusterOperationResponse(rsp) + + return response, nil } -// ExternalClusterAPIDeleteClusterWithResponse request returning *ExternalClusterAPIDeleteClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIDeleteClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteClusterResponse, error) { - rsp, err := c.ExternalClusterAPIDeleteCluster(ctx, clusterId) +// ParseNodeTemplatesAPIFilterInstanceTypesResponse parses an HTTP response from a NodeTemplatesAPIFilterInstanceTypesWithResponse call +func ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp *http.Response) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIDeleteClusterResponse(rsp) -} -// ExternalClusterAPIGetClusterWithResponse request returning *ExternalClusterAPIGetClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIGetClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetClusterResponse, error) { - rsp, err := c.ExternalClusterAPIGetCluster(ctx, clusterId) - if err != nil { - return nil, err + response := &NodeTemplatesAPIFilterInstanceTypesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIGetClusterResponse(rsp) -} -// ExternalClusterAPIUpdateClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIUpdateClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIUpdateClusterResponse, error) { - rsp, err := c.ExternalClusterAPIUpdateClusterWithBody(ctx, clusterId, contentType, body) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodetemplatesV1FilterInstanceTypesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIUpdateClusterResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) ExternalClusterAPIUpdateClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIUpdateClusterJSONRequestBody) (*ExternalClusterAPIUpdateClusterResponse, error) { - rsp, err := c.ExternalClusterAPIUpdateCluster(ctx, clusterId, body) +// ParseNodeConfigurationAPIListConfigurationsResponse parses an HTTP response from a NodeConfigurationAPIListConfigurationsWithResponse call +func ParseNodeConfigurationAPIListConfigurationsResponse(rsp *http.Response) (*NodeConfigurationAPIListConfigurationsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIUpdateClusterResponse(rsp) -} -// ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse request returning *ExternalClusterAPIDeleteAssumeRolePrincipalResponse -func (c *ClientWithResponses) ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIDeleteAssumeRolePrincipalResponse, error) { - rsp, err := c.ExternalClusterAPIDeleteAssumeRolePrincipal(ctx, clusterId) - if err != nil { - return nil, err + response := &NodeConfigurationAPIListConfigurationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse(rsp) -} -// ExternalClusterAPIGetAssumeRolePrincipalWithResponse request returning *ExternalClusterAPIGetAssumeRolePrincipalResponse -func (c *ClientWithResponses) ExternalClusterAPIGetAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRolePrincipalResponse, error) { - rsp, err := c.ExternalClusterAPIGetAssumeRolePrincipal(ctx, clusterId) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1ListConfigurationsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIGetAssumeRolePrincipalResponse(rsp) + + return response, nil } -// ExternalClusterAPICreateAssumeRolePrincipalWithResponse request returning *ExternalClusterAPICreateAssumeRolePrincipalResponse -func (c *ClientWithResponses) ExternalClusterAPICreateAssumeRolePrincipalWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateAssumeRolePrincipalResponse, error) { - rsp, err := c.ExternalClusterAPICreateAssumeRolePrincipal(ctx, clusterId) +// ParseNodeConfigurationAPICreateConfigurationResponse parses an HTTP response from a NodeConfigurationAPICreateConfigurationWithResponse call +func ParseNodeConfigurationAPICreateConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPICreateConfigurationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPICreateAssumeRolePrincipalResponse(rsp) -} -// ExternalClusterAPIGetAssumeRoleUserWithResponse request returning *ExternalClusterAPIGetAssumeRoleUserResponse -func (c *ClientWithResponses) ExternalClusterAPIGetAssumeRoleUserWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetAssumeRoleUserResponse, error) { - rsp, err := c.ExternalClusterAPIGetAssumeRoleUser(ctx, clusterId) - if err != nil { - return nil, err + response := &NodeConfigurationAPICreateConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIGetAssumeRoleUserResponse(rsp) -} -// ExternalClusterAPIGetCleanupScriptWithResponse request returning *ExternalClusterAPIGetCleanupScriptResponse -func (c *ClientWithResponses) ExternalClusterAPIGetCleanupScriptWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIGetCleanupScriptResponse, error) { - rsp, err := c.ExternalClusterAPIGetCleanupScript(ctx, clusterId) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1NodeConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIGetCleanupScriptResponse(rsp) + + return response, nil } -// ExternalClusterAPIGetCredentialsScriptWithResponse request returning *ExternalClusterAPIGetCredentialsScriptResponse -func (c *ClientWithResponses) ExternalClusterAPIGetCredentialsScriptWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIGetCredentialsScriptParams) (*ExternalClusterAPIGetCredentialsScriptResponse, error) { - rsp, err := c.ExternalClusterAPIGetCredentialsScript(ctx, clusterId, params) +// ParseNodeConfigurationAPIGetSuggestedConfigurationResponse parses an HTTP response from a NodeConfigurationAPIGetSuggestedConfigurationWithResponse call +func ParseNodeConfigurationAPIGetSuggestedConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIGetSuggestedConfigurationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIGetCredentialsScriptResponse(rsp) -} -// ExternalClusterAPIDisconnectClusterWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIDisconnectClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIDisconnectClusterWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIDisconnectClusterResponse, error) { - rsp, err := c.ExternalClusterAPIDisconnectClusterWithBody(ctx, clusterId, contentType, body) - if err != nil { - return nil, err + response := &NodeConfigurationAPIGetSuggestedConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIDisconnectClusterResponse(rsp) -} -func (c *ClientWithResponses) ExternalClusterAPIDisconnectClusterWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIDisconnectClusterJSONRequestBody) (*ExternalClusterAPIDisconnectClusterResponse, error) { - rsp, err := c.ExternalClusterAPIDisconnectCluster(ctx, clusterId, body) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1GetSuggestedConfigurationResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIDisconnectClusterResponse(rsp) + + return response, nil } -// ExternalClusterAPIHandleCloudEventWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIHandleCloudEventResponse -func (c *ClientWithResponses) ExternalClusterAPIHandleCloudEventWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIHandleCloudEventResponse, error) { - rsp, err := c.ExternalClusterAPIHandleCloudEventWithBody(ctx, clusterId, contentType, body) +// ParseNodeConfigurationAPIDeleteConfigurationResponse parses an HTTP response from a NodeConfigurationAPIDeleteConfigurationWithResponse call +func ParseNodeConfigurationAPIDeleteConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIDeleteConfigurationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIHandleCloudEventResponse(rsp) -} -func (c *ClientWithResponses) ExternalClusterAPIHandleCloudEventWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIHandleCloudEventJSONRequestBody) (*ExternalClusterAPIHandleCloudEventResponse, error) { - rsp, err := c.ExternalClusterAPIHandleCloudEvent(ctx, clusterId, body) - if err != nil { - return nil, err + response := &NodeConfigurationAPIDeleteConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIHandleCloudEventResponse(rsp) -} -// ExternalClusterAPIListNodesWithResponse request returning *ExternalClusterAPIListNodesResponse -func (c *ClientWithResponses) ExternalClusterAPIListNodesWithResponse(ctx context.Context, clusterId string, params *ExternalClusterAPIListNodesParams) (*ExternalClusterAPIListNodesResponse, error) { - rsp, err := c.ExternalClusterAPIListNodes(ctx, clusterId, params) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1DeleteConfigurationResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIListNodesResponse(rsp) + + return response, nil } -// ExternalClusterAPIAddNodeWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIAddNodeResponse -func (c *ClientWithResponses) ExternalClusterAPIAddNodeWithBodyWithResponse(ctx context.Context, clusterId string, contentType string, body io.Reader) (*ExternalClusterAPIAddNodeResponse, error) { - rsp, err := c.ExternalClusterAPIAddNodeWithBody(ctx, clusterId, contentType, body) +// ParseNodeConfigurationAPIGetConfigurationResponse parses an HTTP response from a NodeConfigurationAPIGetConfigurationWithResponse call +func ParseNodeConfigurationAPIGetConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIGetConfigurationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIAddNodeResponse(rsp) -} -func (c *ClientWithResponses) ExternalClusterAPIAddNodeWithResponse(ctx context.Context, clusterId string, body ExternalClusterAPIAddNodeJSONRequestBody) (*ExternalClusterAPIAddNodeResponse, error) { - rsp, err := c.ExternalClusterAPIAddNode(ctx, clusterId, body) - if err != nil { - return nil, err + response := &NodeConfigurationAPIGetConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIAddNodeResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1NodeConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ExternalClusterAPIDeleteNodeWithResponse request returning *ExternalClusterAPIDeleteNodeResponse -func (c *ClientWithResponses) ExternalClusterAPIDeleteNodeWithResponse(ctx context.Context, clusterId string, nodeId string, params *ExternalClusterAPIDeleteNodeParams) (*ExternalClusterAPIDeleteNodeResponse, error) { - rsp, err := c.ExternalClusterAPIDeleteNode(ctx, clusterId, nodeId, params) +// ParseNodeConfigurationAPIUpdateConfigurationResponse parses an HTTP response from a NodeConfigurationAPIUpdateConfigurationWithResponse call +func ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIDeleteNodeResponse(rsp) + + response := &NodeConfigurationAPIUpdateConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1NodeConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ExternalClusterAPIGetNodeWithResponse request returning *ExternalClusterAPIGetNodeResponse -func (c *ClientWithResponses) ExternalClusterAPIGetNodeWithResponse(ctx context.Context, clusterId string, nodeId string) (*ExternalClusterAPIGetNodeResponse, error) { - rsp, err := c.ExternalClusterAPIGetNode(ctx, clusterId, nodeId) +// ParseNodeConfigurationAPISetDefaultResponse parses an HTTP response from a NodeConfigurationAPISetDefaultWithResponse call +func ParseNodeConfigurationAPISetDefaultResponse(rsp *http.Response) (*NodeConfigurationAPISetDefaultResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIGetNodeResponse(rsp) -} -// ExternalClusterAPIDrainNodeWithBodyWithResponse request with arbitrary body returning *ExternalClusterAPIDrainNodeResponse -func (c *ClientWithResponses) ExternalClusterAPIDrainNodeWithBodyWithResponse(ctx context.Context, clusterId string, nodeId string, contentType string, body io.Reader) (*ExternalClusterAPIDrainNodeResponse, error) { - rsp, err := c.ExternalClusterAPIDrainNodeWithBody(ctx, clusterId, nodeId, contentType, body) - if err != nil { - return nil, err + response := &NodeConfigurationAPISetDefaultResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIDrainNodeResponse(rsp) -} -func (c *ClientWithResponses) ExternalClusterAPIDrainNodeWithResponse(ctx context.Context, clusterId string, nodeId string, body ExternalClusterAPIDrainNodeJSONRequestBody) (*ExternalClusterAPIDrainNodeResponse, error) { - rsp, err := c.ExternalClusterAPIDrainNode(ctx, clusterId, nodeId, body) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodeconfigV1NodeConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseExternalClusterAPIDrainNodeResponse(rsp) + + return response, nil } -// ExternalClusterAPIReconcileClusterWithResponse request returning *ExternalClusterAPIReconcileClusterResponse -func (c *ClientWithResponses) ExternalClusterAPIReconcileClusterWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPIReconcileClusterResponse, error) { - rsp, err := c.ExternalClusterAPIReconcileCluster(ctx, clusterId) +// ParsePoliciesAPIGetClusterNodeConstraintsResponse parses an HTTP response from a PoliciesAPIGetClusterNodeConstraintsWithResponse call +func ParsePoliciesAPIGetClusterNodeConstraintsResponse(rsp *http.Response) (*PoliciesAPIGetClusterNodeConstraintsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIReconcileClusterResponse(rsp) -} -// ExternalClusterAPICreateClusterTokenWithResponse request returning *ExternalClusterAPICreateClusterTokenResponse -func (c *ClientWithResponses) ExternalClusterAPICreateClusterTokenWithResponse(ctx context.Context, clusterId string) (*ExternalClusterAPICreateClusterTokenResponse, error) { - rsp, err := c.ExternalClusterAPICreateClusterToken(ctx, clusterId) - if err != nil { - return nil, err + response := &PoliciesAPIGetClusterNodeConstraintsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPICreateClusterTokenResponse(rsp) -} -// ScheduledRebalancingAPIListRebalancingSchedulesWithResponse request returning *ScheduledRebalancingAPIListRebalancingSchedulesResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIListRebalancingSchedulesWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListRebalancingSchedulesResponse, error) { - rsp, err := c.ScheduledRebalancingAPIListRebalancingSchedules(ctx) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PoliciesV1GetClusterNodeConstraintsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseScheduledRebalancingAPIListRebalancingSchedulesResponse(rsp) + + return response, nil } -// ScheduledRebalancingAPICreateRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPICreateRebalancingScheduleResponse -func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingScheduleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPICreateRebalancingScheduleWithBody(ctx, contentType, body) +// ParseNodeTemplatesAPIListNodeTemplatesResponse parses an HTTP response from a NodeTemplatesAPIListNodeTemplatesWithResponse call +func ParseNodeTemplatesAPIListNodeTemplatesResponse(rsp *http.Response) (*NodeTemplatesAPIListNodeTemplatesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPICreateRebalancingScheduleResponse(rsp) -} -func (c *ClientWithResponses) ScheduledRebalancingAPICreateRebalancingScheduleWithResponse(ctx context.Context, body ScheduledRebalancingAPICreateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPICreateRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPICreateRebalancingSchedule(ctx, body) - if err != nil { - return nil, err + response := &NodeTemplatesAPIListNodeTemplatesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseScheduledRebalancingAPICreateRebalancingScheduleResponse(rsp) -} -// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBodyWithResponse request with arbitrary body returning *ScheduledRebalancingAPIUpdateRebalancingScheduleResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBodyWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, contentType string, body io.Reader) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx, params, contentType, body) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodetemplatesV1ListNodeTemplatesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseScheduledRebalancingAPIUpdateRebalancingScheduleResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) ScheduledRebalancingAPIUpdateRebalancingScheduleWithResponse(ctx context.Context, params *ScheduledRebalancingAPIUpdateRebalancingScheduleParams, body ScheduledRebalancingAPIUpdateRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIUpdateRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx, params, body) +// ParseNodeTemplatesAPICreateNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPICreateNodeTemplateWithResponse call +func ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIUpdateRebalancingScheduleResponse(rsp) -} -// ScheduledRebalancingAPIDeleteRebalancingScheduleWithResponse request returning *ScheduledRebalancingAPIDeleteRebalancingScheduleResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIDeleteRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIDeleteRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIDeleteRebalancingSchedule(ctx, id) - if err != nil { - return nil, err + response := &NodeTemplatesAPICreateNodeTemplateResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseScheduledRebalancingAPIDeleteRebalancingScheduleResponse(rsp) -} -// ScheduledRebalancingAPIGetRebalancingScheduleWithResponse request returning *ScheduledRebalancingAPIGetRebalancingScheduleResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIGetRebalancingScheduleWithResponse(ctx context.Context, id string) (*ScheduledRebalancingAPIGetRebalancingScheduleResponse, error) { - rsp, err := c.ScheduledRebalancingAPIGetRebalancingSchedule(ctx, id) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodetemplatesV1NodeTemplate + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseScheduledRebalancingAPIGetRebalancingScheduleResponse(rsp) + + return response, nil } -// ExternalClusterAPIGetCleanupScriptTemplateWithResponse request returning *ExternalClusterAPIGetCleanupScriptTemplateResponse -func (c *ClientWithResponses) ExternalClusterAPIGetCleanupScriptTemplateWithResponse(ctx context.Context, provider string) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) { - rsp, err := c.ExternalClusterAPIGetCleanupScriptTemplate(ctx, provider) +// ParseNodeTemplatesAPIDeleteNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPIDeleteNodeTemplateWithResponse call +func ParseNodeTemplatesAPIDeleteNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPIDeleteNodeTemplateResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseExternalClusterAPIGetCleanupScriptTemplateResponse(rsp) -} -// ExternalClusterAPIGetCredentialsScriptTemplateWithResponse request returning *ExternalClusterAPIGetCredentialsScriptTemplateResponse -func (c *ClientWithResponses) ExternalClusterAPIGetCredentialsScriptTemplateWithResponse(ctx context.Context, provider string, params *ExternalClusterAPIGetCredentialsScriptTemplateParams) (*ExternalClusterAPIGetCredentialsScriptTemplateResponse, error) { - rsp, err := c.ExternalClusterAPIGetCredentialsScriptTemplate(ctx, provider, params) - if err != nil { - return nil, err + response := &NodeTemplatesAPIDeleteNodeTemplateResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseExternalClusterAPIGetCredentialsScriptTemplateResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodetemplatesV1DeleteNodeTemplateResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ScheduledRebalancingAPIListAvailableRebalancingTZWithResponse request returning *ScheduledRebalancingAPIListAvailableRebalancingTZResponse -func (c *ClientWithResponses) ScheduledRebalancingAPIListAvailableRebalancingTZWithResponse(ctx context.Context) (*ScheduledRebalancingAPIListAvailableRebalancingTZResponse, error) { - rsp, err := c.ScheduledRebalancingAPIListAvailableRebalancingTZ(ctx) +// ParseNodeTemplatesAPIUpdateNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPIUpdateNodeTemplateWithResponse call +func ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() if err != nil { return nil, err } - return ParseScheduledRebalancingAPIListAvailableRebalancingTZResponse(rsp) + + response := &NodeTemplatesAPIUpdateNodeTemplateResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NodetemplatesV1NodeTemplate + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ParseAuthTokenAPIListAuthTokensResponse parses an HTTP response from a AuthTokenAPIListAuthTokensWithResponse call -func ParseAuthTokenAPIListAuthTokensResponse(rsp *http.Response) (*AuthTokenAPIListAuthTokensResponse, error) { +// ParsePoliciesAPIGetClusterPoliciesResponse parses an HTTP response from a PoliciesAPIGetClusterPoliciesWithResponse call +func ParsePoliciesAPIGetClusterPoliciesResponse(rsp *http.Response) (*PoliciesAPIGetClusterPoliciesResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &AuthTokenAPIListAuthTokensResponse{ + response := &PoliciesAPIGetClusterPoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CastaiAuthtokenV1beta1ListAuthTokensResponse + var dest PoliciesV1Policies if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6127,22 +8793,22 @@ func ParseAuthTokenAPIListAuthTokensResponse(rsp *http.Response) (*AuthTokenAPIL return response, nil } -// ParseAuthTokenAPICreateAuthTokenResponse parses an HTTP response from a AuthTokenAPICreateAuthTokenWithResponse call -func ParseAuthTokenAPICreateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPICreateAuthTokenResponse, error) { +// ParsePoliciesAPIUpsertClusterPoliciesResponse parses an HTTP response from a PoliciesAPIUpsertClusterPoliciesWithResponse call +func ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp *http.Response) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &AuthTokenAPICreateAuthTokenResponse{ + response := &PoliciesAPIUpsertClusterPoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CastaiAuthtokenV1beta1AuthToken + var dest PoliciesV1Policies if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6153,22 +8819,22 @@ func ParseAuthTokenAPICreateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPI return response, nil } -// ParseAuthTokenAPIDeleteAuthTokenResponse parses an HTTP response from a AuthTokenAPIDeleteAuthTokenWithResponse call -func ParseAuthTokenAPIDeleteAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIDeleteAuthTokenResponse, error) { +// ParseScheduledRebalancingAPIListRebalancingJobsResponse parses an HTTP response from a ScheduledRebalancingAPIListRebalancingJobsWithResponse call +func ParseScheduledRebalancingAPIListRebalancingJobsResponse(rsp *http.Response) (*ScheduledRebalancingAPIListRebalancingJobsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &AuthTokenAPIDeleteAuthTokenResponse{ + response := &ScheduledRebalancingAPIListRebalancingJobsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CastaiAuthtokenV1beta1DeleteAuthTokenResponse + var dest ScheduledrebalancingV1ListRebalancingJobsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6179,22 +8845,22 @@ func ParseAuthTokenAPIDeleteAuthTokenResponse(rsp *http.Response) (*AuthTokenAPI return response, nil } -// ParseAuthTokenAPIGetAuthTokenResponse parses an HTTP response from a AuthTokenAPIGetAuthTokenWithResponse call -func ParseAuthTokenAPIGetAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIGetAuthTokenResponse, error) { +// ParseScheduledRebalancingAPICreateRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPICreateRebalancingJobWithResponse call +func ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &AuthTokenAPIGetAuthTokenResponse{ + response := &ScheduledRebalancingAPICreateRebalancingJobResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CastaiAuthtokenV1beta1AuthToken + var dest ScheduledrebalancingV1RebalancingJob if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6205,22 +8871,22 @@ func ParseAuthTokenAPIGetAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIGet return response, nil } -// ParseAuthTokenAPIUpdateAuthTokenResponse parses an HTTP response from a AuthTokenAPIUpdateAuthTokenWithResponse call -func ParseAuthTokenAPIUpdateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPIUpdateAuthTokenResponse, error) { +// ParseScheduledRebalancingAPIDeleteRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIDeleteRebalancingJobWithResponse call +func ParseScheduledRebalancingAPIDeleteRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIDeleteRebalancingJobResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &AuthTokenAPIUpdateAuthTokenResponse{ + response := &ScheduledRebalancingAPIDeleteRebalancingJobResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CastaiAuthtokenV1beta1AuthToken + var dest ScheduledrebalancingV1DeleteRebalancingJobResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6231,22 +8897,22 @@ func ParseAuthTokenAPIUpdateAuthTokenResponse(rsp *http.Response) (*AuthTokenAPI return response, nil } -// ParseNodeTemplatesAPIFilterInstanceTypesResponse parses an HTTP response from a NodeTemplatesAPIFilterInstanceTypesWithResponse call -func ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp *http.Response) (*NodeTemplatesAPIFilterInstanceTypesResponse, error) { +// ParseScheduledRebalancingAPIGetRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIGetRebalancingJobWithResponse call +func ParseScheduledRebalancingAPIGetRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIGetRebalancingJobResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeTemplatesAPIFilterInstanceTypesResponse{ + response := &ScheduledRebalancingAPIGetRebalancingJobResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodetemplatesV1FilterInstanceTypesResponse + var dest ScheduledrebalancingV1RebalancingJob if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6257,22 +8923,22 @@ func ParseNodeTemplatesAPIFilterInstanceTypesResponse(rsp *http.Response) (*Node return response, nil } -// ParseNodeConfigurationAPIListConfigurationsResponse parses an HTTP response from a NodeConfigurationAPIListConfigurationsWithResponse call -func ParseNodeConfigurationAPIListConfigurationsResponse(rsp *http.Response) (*NodeConfigurationAPIListConfigurationsResponse, error) { +// ParseScheduledRebalancingAPIUpdateRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIUpdateRebalancingJobWithResponse call +func ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPIListConfigurationsResponse{ + response := &ScheduledRebalancingAPIUpdateRebalancingJobResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1ListConfigurationsResponse + var dest ScheduledrebalancingV1RebalancingJob if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6283,22 +8949,22 @@ func ParseNodeConfigurationAPIListConfigurationsResponse(rsp *http.Response) (*N return response, nil } -// ParseNodeConfigurationAPICreateConfigurationResponse parses an HTTP response from a NodeConfigurationAPICreateConfigurationWithResponse call -func ParseNodeConfigurationAPICreateConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPICreateConfigurationResponse, error) { +// ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse parses an HTTP response from a ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse call +func ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp *http.Response) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPICreateConfigurationResponse{ + response := &ScheduledRebalancingAPIPreviewRebalancingScheduleResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1NodeConfiguration + var dest ScheduledrebalancingV1PreviewRebalancingScheduleResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6309,22 +8975,22 @@ func ParseNodeConfigurationAPICreateConfigurationResponse(rsp *http.Response) (* return response, nil } -// ParseNodeConfigurationAPIGetSuggestedConfigurationResponse parses an HTTP response from a NodeConfigurationAPIGetSuggestedConfigurationWithResponse call -func ParseNodeConfigurationAPIGetSuggestedConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIGetSuggestedConfigurationResponse, error) { +// ParseExternalClusterAPIListClustersResponse parses an HTTP response from a ExternalClusterAPIListClustersWithResponse call +func ParseExternalClusterAPIListClustersResponse(rsp *http.Response) (*ExternalClusterAPIListClustersResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPIGetSuggestedConfigurationResponse{ + response := &ExternalClusterAPIListClustersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1GetSuggestedConfigurationResponse + var dest ExternalclusterV1ListClustersResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6335,22 +9001,22 @@ func ParseNodeConfigurationAPIGetSuggestedConfigurationResponse(rsp *http.Respon return response, nil } -// ParseNodeConfigurationAPIDeleteConfigurationResponse parses an HTTP response from a NodeConfigurationAPIDeleteConfigurationWithResponse call -func ParseNodeConfigurationAPIDeleteConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIDeleteConfigurationResponse, error) { +// ParseExternalClusterAPIRegisterClusterResponse parses an HTTP response from a ExternalClusterAPIRegisterClusterWithResponse call +func ParseExternalClusterAPIRegisterClusterResponse(rsp *http.Response) (*ExternalClusterAPIRegisterClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPIDeleteConfigurationResponse{ + response := &ExternalClusterAPIRegisterClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1DeleteConfigurationResponse + var dest ExternalclusterV1Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6361,22 +9027,22 @@ func ParseNodeConfigurationAPIDeleteConfigurationResponse(rsp *http.Response) (* return response, nil } -// ParseNodeConfigurationAPIGetConfigurationResponse parses an HTTP response from a NodeConfigurationAPIGetConfigurationWithResponse call -func ParseNodeConfigurationAPIGetConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIGetConfigurationResponse, error) { +// ParseGetExternalClusterOperationResponse parses an HTTP response from a GetExternalClusterOperationWithResponse call +func ParseGetExternalClusterOperationResponse(rsp *http.Response) (*GetExternalClusterOperationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPIGetConfigurationResponse{ + response := &GetExternalClusterOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1NodeConfiguration + var dest OperationResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6387,48 +9053,38 @@ func ParseNodeConfigurationAPIGetConfigurationResponse(rsp *http.Response) (*Nod return response, nil } -// ParseNodeConfigurationAPIUpdateConfigurationResponse parses an HTTP response from a NodeConfigurationAPIUpdateConfigurationWithResponse call -func ParseNodeConfigurationAPIUpdateConfigurationResponse(rsp *http.Response) (*NodeConfigurationAPIUpdateConfigurationResponse, error) { +// ParseExternalClusterAPIDeleteClusterResponse parses an HTTP response from a ExternalClusterAPIDeleteClusterWithResponse call +func ParseExternalClusterAPIDeleteClusterResponse(rsp *http.Response) (*ExternalClusterAPIDeleteClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPIUpdateConfigurationResponse{ + response := &ExternalClusterAPIDeleteClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1NodeConfiguration - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseNodeConfigurationAPISetDefaultResponse parses an HTTP response from a NodeConfigurationAPISetDefaultWithResponse call -func ParseNodeConfigurationAPISetDefaultResponse(rsp *http.Response) (*NodeConfigurationAPISetDefaultResponse, error) { +// ParseExternalClusterAPIGetClusterResponse parses an HTTP response from a ExternalClusterAPIGetClusterWithResponse call +func ParseExternalClusterAPIGetClusterResponse(rsp *http.Response) (*ExternalClusterAPIGetClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeConfigurationAPISetDefaultResponse{ + response := &ExternalClusterAPIGetClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodeconfigV1NodeConfiguration + var dest ExternalclusterV1Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6439,22 +9095,22 @@ func ParseNodeConfigurationAPISetDefaultResponse(rsp *http.Response) (*NodeConfi return response, nil } -// ParsePoliciesAPIGetClusterNodeConstraintsResponse parses an HTTP response from a PoliciesAPIGetClusterNodeConstraintsWithResponse call -func ParsePoliciesAPIGetClusterNodeConstraintsResponse(rsp *http.Response) (*PoliciesAPIGetClusterNodeConstraintsResponse, error) { +// ParseExternalClusterAPIUpdateClusterResponse parses an HTTP response from a ExternalClusterAPIUpdateClusterWithResponse call +func ParseExternalClusterAPIUpdateClusterResponse(rsp *http.Response) (*ExternalClusterAPIUpdateClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &PoliciesAPIGetClusterNodeConstraintsResponse{ + response := &ExternalClusterAPIUpdateClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PoliciesV1GetClusterNodeConstraintsResponse + var dest ExternalclusterV1Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6465,22 +9121,22 @@ func ParsePoliciesAPIGetClusterNodeConstraintsResponse(rsp *http.Response) (*Pol return response, nil } -// ParseNodeTemplatesAPIListNodeTemplatesResponse parses an HTTP response from a NodeTemplatesAPIListNodeTemplatesWithResponse call -func ParseNodeTemplatesAPIListNodeTemplatesResponse(rsp *http.Response) (*NodeTemplatesAPIListNodeTemplatesResponse, error) { +// ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse call +func ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPIDeleteAssumeRolePrincipalResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeTemplatesAPIListNodeTemplatesResponse{ + response := &ExternalClusterAPIDeleteAssumeRolePrincipalResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodetemplatesV1ListNodeTemplatesResponse + var dest ExternalclusterV1DeleteAssumeRolePrincipalResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6491,22 +9147,22 @@ func ParseNodeTemplatesAPIListNodeTemplatesResponse(rsp *http.Response) (*NodeTe return response, nil } -// ParseNodeTemplatesAPICreateNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPICreateNodeTemplateWithResponse call -func ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPICreateNodeTemplateResponse, error) { +// ParseExternalClusterAPIGetAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPIGetAssumeRolePrincipalWithResponse call +func ParseExternalClusterAPIGetAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPIGetAssumeRolePrincipalResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeTemplatesAPICreateNodeTemplateResponse{ + response := &ExternalClusterAPIGetAssumeRolePrincipalResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodetemplatesV1NodeTemplate + var dest ExternalclusterV1GetAssumeRolePrincipalResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6517,22 +9173,22 @@ func ParseNodeTemplatesAPICreateNodeTemplateResponse(rsp *http.Response) (*NodeT return response, nil } -// ParseNodeTemplatesAPIDeleteNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPIDeleteNodeTemplateWithResponse call -func ParseNodeTemplatesAPIDeleteNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPIDeleteNodeTemplateResponse, error) { +// ParseExternalClusterAPICreateAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPICreateAssumeRolePrincipalWithResponse call +func ParseExternalClusterAPICreateAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPICreateAssumeRolePrincipalResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeTemplatesAPIDeleteNodeTemplateResponse{ + response := &ExternalClusterAPICreateAssumeRolePrincipalResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodetemplatesV1DeleteNodeTemplateResponse + var dest ExternalclusterV1CreateAssumeRolePrincipalResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6543,22 +9199,22 @@ func ParseNodeTemplatesAPIDeleteNodeTemplateResponse(rsp *http.Response) (*NodeT return response, nil } -// ParseNodeTemplatesAPIUpdateNodeTemplateResponse parses an HTTP response from a NodeTemplatesAPIUpdateNodeTemplateWithResponse call -func ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp *http.Response) (*NodeTemplatesAPIUpdateNodeTemplateResponse, error) { +// ParseExternalClusterAPIGetAssumeRoleUserResponse parses an HTTP response from a ExternalClusterAPIGetAssumeRoleUserWithResponse call +func ParseExternalClusterAPIGetAssumeRoleUserResponse(rsp *http.Response) (*ExternalClusterAPIGetAssumeRoleUserResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &NodeTemplatesAPIUpdateNodeTemplateResponse{ + response := &ExternalClusterAPIGetAssumeRoleUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NodetemplatesV1NodeTemplate + var dest ExternalclusterV1GetAssumeRoleUserResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6569,22 +9225,22 @@ func ParseNodeTemplatesAPIUpdateNodeTemplateResponse(rsp *http.Response) (*NodeT return response, nil } -// ParsePoliciesAPIGetClusterPoliciesResponse parses an HTTP response from a PoliciesAPIGetClusterPoliciesWithResponse call -func ParsePoliciesAPIGetClusterPoliciesResponse(rsp *http.Response) (*PoliciesAPIGetClusterPoliciesResponse, error) { +// ParseExternalClusterAPIGetCleanupScriptResponse parses an HTTP response from a ExternalClusterAPIGetCleanupScriptWithResponse call +func ParseExternalClusterAPIGetCleanupScriptResponse(rsp *http.Response) (*ExternalClusterAPIGetCleanupScriptResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &PoliciesAPIGetClusterPoliciesResponse{ + response := &ExternalClusterAPIGetCleanupScriptResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PoliciesV1Policies + var dest ExternalclusterV1GetCleanupScriptResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6595,22 +9251,22 @@ func ParsePoliciesAPIGetClusterPoliciesResponse(rsp *http.Response) (*PoliciesAP return response, nil } -// ParsePoliciesAPIUpsertClusterPoliciesResponse parses an HTTP response from a PoliciesAPIUpsertClusterPoliciesWithResponse call -func ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp *http.Response) (*PoliciesAPIUpsertClusterPoliciesResponse, error) { +// ParseExternalClusterAPIGetCredentialsScriptResponse parses an HTTP response from a ExternalClusterAPIGetCredentialsScriptWithResponse call +func ParseExternalClusterAPIGetCredentialsScriptResponse(rsp *http.Response) (*ExternalClusterAPIGetCredentialsScriptResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &PoliciesAPIUpsertClusterPoliciesResponse{ + response := &ExternalClusterAPIGetCredentialsScriptResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PoliciesV1Policies + var dest ExternalclusterV1GetCredentialsScriptResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6621,22 +9277,22 @@ func ParsePoliciesAPIUpsertClusterPoliciesResponse(rsp *http.Response) (*Policie return response, nil } -// ParseScheduledRebalancingAPIListRebalancingJobsResponse parses an HTTP response from a ScheduledRebalancingAPIListRebalancingJobsWithResponse call -func ParseScheduledRebalancingAPIListRebalancingJobsResponse(rsp *http.Response) (*ScheduledRebalancingAPIListRebalancingJobsResponse, error) { +// ParseExternalClusterAPIDisconnectClusterResponse parses an HTTP response from a ExternalClusterAPIDisconnectClusterWithResponse call +func ParseExternalClusterAPIDisconnectClusterResponse(rsp *http.Response) (*ExternalClusterAPIDisconnectClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPIListRebalancingJobsResponse{ + response := &ExternalClusterAPIDisconnectClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1ListRebalancingJobsResponse + var dest ExternalclusterV1Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6647,22 +9303,22 @@ func ParseScheduledRebalancingAPIListRebalancingJobsResponse(rsp *http.Response) return response, nil } -// ParseScheduledRebalancingAPICreateRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPICreateRebalancingJobWithResponse call -func ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPICreateRebalancingJobResponse, error) { +// ParseExternalClusterAPIHandleCloudEventResponse parses an HTTP response from a ExternalClusterAPIHandleCloudEventWithResponse call +func ParseExternalClusterAPIHandleCloudEventResponse(rsp *http.Response) (*ExternalClusterAPIHandleCloudEventResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPICreateRebalancingJobResponse{ + response := &ExternalClusterAPIHandleCloudEventResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1RebalancingJob + var dest ExternalclusterV1HandleCloudEventResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6673,22 +9329,22 @@ func ParseScheduledRebalancingAPICreateRebalancingJobResponse(rsp *http.Response return response, nil } -// ParseScheduledRebalancingAPIDeleteRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIDeleteRebalancingJobWithResponse call -func ParseScheduledRebalancingAPIDeleteRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIDeleteRebalancingJobResponse, error) { +// ParseExternalClusterAPIListNodesResponse parses an HTTP response from a ExternalClusterAPIListNodesWithResponse call +func ParseExternalClusterAPIListNodesResponse(rsp *http.Response) (*ExternalClusterAPIListNodesResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPIDeleteRebalancingJobResponse{ + response := &ExternalClusterAPIListNodesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1DeleteRebalancingJobResponse + var dest ExternalclusterV1ListNodesResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6699,22 +9355,22 @@ func ParseScheduledRebalancingAPIDeleteRebalancingJobResponse(rsp *http.Response return response, nil } -// ParseScheduledRebalancingAPIGetRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIGetRebalancingJobWithResponse call -func ParseScheduledRebalancingAPIGetRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIGetRebalancingJobResponse, error) { +// ParseExternalClusterAPIAddNodeResponse parses an HTTP response from a ExternalClusterAPIAddNodeWithResponse call +func ParseExternalClusterAPIAddNodeResponse(rsp *http.Response) (*ExternalClusterAPIAddNodeResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPIGetRebalancingJobResponse{ + response := &ExternalClusterAPIAddNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1RebalancingJob + var dest ExternalclusterV1AddNodeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6725,22 +9381,22 @@ func ParseScheduledRebalancingAPIGetRebalancingJobResponse(rsp *http.Response) ( return response, nil } -// ParseScheduledRebalancingAPIUpdateRebalancingJobResponse parses an HTTP response from a ScheduledRebalancingAPIUpdateRebalancingJobWithResponse call -func ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp *http.Response) (*ScheduledRebalancingAPIUpdateRebalancingJobResponse, error) { +// ParseExternalClusterAPIDeleteNodeResponse parses an HTTP response from a ExternalClusterAPIDeleteNodeWithResponse call +func ParseExternalClusterAPIDeleteNodeResponse(rsp *http.Response) (*ExternalClusterAPIDeleteNodeResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPIUpdateRebalancingJobResponse{ + response := &ExternalClusterAPIDeleteNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1RebalancingJob + var dest ExternalclusterV1DeleteNodeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6751,22 +9407,22 @@ func ParseScheduledRebalancingAPIUpdateRebalancingJobResponse(rsp *http.Response return response, nil } -// ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse parses an HTTP response from a ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse call -func ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp *http.Response) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) { +// ParseExternalClusterAPIGetNodeResponse parses an HTTP response from a ExternalClusterAPIGetNodeWithResponse call +func ParseExternalClusterAPIGetNodeResponse(rsp *http.Response) (*ExternalClusterAPIGetNodeResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ScheduledRebalancingAPIPreviewRebalancingScheduleResponse{ + response := &ExternalClusterAPIGetNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ScheduledrebalancingV1PreviewRebalancingScheduleResponse + var dest ExternalclusterV1Node if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6777,22 +9433,22 @@ func ParseScheduledRebalancingAPIPreviewRebalancingScheduleResponse(rsp *http.Re return response, nil } -// ParseExternalClusterAPIListClustersResponse parses an HTTP response from a ExternalClusterAPIListClustersWithResponse call -func ParseExternalClusterAPIListClustersResponse(rsp *http.Response) (*ExternalClusterAPIListClustersResponse, error) { +// ParseExternalClusterAPIDrainNodeResponse parses an HTTP response from a ExternalClusterAPIDrainNodeWithResponse call +func ParseExternalClusterAPIDrainNodeResponse(rsp *http.Response) (*ExternalClusterAPIDrainNodeResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIListClustersResponse{ + response := &ExternalClusterAPIDrainNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1ListClustersResponse + var dest ExternalclusterV1DrainNodeResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6803,22 +9459,22 @@ func ParseExternalClusterAPIListClustersResponse(rsp *http.Response) (*ExternalC return response, nil } -// ParseExternalClusterAPIRegisterClusterResponse parses an HTTP response from a ExternalClusterAPIRegisterClusterWithResponse call -func ParseExternalClusterAPIRegisterClusterResponse(rsp *http.Response) (*ExternalClusterAPIRegisterClusterResponse, error) { +// ParseExternalClusterAPIReconcileClusterResponse parses an HTTP response from a ExternalClusterAPIReconcileClusterWithResponse call +func ParseExternalClusterAPIReconcileClusterResponse(rsp *http.Response) (*ExternalClusterAPIReconcileClusterResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIRegisterClusterResponse{ + response := &ExternalClusterAPIReconcileClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1Cluster + var dest ExternalclusterV1ReconcileClusterResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6829,22 +9485,22 @@ func ParseExternalClusterAPIRegisterClusterResponse(rsp *http.Response) (*Extern return response, nil } -// ParseGetExternalClusterOperationResponse parses an HTTP response from a GetExternalClusterOperationWithResponse call -func ParseGetExternalClusterOperationResponse(rsp *http.Response) (*GetExternalClusterOperationResponse, error) { +// ParseExternalClusterAPICreateClusterTokenResponse parses an HTTP response from a ExternalClusterAPICreateClusterTokenWithResponse call +func ParseExternalClusterAPICreateClusterTokenResponse(rsp *http.Response) (*ExternalClusterAPICreateClusterTokenResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &GetExternalClusterOperationResponse{ + response := &ExternalClusterAPICreateClusterTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OperationResponse + var dest ExternalclusterV1CreateClusterTokenResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6855,38 +9511,48 @@ func ParseGetExternalClusterOperationResponse(rsp *http.Response) (*GetExternalC return response, nil } -// ParseExternalClusterAPIDeleteClusterResponse parses an HTTP response from a ExternalClusterAPIDeleteClusterWithResponse call -func ParseExternalClusterAPIDeleteClusterResponse(rsp *http.Response) (*ExternalClusterAPIDeleteClusterResponse, error) { +// ParseCurrentUserProfileResponse parses an HTTP response from a CurrentUserProfileWithResponse call +func ParseCurrentUserProfileResponse(rsp *http.Response) (*CurrentUserProfileResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIDeleteClusterResponse{ + response := &CurrentUserProfileResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserProfileResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } -// ParseExternalClusterAPIGetClusterResponse parses an HTTP response from a ExternalClusterAPIGetClusterWithResponse call -func ParseExternalClusterAPIGetClusterResponse(rsp *http.Response) (*ExternalClusterAPIGetClusterResponse, error) { +// ParseUpdateCurrentUserProfileResponse parses an HTTP response from a UpdateCurrentUserProfileWithResponse call +func ParseUpdateCurrentUserProfileResponse(rsp *http.Response) (*UpdateCurrentUserProfileResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetClusterResponse{ + response := &UpdateCurrentUserProfileResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1Cluster + var dest UserProfile if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6897,22 +9563,22 @@ func ParseExternalClusterAPIGetClusterResponse(rsp *http.Response) (*ExternalClu return response, nil } -// ParseExternalClusterAPIUpdateClusterResponse parses an HTTP response from a ExternalClusterAPIUpdateClusterWithResponse call -func ParseExternalClusterAPIUpdateClusterResponse(rsp *http.Response) (*ExternalClusterAPIUpdateClusterResponse, error) { +// ParseListOrganizationsResponse parses an HTTP response from a ListOrganizationsWithResponse call +func ParseListOrganizationsResponse(rsp *http.Response) (*ListOrganizationsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIUpdateClusterResponse{ + response := &ListOrganizationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1Cluster + var dest OrganizationsList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6923,22 +9589,22 @@ func ParseExternalClusterAPIUpdateClusterResponse(rsp *http.Response) (*External return response, nil } -// ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPIDeleteAssumeRolePrincipalWithResponse call -func ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPIDeleteAssumeRolePrincipalResponse, error) { +// ParseCreateOrganizationResponse parses an HTTP response from a CreateOrganizationWithResponse call +func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIDeleteAssumeRolePrincipalResponse{ + response := &CreateOrganizationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1DeleteAssumeRolePrincipalResponse + var dest Organization if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6949,22 +9615,22 @@ func ParseExternalClusterAPIDeleteAssumeRolePrincipalResponse(rsp *http.Response return response, nil } -// ParseExternalClusterAPIGetAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPIGetAssumeRolePrincipalWithResponse call -func ParseExternalClusterAPIGetAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPIGetAssumeRolePrincipalResponse, error) { +// ParseDeleteOrganizationResponse parses an HTTP response from a DeleteOrganizationWithResponse call +func ParseDeleteOrganizationResponse(rsp *http.Response) (*DeleteOrganizationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetAssumeRolePrincipalResponse{ + response := &DeleteOrganizationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1GetAssumeRolePrincipalResponse + var dest Organization if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6975,22 +9641,22 @@ func ParseExternalClusterAPIGetAssumeRolePrincipalResponse(rsp *http.Response) ( return response, nil } -// ParseExternalClusterAPICreateAssumeRolePrincipalResponse parses an HTTP response from a ExternalClusterAPICreateAssumeRolePrincipalWithResponse call -func ParseExternalClusterAPICreateAssumeRolePrincipalResponse(rsp *http.Response) (*ExternalClusterAPICreateAssumeRolePrincipalResponse, error) { +// ParseGetOrganizationResponse parses an HTTP response from a GetOrganizationWithResponse call +func ParseGetOrganizationResponse(rsp *http.Response) (*GetOrganizationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPICreateAssumeRolePrincipalResponse{ + response := &GetOrganizationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1CreateAssumeRolePrincipalResponse + var dest Organization if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7001,22 +9667,22 @@ func ParseExternalClusterAPICreateAssumeRolePrincipalResponse(rsp *http.Response return response, nil } -// ParseExternalClusterAPIGetAssumeRoleUserResponse parses an HTTP response from a ExternalClusterAPIGetAssumeRoleUserWithResponse call -func ParseExternalClusterAPIGetAssumeRoleUserResponse(rsp *http.Response) (*ExternalClusterAPIGetAssumeRoleUserResponse, error) { +// ParseUpdateOrganizationResponse parses an HTTP response from a UpdateOrganizationWithResponse call +func ParseUpdateOrganizationResponse(rsp *http.Response) (*UpdateOrganizationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetAssumeRoleUserResponse{ + response := &UpdateOrganizationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1GetAssumeRoleUserResponse + var dest Organization if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7027,22 +9693,22 @@ func ParseExternalClusterAPIGetAssumeRoleUserResponse(rsp *http.Response) (*Exte return response, nil } -// ParseExternalClusterAPIGetCleanupScriptResponse parses an HTTP response from a ExternalClusterAPIGetCleanupScriptWithResponse call -func ParseExternalClusterAPIGetCleanupScriptResponse(rsp *http.Response) (*ExternalClusterAPIGetCleanupScriptResponse, error) { +// ParseGetOrganizationUsersResponse parses an HTTP response from a GetOrganizationUsersWithResponse call +func ParseGetOrganizationUsersResponse(rsp *http.Response) (*GetOrganizationUsersResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetCleanupScriptResponse{ + response := &GetOrganizationUsersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1GetCleanupScriptResponse + var dest OrganizationUsersList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7053,22 +9719,22 @@ func ParseExternalClusterAPIGetCleanupScriptResponse(rsp *http.Response) (*Exter return response, nil } -// ParseExternalClusterAPIGetCredentialsScriptResponse parses an HTTP response from a ExternalClusterAPIGetCredentialsScriptWithResponse call -func ParseExternalClusterAPIGetCredentialsScriptResponse(rsp *http.Response) (*ExternalClusterAPIGetCredentialsScriptResponse, error) { +// ParseCreateOrganizationUserResponse parses an HTTP response from a CreateOrganizationUserWithResponse call +func ParseCreateOrganizationUserResponse(rsp *http.Response) (*CreateOrganizationUserResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetCredentialsScriptResponse{ + response := &CreateOrganizationUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1GetCredentialsScriptResponse + var dest OrganizationUser if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7079,22 +9745,22 @@ func ParseExternalClusterAPIGetCredentialsScriptResponse(rsp *http.Response) (*E return response, nil } -// ParseExternalClusterAPIDisconnectClusterResponse parses an HTTP response from a ExternalClusterAPIDisconnectClusterWithResponse call -func ParseExternalClusterAPIDisconnectClusterResponse(rsp *http.Response) (*ExternalClusterAPIDisconnectClusterResponse, error) { +// ParseDeleteOrganizationUserResponse parses an HTTP response from a DeleteOrganizationUserWithResponse call +func ParseDeleteOrganizationUserResponse(rsp *http.Response) (*DeleteOrganizationUserResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIDisconnectClusterResponse{ + response := &DeleteOrganizationUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1Cluster + var dest map[string]interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7105,22 +9771,22 @@ func ParseExternalClusterAPIDisconnectClusterResponse(rsp *http.Response) (*Exte return response, nil } -// ParseExternalClusterAPIHandleCloudEventResponse parses an HTTP response from a ExternalClusterAPIHandleCloudEventWithResponse call -func ParseExternalClusterAPIHandleCloudEventResponse(rsp *http.Response) (*ExternalClusterAPIHandleCloudEventResponse, error) { +// ParseUpdateOrganizationUserResponse parses an HTTP response from a UpdateOrganizationUserWithResponse call +func ParseUpdateOrganizationUserResponse(rsp *http.Response) (*UpdateOrganizationUserResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIHandleCloudEventResponse{ + response := &UpdateOrganizationUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1HandleCloudEventResponse + var dest OrganizationUser if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7131,22 +9797,22 @@ func ParseExternalClusterAPIHandleCloudEventResponse(rsp *http.Response) (*Exter return response, nil } -// ParseExternalClusterAPIListNodesResponse parses an HTTP response from a ExternalClusterAPIListNodesWithResponse call -func ParseExternalClusterAPIListNodesResponse(rsp *http.Response) (*ExternalClusterAPIListNodesResponse, error) { +// ParseInventoryAPISyncClusterResourcesResponse parses an HTTP response from a InventoryAPISyncClusterResourcesWithResponse call +func ParseInventoryAPISyncClusterResourcesResponse(rsp *http.Response) (*InventoryAPISyncClusterResourcesResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIListNodesResponse{ + response := &InventoryAPISyncClusterResourcesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1ListNodesResponse + var dest map[string]interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7157,22 +9823,22 @@ func ParseExternalClusterAPIListNodesResponse(rsp *http.Response) (*ExternalClus return response, nil } -// ParseExternalClusterAPIAddNodeResponse parses an HTTP response from a ExternalClusterAPIAddNodeWithResponse call -func ParseExternalClusterAPIAddNodeResponse(rsp *http.Response) (*ExternalClusterAPIAddNodeResponse, error) { +// ParseInventoryAPIGetReservationsResponse parses an HTTP response from a InventoryAPIGetReservationsWithResponse call +func ParseInventoryAPIGetReservationsResponse(rsp *http.Response) (*InventoryAPIGetReservationsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIAddNodeResponse{ + response := &InventoryAPIGetReservationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1AddNodeResponse + var dest CastaiInventoryV1beta1GetReservationsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7183,22 +9849,22 @@ func ParseExternalClusterAPIAddNodeResponse(rsp *http.Response) (*ExternalCluste return response, nil } -// ParseExternalClusterAPIDeleteNodeResponse parses an HTTP response from a ExternalClusterAPIDeleteNodeWithResponse call -func ParseExternalClusterAPIDeleteNodeResponse(rsp *http.Response) (*ExternalClusterAPIDeleteNodeResponse, error) { +// ParseInventoryAPIAddReservationResponse parses an HTTP response from a InventoryAPIAddReservationWithResponse call +func ParseInventoryAPIAddReservationResponse(rsp *http.Response) (*InventoryAPIAddReservationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIDeleteNodeResponse{ + response := &InventoryAPIAddReservationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1DeleteNodeResponse + var dest CastaiInventoryV1beta1AddReservationResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7209,22 +9875,22 @@ func ParseExternalClusterAPIDeleteNodeResponse(rsp *http.Response) (*ExternalClu return response, nil } -// ParseExternalClusterAPIGetNodeResponse parses an HTTP response from a ExternalClusterAPIGetNodeWithResponse call -func ParseExternalClusterAPIGetNodeResponse(rsp *http.Response) (*ExternalClusterAPIGetNodeResponse, error) { +// ParseInventoryAPIGetReservationsBalanceResponse parses an HTTP response from a InventoryAPIGetReservationsBalanceWithResponse call +func ParseInventoryAPIGetReservationsBalanceResponse(rsp *http.Response) (*InventoryAPIGetReservationsBalanceResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIGetNodeResponse{ + response := &InventoryAPIGetReservationsBalanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1Node + var dest CastaiInventoryV1beta1GetReservationsBalanceResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7235,22 +9901,22 @@ func ParseExternalClusterAPIGetNodeResponse(rsp *http.Response) (*ExternalCluste return response, nil } -// ParseExternalClusterAPIDrainNodeResponse parses an HTTP response from a ExternalClusterAPIDrainNodeWithResponse call -func ParseExternalClusterAPIDrainNodeResponse(rsp *http.Response) (*ExternalClusterAPIDrainNodeResponse, error) { +// ParseInventoryAPIOverwriteReservationsResponse parses an HTTP response from a InventoryAPIOverwriteReservationsWithResponse call +func ParseInventoryAPIOverwriteReservationsResponse(rsp *http.Response) (*InventoryAPIOverwriteReservationsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIDrainNodeResponse{ + response := &InventoryAPIOverwriteReservationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1DrainNodeResponse + var dest CastaiInventoryV1beta1OverwriteReservationsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7261,22 +9927,22 @@ func ParseExternalClusterAPIDrainNodeResponse(rsp *http.Response) (*ExternalClus return response, nil } -// ParseExternalClusterAPIReconcileClusterResponse parses an HTTP response from a ExternalClusterAPIReconcileClusterWithResponse call -func ParseExternalClusterAPIReconcileClusterResponse(rsp *http.Response) (*ExternalClusterAPIReconcileClusterResponse, error) { +// ParseInventoryAPIDeleteReservationResponse parses an HTTP response from a InventoryAPIDeleteReservationWithResponse call +func ParseInventoryAPIDeleteReservationResponse(rsp *http.Response) (*InventoryAPIDeleteReservationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPIReconcileClusterResponse{ + response := &InventoryAPIDeleteReservationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1ReconcileClusterResponse + var dest map[string]interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7287,22 +9953,22 @@ func ParseExternalClusterAPIReconcileClusterResponse(rsp *http.Response) (*Exter return response, nil } -// ParseExternalClusterAPICreateClusterTokenResponse parses an HTTP response from a ExternalClusterAPICreateClusterTokenWithResponse call -func ParseExternalClusterAPICreateClusterTokenResponse(rsp *http.Response) (*ExternalClusterAPICreateClusterTokenResponse, error) { +// ParseInventoryAPIGetResourceUsageResponse parses an HTTP response from a InventoryAPIGetResourceUsageWithResponse call +func ParseInventoryAPIGetResourceUsageResponse(rsp *http.Response) (*InventoryAPIGetResourceUsageResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) defer rsp.Body.Close() if err != nil { return nil, err } - response := &ExternalClusterAPICreateClusterTokenResponse{ + response := &InventoryAPIGetResourceUsageResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ExternalclusterV1CreateClusterTokenResponse + var dest CastaiInventoryV1beta1GetResourceUsageResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/castai/sdk/mock/client.go b/castai/sdk/mock/client.go index 8893a7fb..7f32c6df 100644 --- a/castai/sdk/mock/client.go +++ b/castai/sdk/mock/client.go @@ -215,6 +215,226 @@ func (mr *MockClientInterfaceMockRecorder) AuthTokenAPIUpdateAuthTokenWithBody(c return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthTokenAPIUpdateAuthTokenWithBody", reflect.TypeOf((*MockClientInterface)(nil).AuthTokenAPIUpdateAuthTokenWithBody), varargs...) } +// ClaimInvitation mocks base method. +func (m *MockClientInterface) ClaimInvitation(ctx context.Context, id string, body sdk.ClaimInvitationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ClaimInvitation", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ClaimInvitation indicates an expected call of ClaimInvitation. +func (mr *MockClientInterfaceMockRecorder) ClaimInvitation(ctx, id, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClaimInvitation", reflect.TypeOf((*MockClientInterface)(nil).ClaimInvitation), varargs...) +} + +// ClaimInvitationWithBody mocks base method. +func (m *MockClientInterface) ClaimInvitationWithBody(ctx context.Context, id, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ClaimInvitationWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ClaimInvitationWithBody indicates an expected call of ClaimInvitationWithBody. +func (mr *MockClientInterfaceMockRecorder) ClaimInvitationWithBody(ctx, id, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClaimInvitationWithBody", reflect.TypeOf((*MockClientInterface)(nil).ClaimInvitationWithBody), varargs...) +} + +// CreateInvitation mocks base method. +func (m *MockClientInterface) CreateInvitation(ctx context.Context, body sdk.CreateInvitationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateInvitation", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateInvitation indicates an expected call of CreateInvitation. +func (mr *MockClientInterfaceMockRecorder) CreateInvitation(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateInvitation", reflect.TypeOf((*MockClientInterface)(nil).CreateInvitation), varargs...) +} + +// CreateInvitationWithBody mocks base method. +func (m *MockClientInterface) CreateInvitationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateInvitationWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateInvitationWithBody indicates an expected call of CreateInvitationWithBody. +func (mr *MockClientInterfaceMockRecorder) CreateInvitationWithBody(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateInvitationWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreateInvitationWithBody), varargs...) +} + +// CreateOrganization mocks base method. +func (m *MockClientInterface) CreateOrganization(ctx context.Context, body sdk.CreateOrganizationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateOrganization", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganization indicates an expected call of CreateOrganization. +func (mr *MockClientInterfaceMockRecorder) CreateOrganization(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganization", reflect.TypeOf((*MockClientInterface)(nil).CreateOrganization), varargs...) +} + +// CreateOrganizationUser mocks base method. +func (m *MockClientInterface) CreateOrganizationUser(ctx context.Context, id string, body sdk.CreateOrganizationUserJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateOrganizationUser", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationUser indicates an expected call of CreateOrganizationUser. +func (mr *MockClientInterfaceMockRecorder) CreateOrganizationUser(ctx, id, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationUser", reflect.TypeOf((*MockClientInterface)(nil).CreateOrganizationUser), varargs...) +} + +// CreateOrganizationUserWithBody mocks base method. +func (m *MockClientInterface) CreateOrganizationUserWithBody(ctx context.Context, id, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateOrganizationUserWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationUserWithBody indicates an expected call of CreateOrganizationUserWithBody. +func (mr *MockClientInterfaceMockRecorder) CreateOrganizationUserWithBody(ctx, id, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationUserWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreateOrganizationUserWithBody), varargs...) +} + +// CreateOrganizationWithBody mocks base method. +func (m *MockClientInterface) CreateOrganizationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateOrganizationWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationWithBody indicates an expected call of CreateOrganizationWithBody. +func (mr *MockClientInterfaceMockRecorder) CreateOrganizationWithBody(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreateOrganizationWithBody), varargs...) +} + +// CurrentUserProfile mocks base method. +func (m *MockClientInterface) CurrentUserProfile(ctx context.Context, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CurrentUserProfile", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CurrentUserProfile indicates an expected call of CurrentUserProfile. +func (mr *MockClientInterfaceMockRecorder) CurrentUserProfile(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentUserProfile", reflect.TypeOf((*MockClientInterface)(nil).CurrentUserProfile), varargs...) +} + +// DeleteOrganization mocks base method. +func (m *MockClientInterface) DeleteOrganization(ctx context.Context, id string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteOrganization", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOrganization indicates an expected call of DeleteOrganization. +func (mr *MockClientInterfaceMockRecorder) DeleteOrganization(ctx, id interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrganization", reflect.TypeOf((*MockClientInterface)(nil).DeleteOrganization), varargs...) +} + +// DeleteOrganizationUser mocks base method. +func (m *MockClientInterface) DeleteOrganizationUser(ctx context.Context, id, userId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, userId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteOrganizationUser", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOrganizationUser indicates an expected call of DeleteOrganizationUser. +func (mr *MockClientInterfaceMockRecorder) DeleteOrganizationUser(ctx, id, userId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, userId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrganizationUser", reflect.TypeOf((*MockClientInterface)(nil).DeleteOrganizationUser), varargs...) +} + // ExternalClusterAPIAddNode mocks base method. func (m *MockClientInterface) ExternalClusterAPIAddNode(ctx context.Context, clusterId string, body sdk.ExternalClusterAPIAddNodeJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -795,6 +1015,246 @@ func (mr *MockClientInterfaceMockRecorder) GetExternalClusterOperation(ctx, id i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExternalClusterOperation", reflect.TypeOf((*MockClientInterface)(nil).GetExternalClusterOperation), varargs...) } +// GetOrganization mocks base method. +func (m *MockClientInterface) GetOrganization(ctx context.Context, id string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetOrganization", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOrganization indicates an expected call of GetOrganization. +func (mr *MockClientInterfaceMockRecorder) GetOrganization(ctx, id interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrganization", reflect.TypeOf((*MockClientInterface)(nil).GetOrganization), varargs...) +} + +// GetOrganizationUsers mocks base method. +func (m *MockClientInterface) GetOrganizationUsers(ctx context.Context, id string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetOrganizationUsers", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOrganizationUsers indicates an expected call of GetOrganizationUsers. +func (mr *MockClientInterfaceMockRecorder) GetOrganizationUsers(ctx, id interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrganizationUsers", reflect.TypeOf((*MockClientInterface)(nil).GetOrganizationUsers), varargs...) +} + +// InventoryAPIAddReservation mocks base method. +func (m *MockClientInterface) InventoryAPIAddReservation(ctx context.Context, organizationId string, body sdk.InventoryAPIAddReservationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIAddReservation", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIAddReservation indicates an expected call of InventoryAPIAddReservation. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIAddReservation(ctx, organizationId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIAddReservation", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIAddReservation), varargs...) +} + +// InventoryAPIAddReservationWithBody mocks base method. +func (m *MockClientInterface) InventoryAPIAddReservationWithBody(ctx context.Context, organizationId, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIAddReservationWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIAddReservationWithBody indicates an expected call of InventoryAPIAddReservationWithBody. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIAddReservationWithBody(ctx, organizationId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIAddReservationWithBody", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIAddReservationWithBody), varargs...) +} + +// InventoryAPIDeleteReservation mocks base method. +func (m *MockClientInterface) InventoryAPIDeleteReservation(ctx context.Context, organizationId, reservationId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, reservationId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIDeleteReservation", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIDeleteReservation indicates an expected call of InventoryAPIDeleteReservation. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIDeleteReservation(ctx, organizationId, reservationId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, reservationId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIDeleteReservation", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIDeleteReservation), varargs...) +} + +// InventoryAPIGetReservations mocks base method. +func (m *MockClientInterface) InventoryAPIGetReservations(ctx context.Context, organizationId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIGetReservations", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetReservations indicates an expected call of InventoryAPIGetReservations. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIGetReservations(ctx, organizationId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetReservations", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIGetReservations), varargs...) +} + +// InventoryAPIGetReservationsBalance mocks base method. +func (m *MockClientInterface) InventoryAPIGetReservationsBalance(ctx context.Context, organizationId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIGetReservationsBalance", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetReservationsBalance indicates an expected call of InventoryAPIGetReservationsBalance. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIGetReservationsBalance(ctx, organizationId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetReservationsBalance", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIGetReservationsBalance), varargs...) +} + +// InventoryAPIGetResourceUsage mocks base method. +func (m *MockClientInterface) InventoryAPIGetResourceUsage(ctx context.Context, organizationId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIGetResourceUsage", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetResourceUsage indicates an expected call of InventoryAPIGetResourceUsage. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIGetResourceUsage(ctx, organizationId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetResourceUsage", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIGetResourceUsage), varargs...) +} + +// InventoryAPIOverwriteReservations mocks base method. +func (m *MockClientInterface) InventoryAPIOverwriteReservations(ctx context.Context, organizationId string, body sdk.InventoryAPIOverwriteReservationsJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIOverwriteReservations", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIOverwriteReservations indicates an expected call of InventoryAPIOverwriteReservations. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIOverwriteReservations(ctx, organizationId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIOverwriteReservations", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIOverwriteReservations), varargs...) +} + +// InventoryAPIOverwriteReservationsWithBody mocks base method. +func (m *MockClientInterface) InventoryAPIOverwriteReservationsWithBody(ctx context.Context, organizationId, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPIOverwriteReservationsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIOverwriteReservationsWithBody indicates an expected call of InventoryAPIOverwriteReservationsWithBody. +func (mr *MockClientInterfaceMockRecorder) InventoryAPIOverwriteReservationsWithBody(ctx, organizationId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIOverwriteReservationsWithBody", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPIOverwriteReservationsWithBody), varargs...) +} + +// InventoryAPISyncClusterResources mocks base method. +func (m *MockClientInterface) InventoryAPISyncClusterResources(ctx context.Context, organizationId, clusterId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, clusterId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "InventoryAPISyncClusterResources", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPISyncClusterResources indicates an expected call of InventoryAPISyncClusterResources. +func (mr *MockClientInterfaceMockRecorder) InventoryAPISyncClusterResources(ctx, organizationId, clusterId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, clusterId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPISyncClusterResources", reflect.TypeOf((*MockClientInterface)(nil).InventoryAPISyncClusterResources), varargs...) +} + +// ListOrganizations mocks base method. +func (m *MockClientInterface) ListOrganizations(ctx context.Context, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListOrganizations", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListOrganizations indicates an expected call of ListOrganizations. +func (mr *MockClientInterfaceMockRecorder) ListOrganizations(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOrganizations", reflect.TypeOf((*MockClientInterface)(nil).ListOrganizations), varargs...) +} + // NodeConfigurationAPICreateConfiguration mocks base method. func (m *MockClientInterface) NodeConfigurationAPICreateConfiguration(ctx context.Context, clusterId string, body sdk.NodeConfigurationAPICreateConfigurationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1498,61 +1958,181 @@ func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalanc // ScheduledRebalancingAPIUpdateRebalancingJobWithBody mocks base method. func (m *MockClientInterface) ScheduledRebalancingAPIUpdateRebalancingJobWithBody(ctx context.Context, clusterId, id, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clusterId, id, contentType, body} + varargs := []interface{}{ctx, clusterId, id, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingJobWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ScheduledRebalancingAPIUpdateRebalancingJobWithBody indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingJobWithBody. +func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingJobWithBody(ctx, clusterId, id, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clusterId, id, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingJobWithBody", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingJobWithBody), varargs...) +} + +// ScheduledRebalancingAPIUpdateRebalancingSchedule mocks base method. +func (m *MockClientInterface) ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx context.Context, params *sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleParams, body sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingSchedule", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ScheduledRebalancingAPIUpdateRebalancingSchedule indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingSchedule. +func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx, params, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingSchedule", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingSchedule), varargs...) +} + +// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody mocks base method. +func (m *MockClientInterface) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx context.Context, params *sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleParams, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody. +func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx, params, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody), varargs...) +} + +// UpdateCurrentUserProfile mocks base method. +func (m *MockClientInterface) UpdateCurrentUserProfile(ctx context.Context, body sdk.UpdateCurrentUserProfileJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateCurrentUserProfile", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCurrentUserProfile indicates an expected call of UpdateCurrentUserProfile. +func (mr *MockClientInterfaceMockRecorder) UpdateCurrentUserProfile(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCurrentUserProfile", reflect.TypeOf((*MockClientInterface)(nil).UpdateCurrentUserProfile), varargs...) +} + +// UpdateCurrentUserProfileWithBody mocks base method. +func (m *MockClientInterface) UpdateCurrentUserProfileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateCurrentUserProfileWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCurrentUserProfileWithBody indicates an expected call of UpdateCurrentUserProfileWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateCurrentUserProfileWithBody(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCurrentUserProfileWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateCurrentUserProfileWithBody), varargs...) +} + +// UpdateOrganization mocks base method. +func (m *MockClientInterface) UpdateOrganization(ctx context.Context, id string, body sdk.UpdateOrganizationJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateOrganization", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateOrganization indicates an expected call of UpdateOrganization. +func (mr *MockClientInterfaceMockRecorder) UpdateOrganization(ctx, id, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, id, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganization", reflect.TypeOf((*MockClientInterface)(nil).UpdateOrganization), varargs...) +} + +// UpdateOrganizationUser mocks base method. +func (m *MockClientInterface) UpdateOrganizationUser(ctx context.Context, id, userId string, body sdk.UpdateOrganizationUserJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, id, userId, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingJobWithBody", varargs...) + ret := m.ctrl.Call(m, "UpdateOrganizationUser", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// ScheduledRebalancingAPIUpdateRebalancingJobWithBody indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingJobWithBody. -func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingJobWithBody(ctx, clusterId, id, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// UpdateOrganizationUser indicates an expected call of UpdateOrganizationUser. +func (mr *MockClientInterfaceMockRecorder) UpdateOrganizationUser(ctx, id, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clusterId, id, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingJobWithBody", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingJobWithBody), varargs...) + varargs := append([]interface{}{ctx, id, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationUser", reflect.TypeOf((*MockClientInterface)(nil).UpdateOrganizationUser), varargs...) } -// ScheduledRebalancingAPIUpdateRebalancingSchedule mocks base method. -func (m *MockClientInterface) ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx context.Context, params *sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleParams, body sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleJSONRequestBody, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { +// UpdateOrganizationUserWithBody mocks base method. +func (m *MockClientInterface) UpdateOrganizationUserWithBody(ctx context.Context, id, userId, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, params, body} + varargs := []interface{}{ctx, id, userId, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingSchedule", varargs...) + ret := m.ctrl.Call(m, "UpdateOrganizationUserWithBody", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// ScheduledRebalancingAPIUpdateRebalancingSchedule indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingSchedule. -func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingSchedule(ctx, params, body interface{}, reqEditors ...interface{}) *gomock.Call { +// UpdateOrganizationUserWithBody indicates an expected call of UpdateOrganizationUserWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateOrganizationUserWithBody(ctx, id, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, params, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingSchedule", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingSchedule), varargs...) + varargs := append([]interface{}{ctx, id, userId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationUserWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateOrganizationUserWithBody), varargs...) } -// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody mocks base method. -func (m *MockClientInterface) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx context.Context, params *sdk.ScheduledRebalancingAPIUpdateRebalancingScheduleParams, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { +// UpdateOrganizationWithBody mocks base method. +func (m *MockClientInterface) UpdateOrganizationWithBody(ctx context.Context, id, contentType string, body io.Reader, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, params, contentType, body} + varargs := []interface{}{ctx, id, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody", varargs...) + ret := m.ctrl.Call(m, "UpdateOrganizationWithBody", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody indicates an expected call of ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody. -func (mr *MockClientInterfaceMockRecorder) ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody(ctx, params, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// UpdateOrganizationWithBody indicates an expected call of UpdateOrganizationWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateOrganizationWithBody(ctx, id, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, params, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody", reflect.TypeOf((*MockClientInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingScheduleWithBody), varargs...) + varargs := append([]interface{}{ctx, id, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateOrganizationWithBody), varargs...) } // MockClientWithResponsesInterface is a mock of ClientWithResponsesInterface interface. @@ -1683,6 +2263,171 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) AuthTokenAPIUpdateAuthTo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthTokenAPIUpdateAuthTokenWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AuthTokenAPIUpdateAuthTokenWithResponse), ctx, id, body) } +// ClaimInvitationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ClaimInvitationWithBodyWithResponse(ctx context.Context, id, contentType string, body io.Reader) (*sdk.ClaimInvitationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClaimInvitationWithBodyWithResponse", ctx, id, contentType, body) + ret0, _ := ret[0].(*sdk.ClaimInvitationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ClaimInvitationWithBodyWithResponse indicates an expected call of ClaimInvitationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ClaimInvitationWithBodyWithResponse(ctx, id, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClaimInvitationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ClaimInvitationWithBodyWithResponse), ctx, id, contentType, body) +} + +// ClaimInvitationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ClaimInvitationWithResponse(ctx context.Context, id string, body sdk.ClaimInvitationJSONRequestBody) (*sdk.ClaimInvitationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClaimInvitationWithResponse", ctx, id, body) + ret0, _ := ret[0].(*sdk.ClaimInvitationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ClaimInvitationWithResponse indicates an expected call of ClaimInvitationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ClaimInvitationWithResponse(ctx, id, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClaimInvitationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ClaimInvitationWithResponse), ctx, id, body) +} + +// CreateInvitationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateInvitationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*sdk.CreateInvitationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateInvitationWithBodyWithResponse", ctx, contentType, body) + ret0, _ := ret[0].(*sdk.CreateInvitationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateInvitationWithBodyWithResponse indicates an expected call of CreateInvitationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateInvitationWithBodyWithResponse(ctx, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateInvitationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateInvitationWithBodyWithResponse), ctx, contentType, body) +} + +// CreateInvitationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateInvitationWithResponse(ctx context.Context, body sdk.CreateInvitationJSONRequestBody) (*sdk.CreateInvitationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateInvitationWithResponse", ctx, body) + ret0, _ := ret[0].(*sdk.CreateInvitationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateInvitationWithResponse indicates an expected call of CreateInvitationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateInvitationWithResponse(ctx, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateInvitationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateInvitationWithResponse), ctx, body) +} + +// CreateOrganizationUserWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateOrganizationUserWithBodyWithResponse(ctx context.Context, id, contentType string, body io.Reader) (*sdk.CreateOrganizationUserResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrganizationUserWithBodyWithResponse", ctx, id, contentType, body) + ret0, _ := ret[0].(*sdk.CreateOrganizationUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationUserWithBodyWithResponse indicates an expected call of CreateOrganizationUserWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateOrganizationUserWithBodyWithResponse(ctx, id, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationUserWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateOrganizationUserWithBodyWithResponse), ctx, id, contentType, body) +} + +// CreateOrganizationUserWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateOrganizationUserWithResponse(ctx context.Context, id string, body sdk.CreateOrganizationUserJSONRequestBody) (*sdk.CreateOrganizationUserResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrganizationUserWithResponse", ctx, id, body) + ret0, _ := ret[0].(*sdk.CreateOrganizationUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationUserWithResponse indicates an expected call of CreateOrganizationUserWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateOrganizationUserWithResponse(ctx, id, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationUserWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateOrganizationUserWithResponse), ctx, id, body) +} + +// CreateOrganizationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*sdk.CreateOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrganizationWithBodyWithResponse", ctx, contentType, body) + ret0, _ := ret[0].(*sdk.CreateOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationWithBodyWithResponse indicates an expected call of CreateOrganizationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateOrganizationWithBodyWithResponse(ctx, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateOrganizationWithBodyWithResponse), ctx, contentType, body) +} + +// CreateOrganizationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreateOrganizationWithResponse(ctx context.Context, body sdk.CreateOrganizationJSONRequestBody) (*sdk.CreateOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrganizationWithResponse", ctx, body) + ret0, _ := ret[0].(*sdk.CreateOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrganizationWithResponse indicates an expected call of CreateOrganizationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreateOrganizationWithResponse(ctx, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrganizationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreateOrganizationWithResponse), ctx, body) +} + +// CurrentUserProfileWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CurrentUserProfileWithResponse(ctx context.Context) (*sdk.CurrentUserProfileResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CurrentUserProfileWithResponse", ctx) + ret0, _ := ret[0].(*sdk.CurrentUserProfileResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CurrentUserProfileWithResponse indicates an expected call of CurrentUserProfileWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CurrentUserProfileWithResponse(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentUserProfileWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CurrentUserProfileWithResponse), ctx) +} + +// DeleteOrganizationUserWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeleteOrganizationUserWithResponse(ctx context.Context, id, userId string) (*sdk.DeleteOrganizationUserResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOrganizationUserWithResponse", ctx, id, userId) + ret0, _ := ret[0].(*sdk.DeleteOrganizationUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOrganizationUserWithResponse indicates an expected call of DeleteOrganizationUserWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeleteOrganizationUserWithResponse(ctx, id, userId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrganizationUserWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeleteOrganizationUserWithResponse), ctx, id, userId) +} + +// DeleteOrganizationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeleteOrganizationWithResponse(ctx context.Context, id string) (*sdk.DeleteOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOrganizationWithResponse", ctx, id) + ret0, _ := ret[0].(*sdk.DeleteOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOrganizationWithResponse indicates an expected call of DeleteOrganizationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeleteOrganizationWithResponse(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrganizationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeleteOrganizationWithResponse), ctx, id) +} + // ExternalClusterAPIAddNodeWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) ExternalClusterAPIAddNodeWithBodyWithResponse(ctx context.Context, clusterId, contentType string, body io.Reader) (*sdk.ExternalClusterAPIAddNodeResponse, error) { m.ctrl.T.Helper() @@ -2118,6 +2863,186 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetExternalClusterOperat return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExternalClusterOperationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetExternalClusterOperationWithResponse), ctx, id) } +// GetOrganizationUsersWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetOrganizationUsersWithResponse(ctx context.Context, id string) (*sdk.GetOrganizationUsersResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOrganizationUsersWithResponse", ctx, id) + ret0, _ := ret[0].(*sdk.GetOrganizationUsersResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOrganizationUsersWithResponse indicates an expected call of GetOrganizationUsersWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetOrganizationUsersWithResponse(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrganizationUsersWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetOrganizationUsersWithResponse), ctx, id) +} + +// GetOrganizationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetOrganizationWithResponse(ctx context.Context, id string) (*sdk.GetOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOrganizationWithResponse", ctx, id) + ret0, _ := ret[0].(*sdk.GetOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOrganizationWithResponse indicates an expected call of GetOrganizationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetOrganizationWithResponse(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrganizationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetOrganizationWithResponse), ctx, id) +} + +// InventoryAPIAddReservationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIAddReservationWithBodyWithResponse(ctx context.Context, organizationId, contentType string, body io.Reader) (*sdk.InventoryAPIAddReservationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIAddReservationWithBodyWithResponse", ctx, organizationId, contentType, body) + ret0, _ := ret[0].(*sdk.InventoryAPIAddReservationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIAddReservationWithBodyWithResponse indicates an expected call of InventoryAPIAddReservationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIAddReservationWithBodyWithResponse(ctx, organizationId, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIAddReservationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIAddReservationWithBodyWithResponse), ctx, organizationId, contentType, body) +} + +// InventoryAPIAddReservationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIAddReservationWithResponse(ctx context.Context, organizationId string, body sdk.InventoryAPIAddReservationJSONRequestBody) (*sdk.InventoryAPIAddReservationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIAddReservationWithResponse", ctx, organizationId, body) + ret0, _ := ret[0].(*sdk.InventoryAPIAddReservationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIAddReservationWithResponse indicates an expected call of InventoryAPIAddReservationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIAddReservationWithResponse(ctx, organizationId, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIAddReservationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIAddReservationWithResponse), ctx, organizationId, body) +} + +// InventoryAPIDeleteReservationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIDeleteReservationWithResponse(ctx context.Context, organizationId, reservationId string) (*sdk.InventoryAPIDeleteReservationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIDeleteReservationWithResponse", ctx, organizationId, reservationId) + ret0, _ := ret[0].(*sdk.InventoryAPIDeleteReservationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIDeleteReservationWithResponse indicates an expected call of InventoryAPIDeleteReservationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIDeleteReservationWithResponse(ctx, organizationId, reservationId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIDeleteReservationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIDeleteReservationWithResponse), ctx, organizationId, reservationId) +} + +// InventoryAPIGetReservationsBalanceWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIGetReservationsBalanceWithResponse(ctx context.Context, organizationId string) (*sdk.InventoryAPIGetReservationsBalanceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIGetReservationsBalanceWithResponse", ctx, organizationId) + ret0, _ := ret[0].(*sdk.InventoryAPIGetReservationsBalanceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetReservationsBalanceWithResponse indicates an expected call of InventoryAPIGetReservationsBalanceWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIGetReservationsBalanceWithResponse(ctx, organizationId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetReservationsBalanceWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIGetReservationsBalanceWithResponse), ctx, organizationId) +} + +// InventoryAPIGetReservationsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIGetReservationsWithResponse(ctx context.Context, organizationId string) (*sdk.InventoryAPIGetReservationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIGetReservationsWithResponse", ctx, organizationId) + ret0, _ := ret[0].(*sdk.InventoryAPIGetReservationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetReservationsWithResponse indicates an expected call of InventoryAPIGetReservationsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIGetReservationsWithResponse(ctx, organizationId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetReservationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIGetReservationsWithResponse), ctx, organizationId) +} + +// InventoryAPIGetResourceUsageWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIGetResourceUsageWithResponse(ctx context.Context, organizationId string) (*sdk.InventoryAPIGetResourceUsageResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIGetResourceUsageWithResponse", ctx, organizationId) + ret0, _ := ret[0].(*sdk.InventoryAPIGetResourceUsageResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIGetResourceUsageWithResponse indicates an expected call of InventoryAPIGetResourceUsageWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIGetResourceUsageWithResponse(ctx, organizationId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIGetResourceUsageWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIGetResourceUsageWithResponse), ctx, organizationId) +} + +// InventoryAPIOverwriteReservationsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIOverwriteReservationsWithBodyWithResponse(ctx context.Context, organizationId, contentType string, body io.Reader) (*sdk.InventoryAPIOverwriteReservationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIOverwriteReservationsWithBodyWithResponse", ctx, organizationId, contentType, body) + ret0, _ := ret[0].(*sdk.InventoryAPIOverwriteReservationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIOverwriteReservationsWithBodyWithResponse indicates an expected call of InventoryAPIOverwriteReservationsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIOverwriteReservationsWithBodyWithResponse(ctx, organizationId, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIOverwriteReservationsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIOverwriteReservationsWithBodyWithResponse), ctx, organizationId, contentType, body) +} + +// InventoryAPIOverwriteReservationsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPIOverwriteReservationsWithResponse(ctx context.Context, organizationId string, body sdk.InventoryAPIOverwriteReservationsJSONRequestBody) (*sdk.InventoryAPIOverwriteReservationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPIOverwriteReservationsWithResponse", ctx, organizationId, body) + ret0, _ := ret[0].(*sdk.InventoryAPIOverwriteReservationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPIOverwriteReservationsWithResponse indicates an expected call of InventoryAPIOverwriteReservationsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPIOverwriteReservationsWithResponse(ctx, organizationId, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPIOverwriteReservationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPIOverwriteReservationsWithResponse), ctx, organizationId, body) +} + +// InventoryAPISyncClusterResourcesWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) InventoryAPISyncClusterResourcesWithResponse(ctx context.Context, organizationId, clusterId string) (*sdk.InventoryAPISyncClusterResourcesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InventoryAPISyncClusterResourcesWithResponse", ctx, organizationId, clusterId) + ret0, _ := ret[0].(*sdk.InventoryAPISyncClusterResourcesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// InventoryAPISyncClusterResourcesWithResponse indicates an expected call of InventoryAPISyncClusterResourcesWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) InventoryAPISyncClusterResourcesWithResponse(ctx, organizationId, clusterId interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InventoryAPISyncClusterResourcesWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).InventoryAPISyncClusterResourcesWithResponse), ctx, organizationId, clusterId) +} + +// ListOrganizationsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ListOrganizationsWithResponse(ctx context.Context) (*sdk.ListOrganizationsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListOrganizationsWithResponse", ctx) + ret0, _ := ret[0].(*sdk.ListOrganizationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListOrganizationsWithResponse indicates an expected call of ListOrganizationsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ListOrganizationsWithResponse(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOrganizationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListOrganizationsWithResponse), ctx) +} + // NodeConfigurationAPICreateConfigurationWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) NodeConfigurationAPICreateConfigurationWithBodyWithResponse(ctx context.Context, clusterId, contentType string, body io.Reader) (*sdk.NodeConfigurationAPICreateConfigurationResponse, error) { m.ctrl.T.Helper() @@ -2688,6 +3613,96 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ScheduledRebalancingAPIU return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ScheduledRebalancingAPIUpdateRebalancingScheduleWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ScheduledRebalancingAPIUpdateRebalancingScheduleWithResponse), ctx, params, body) } +// UpdateCurrentUserProfileWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateCurrentUserProfileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*sdk.UpdateCurrentUserProfileResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCurrentUserProfileWithBodyWithResponse", ctx, contentType, body) + ret0, _ := ret[0].(*sdk.UpdateCurrentUserProfileResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCurrentUserProfileWithBodyWithResponse indicates an expected call of UpdateCurrentUserProfileWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateCurrentUserProfileWithBodyWithResponse(ctx, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCurrentUserProfileWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateCurrentUserProfileWithBodyWithResponse), ctx, contentType, body) +} + +// UpdateCurrentUserProfileWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateCurrentUserProfileWithResponse(ctx context.Context, body sdk.UpdateCurrentUserProfileJSONRequestBody) (*sdk.UpdateCurrentUserProfileResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCurrentUserProfileWithResponse", ctx, body) + ret0, _ := ret[0].(*sdk.UpdateCurrentUserProfileResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCurrentUserProfileWithResponse indicates an expected call of UpdateCurrentUserProfileWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateCurrentUserProfileWithResponse(ctx, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCurrentUserProfileWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateCurrentUserProfileWithResponse), ctx, body) +} + +// UpdateOrganizationUserWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateOrganizationUserWithBodyWithResponse(ctx context.Context, id, userId, contentType string, body io.Reader) (*sdk.UpdateOrganizationUserResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOrganizationUserWithBodyWithResponse", ctx, id, userId, contentType, body) + ret0, _ := ret[0].(*sdk.UpdateOrganizationUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateOrganizationUserWithBodyWithResponse indicates an expected call of UpdateOrganizationUserWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateOrganizationUserWithBodyWithResponse(ctx, id, userId, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationUserWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateOrganizationUserWithBodyWithResponse), ctx, id, userId, contentType, body) +} + +// UpdateOrganizationUserWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateOrganizationUserWithResponse(ctx context.Context, id, userId string, body sdk.UpdateOrganizationUserJSONRequestBody) (*sdk.UpdateOrganizationUserResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOrganizationUserWithResponse", ctx, id, userId, body) + ret0, _ := ret[0].(*sdk.UpdateOrganizationUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateOrganizationUserWithResponse indicates an expected call of UpdateOrganizationUserWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateOrganizationUserWithResponse(ctx, id, userId, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationUserWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateOrganizationUserWithResponse), ctx, id, userId, body) +} + +// UpdateOrganizationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateOrganizationWithBodyWithResponse(ctx context.Context, id, contentType string, body io.Reader) (*sdk.UpdateOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOrganizationWithBodyWithResponse", ctx, id, contentType, body) + ret0, _ := ret[0].(*sdk.UpdateOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateOrganizationWithBodyWithResponse indicates an expected call of UpdateOrganizationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateOrganizationWithBodyWithResponse(ctx, id, contentType, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateOrganizationWithBodyWithResponse), ctx, id, contentType, body) +} + +// UpdateOrganizationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateOrganizationWithResponse(ctx context.Context, id string, body sdk.UpdateOrganizationJSONRequestBody) (*sdk.UpdateOrganizationResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateOrganizationWithResponse", ctx, id, body) + ret0, _ := ret[0].(*sdk.UpdateOrganizationResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateOrganizationWithResponse indicates an expected call of UpdateOrganizationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateOrganizationWithResponse(ctx, id, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOrganizationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateOrganizationWithResponse), ctx, id, body) +} + // MockResponse is a mock of Response interface. type MockResponse struct { ctrl *gomock.Controller diff --git a/docs/resources/reservations.md b/docs/resources/reservations.md new file mode 100644 index 00000000..215d7645 --- /dev/null +++ b/docs/resources/reservations.md @@ -0,0 +1,103 @@ +--- +page_title: "castai_reservations Resource - terraform-provider-castai" +subcategory: "" +description: |- + Reservation represents cloud service provider reserved instances that can be used by CAST AI autoscaler. +--- + +# castai_reservations (Resource) + +Reservation represents cloud service provider reserved instances that can be used by CAST AI autoscaler. + +## Example Usage + +```terraform +resource "castai_reservations" "test" { + reservations_csv = file("./reservations.csv") +} +``` + +## Reservations CSV structure + +The file should be made up of reservation entries with comma separated values with the first row being column headers. + +- `count` (String) - amount of reserved instances +- `end_date` (String) - end date of reservation +- `instance_type` (String) - reserved instance type +- `name` (String) - unique reservation name in region for specific instance type +- `price` (String) - reservation price +- `provider` (String) - reservation cloud provider (gcp, aws, azure) +- `region` (String) - reservation region +- `start_date` (String) - start date of reservation +- `zone_id` (String) - reservation zone id +- `zone_name` (String) - reservation zone name + +Example CSV file: + +```csv +name,provider,region,instance_type,price,count,start_date,end_date,zone_id,zone_name +reservation1,aws,us-east-1,c5n.large,,1,2020-01-01T00:00:00Z,2050-01-01T00:00:00Z,, +reservation2,aws,us-east-1,c5n.large,,2,2020-01-01T00:00:00Z,2050-01-01T00:00:01Z,, +``` + +### Azure exported reservations + +Reservations exported from Azure in CSV format are also accepted. Example of such CSV file: + +```csv +Name,Reservation Id,Reservation order Id,Status,Expiration date,Purchase date,Term,Scope,Scope subscription,Scope resource group,Type,Product name,Region,Quantity,Utilization % 1 Day,Utilization % 7 Day,Utilization % 30 Day,Deep link to reservation +VM_RI_01-01-2023_01-01,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:00Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,3,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/883afd52-54c8-4bc6-a0f2-ccbaf7b84bda/overview +VM_RI_01-01-2023_01-02,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:01Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,2,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/25b95bdb-b78b-4973-a60c-71e70f158eca/overview +VM_RI_01-01-2023_01-03,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:02Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,1,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/1745741b-f3c6-46a9-ad16-b93775a1bc38/overview +``` + + +## Schema + +### Required + +- `reservations_csv` (String) csv file containing reservations + +### Optional + +- `organization_id` (String) organization +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `reservations` (List of Object) (see [below for nested schema](#nestedatt--reservations)) + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `update` (String) + + + +### Nested Schema for `reservations` + +Read-Only: + +- `count` (String) +- `end_date` (String) +- `instance_type` (String) +- `name` (String) +- `price` (String) +- `provider` (String) +- `region` (String) +- `start_date` (String) +- `zone_id` (String) +- `zone_name` (String) + +## Import + +Import is supported using the following syntax: + +```shell +# Import reservations of an organization. +terraform import 'castai_reservations.test' 5b046e29-e947-470f-9952-bfdf369ecca6 +``` \ No newline at end of file diff --git a/examples/gke/gke_cluster_autoscaler_policies/README.MD b/examples/gke/gke_cluster_autoscaler_policies/README.MD index 4a3feb3a..11a11809 100644 --- a/examples/gke/gke_cluster_autoscaler_policies/README.MD +++ b/examples/gke/gke_cluster_autoscaler_policies/README.MD @@ -6,7 +6,7 @@ IAM policies required to connect the cluster to CAST AI in the example are creat Example configuration should be analysed in the following order: 1. Create VPC - `vpc.tf` -2. Create GKE cluster - `eks.tf` +2. Create GKE cluster - `gke.tf` 3. Create IAM and other CAST AI related resources to connect GKE cluster to CAST AI, configure Autoscaler and Node Configurations - `castai.tf` # Usage diff --git a/examples/resources/castai_reservations/import.sh b/examples/resources/castai_reservations/import.sh new file mode 100644 index 00000000..a2de91db --- /dev/null +++ b/examples/resources/castai_reservations/import.sh @@ -0,0 +1,2 @@ +# Import reservations of an organization. +terraform import 'castai_reservations.test' 5b046e29-e947-470f-9952-bfdf369ecca6 diff --git a/examples/resources/castai_reservations/reservations.csv b/examples/resources/castai_reservations/reservations.csv new file mode 100644 index 00000000..d9dab717 --- /dev/null +++ b/examples/resources/castai_reservations/reservations.csv @@ -0,0 +1,4 @@ +name,provider,region,instance_type,price,count,start_date,end_date,zone_id,zone_name +reservation1,aws,us-east-1,c5n.large,,3,2020-01-01T00:00:00Z,2050-01-01T00:00:00Z,, +reservation2,aws,us-east-1,c5n.large,,2,2020-01-01T00:00:00Z,2050-01-01T00:00:00Z,, +reservation3,aws,us-east-1,c5n.large,,1,2020-01-01T00:00:00Z,2050-01-01T00:00:00Z,, \ No newline at end of file diff --git a/examples/resources/castai_reservations/resource.tf b/examples/resources/castai_reservations/resource.tf new file mode 100644 index 00000000..d867fc7e --- /dev/null +++ b/examples/resources/castai_reservations/resource.tf @@ -0,0 +1,3 @@ +resource "castai_reservations" "test" { + reservations_csv = file("./reservations.csv") +} \ No newline at end of file diff --git a/templates/resources/reservations.md.tmpl b/templates/resources/reservations.md.tmpl new file mode 100644 index 00000000..85e1d7f8 --- /dev/null +++ b/templates/resources/reservations.md.tmpl @@ -0,0 +1,60 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +{{ if .HasExample -}} +## Example Usage + +{{tffile .ExampleFile}} +{{- end }} + +## Reservations CSV structure + +The file should be made up of reservation entries with comma separated values with the first row being column headers. + +- `count` (String) - amount of reserved instances +- `end_date` (String) - end date of reservation +- `instance_type` (String) - reserved instance type +- `name` (String) - unique reservation name in region for specific instance type +- `price` (String) - reservation price +- `provider` (String) - reservation cloud provider (gcp, aws, azure) +- `region` (String) - reservation region +- `start_date` (String) - start date of reservation +- `zone_id` (String) - reservation zone id +- `zone_name` (String) - reservation zone name + +Example CSV file: + +```csv +name,provider,region,instance_type,price,count,start_date,end_date,zone_id,zone_name +reservation1,aws,us-east-1,c5n.large,,1,2020-01-01T00:00:00Z,2050-01-01T00:00:00Z,, +reservation2,aws,us-east-1,c5n.large,,2,2020-01-01T00:00:00Z,2050-01-01T00:00:01Z,, +``` + +### Azure exported reservations + +Reservations exported from Azure in CSV format are also accepted. Example of such CSV file: + +```csv +Name,Reservation Id,Reservation order Id,Status,Expiration date,Purchase date,Term,Scope,Scope subscription,Scope resource group,Type,Product name,Region,Quantity,Utilization % 1 Day,Utilization % 7 Day,Utilization % 30 Day,Deep link to reservation +VM_RI_01-01-2023_01-01,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:00Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,3,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/883afd52-54c8-4bc6-a0f2-ccbaf7b84bda/overview +VM_RI_01-01-2023_01-02,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:01Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,2,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/25b95bdb-b78b-4973-a60c-71e70f158eca/overview +VM_RI_01-01-2023_01-03,3b3de39c-bc44-4d69-be2d-69527dfe9958,630226bb-5170-4b95-90b0-f222757130c1,Succeeded,2050-01-01T00:00:00Z,2023-01-11T00:00:02Z,P3Y,Single subscription,8faa0959-093b-4612-8686-a996ac19db00,All resource groups,VirtualMachines,Standard_D32as_v4,eastus,1,100,100,100,https://portal.azure.com#resource/providers/microsoft.capacity/reservationOrders/59791a62-264b-4b9f-aa3a-5eeb761e4583/reservations/1745741b-f3c6-46a9-ad16-b93775a1bc38/overview +``` + +{{ .SchemaMarkdown | trimspace }} + +{{ if .HasImport -}} +## Import + +Import is supported using the following syntax: + +{{codefile "shell" .ImportFile}} +{{- end }} \ No newline at end of file From 1dfdf5a56c204048b3066f2a07a5035f1579ec62 Mon Sep 17 00:00:00 2001 From: Jan Sykora Date: Wed, 9 Aug 2023 13:57:55 +0200 Subject: [PATCH 9/9] feat: Adopt default node template concept (#209) --- README.md | 118 ++++++++++++++++ castai/resource_autoscaler.go | 44 +++++- castai/resource_autoscaler_test.go | 127 ++++++++++++++++++ castai/resource_node_template.go | 38 +++++- castai/resource_node_template_test.go | 71 +++++++++- .../aks_cluster_autoscaler_policies/castai.tf | 25 ++-- .../eks_cluster_autoscaler_policies/castai.tf | 32 +++-- .../gke_cluster_autoscaler_policies/castai.tf | 25 ++-- 8 files changed, 439 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 9c59194c..8f49d4dc 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,124 @@ and usage `castai_eks_cluster.this.cluster_token` * default value for `imds_v1` was change to `true`, in case that your configuration didn't had this specified please explicitly set this value to `false` +Migrating from 4.x.x to 5.x.x +--------------------------- + +Version 5.x.x changed: +* Terraform provider adopts [default node template concept](https://docs.cast.ai/docs/default-node-template) +* Removed `spotInstances` field from `autoscaler_policies_json` attribute in `castai_autoscaler_policies` resource +* Removed `customInstancesEnabled` field from `autoscaler_policies_json` attribute in `castai_autoscaler_policies` resource +* Removed `nodeConstraints` field from `autoscaler_policies_json` attribute in `castai_autoscaler_policies` resource +* All valid fields which were removed from `autoscaler_policies_json` have mapping in `castai_node_template` [resource](https://registry.terraform.io/providers/CastAI/castai/latest/docs/resources/node_template) + +Old configuration: +```terraform +resource "castai_autoscaler" "castai_autoscaler_policies" { + cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference + + autoscaler_policies_json = <<-EOT + { + "enabled": true, + "unschedulablePods": { + "enabled": true, + "customInstancesEnabled": true, + "nodeConstraints": { + "enabled": true, + "minCpuCores": 2, + "maxCpuCores": 4, + "minRamMib": 3814, + "maxRamMib": 16384 + } + }, + "spotInstances": { + "enabled": true, + "clouds": ["gcp"], + "spotBackups": { + "enabled": true + } + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + } + EOT +} +``` + +New configuration: +```terraform +resource "castai_autoscaler" "castai_autoscaler_policies" { + cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference + + autoscaler_policies_json = <<-EOT + { + "enabled": true, + "unschedulablePods": { + "enabled": true + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + } + EOT +} + +resource "castai_node_template" "default_by_castai" { + cluster_id = data.castai_eks_clusterid.cluster_id.id // or other reference + + name = "default-by-castai" + configuration_id = castai_node_configuration.default.id // or other reference + is_default = true + should_taint = false + custom_instances_enabled = true + + constraints { + architectures = [ + "amd64", + "arm64", + ] + on_demand = true + spot = true + use_spot_fallbacks = true + min_cpu = 2 + max_cpu = 4 + min_memory = 3814 + max_memory = 16384 + } + + depends_on = [ castai_autoscaler.castai_autoscaler_policies ] +} +``` + +If you have used `castai-eks-cluster` or other modules follow: +https://github.com/castai/terraform-castai-eks-cluster/blob/main/README.md#migrating-from-5xx-to-6xx + +Note: `default-by-castai` default node template is created in background by CAST.ai, when creating managed resource +in Terraform the provider will handle create as update. Alternatively you can perform Terraform state import and +everything will work correctly. + Developing the provider --------------------------- diff --git a/castai/resource_autoscaler.go b/castai/resource_autoscaler.go index 53f45bdf..5cca3a88 100644 --- a/castai/resource_autoscaler.go +++ b/castai/resource_autoscaler.go @@ -44,9 +44,10 @@ func resourceAutoscaler() *schema.Resource { Description: "CAST AI cluster id", }, FieldAutoscalerPoliciesJSON: { - Type: schema.TypeString, - Description: "autoscaler policies JSON string to override current autoscaler settings", - Optional: true, + Type: schema.TypeString, + Description: "autoscaler policies JSON string to override current autoscaler settings", + Optional: true, + ValidateDiagFunc: validateAutoscalerPolicyJSON(), }, FieldAutoscalerPolicies: { Type: schema.TypeString, @@ -229,3 +230,40 @@ func getClusterId(data *schema.ResourceData) string { return value.(string) } + +func validateAutoscalerPolicyJSON() schema.SchemaValidateDiagFunc { + return validation.ToDiagFunc(func(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + policyMap := make(map[string]interface{}) + err := json.Unmarshal([]byte(v), &policyMap) + if err != nil { + return nil, []error{fmt.Errorf("failed to deserialize JSON: %v", err)} + } + errors := make([]error, 0) + if _, found := policyMap["spotInstances"]; found { + errors = append(errors, createValidationError("spotInstances", v)) + } + if unschedulablePods, found := policyMap["unschedulablePods"]; found { + if unschedulablePodsMap, ok := unschedulablePods.(map[string]interface{}); ok { + if _, found := unschedulablePodsMap["customInstancesEnabled"]; found { + errors = append(errors, createValidationError("customInstancesEnabled", v)) + } + if _, found := unschedulablePodsMap["nodeConstraints"]; found { + errors = append(errors, createValidationError("nodeConstraints", v)) + } + } + } + + return nil, errors + }) +} + +func createValidationError(field, value string) error { + return fmt.Errorf("'%s' field was removed from policies JSON in 5.0.0. "+ + "The configuration was migrated to default node template.\n\n"+ + "See: https://github.com/castai/terraform-provider-castai#migrating-from-4xx-to-5xx\n\n"+ + "Policy:\n%v", field, value) +} diff --git a/castai/resource_autoscaler_test.go b/castai/resource_autoscaler_test.go index c793d8a1..0f70b726 100644 --- a/castai/resource_autoscaler_test.go +++ b/castai/resource_autoscaler_test.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "reflect" + "strings" "testing" "github.com/golang/mock/gomock" @@ -318,3 +319,129 @@ func JSONBytesEqual(a, b []byte) (bool, error) { } return reflect.DeepEqual(j2, j), nil } + +func Test_validateAutoscalerPolicyJSON(t *testing.T) { + type testData struct { + json string + valid bool + expectedMessage string + } + tests := map[string]testData{ + "should return no diagnostic error for valid autoscaler policies JSON": { + json: ` { + "enabled": true, + "unschedulablePods": { + "enabled": true + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + }`, + valid: true, + }, + "should return diagnostic error if spot instances block is present in JSON": { + json: ` { + "enabled": true, + "unschedulablePods": { + "enabled": true + }, + "spotInstances": { + "enabled": true, + "clouds": ["gcp"], + "spotBackups": { + "enabled": true + } + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + }`, + valid: false, + expectedMessage: "'spotInstances' field was removed from policies JSON in 5.0.0. The configuration was migrated to default node template.", + }, + "should return diagnostic error if custom instance enabled attribute is present in JSON": { + json: ` { + "enabled": true, + "unschedulablePods": { + "enabled": true, + "customInstancesEnabled": true + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + }`, + valid: false, + expectedMessage: "'customInstancesEnabled' field was removed from policies JSON in 5.0.0. The configuration was migrated to default node template.", + }, + + "should return diagnostic error if node constraints attribute is present in JSON": { + json: ` { + "enabled": true, + "unschedulablePods": { + "enabled": true, + "nodeConstraints": {} + }, + "nodeDownscaler": { + "enabled": true, + "emptyNodes": { + "enabled": true + }, + "evictor": { + "aggressiveMode": true, + "cycleInterval": "5m10s", + "dryRun": false, + "enabled": true, + "nodeGracePeriodMinutes": 10, + "scopedMode": false + } + } + }`, + valid: false, + expectedMessage: "'nodeConstraints' field was removed from policies JSON in 5.0.0. The configuration was migrated to default node template.", + }, + } + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + result := validateAutoscalerPolicyJSON()(tt.json, []cty.PathStep{cty.PathStep(nil)}) + require.Equal(t, tt.valid, !result.HasError()) + if !tt.valid { + for _, d := range result { + require.True(t, strings.Contains(d.Summary, tt.expectedMessage)) + } + } + }) + } +} diff --git a/castai/resource_node_template.go b/castai/resource_node_template.go index 4f3dc980..a107964d 100644 --- a/castai/resource_node_template.go +++ b/castai/resource_node_template.go @@ -6,6 +6,7 @@ import ( "github.com/castai/terraform-provider-castai/castai/sdk" "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/samber/lo" @@ -566,7 +567,11 @@ func resourceNodeTemplateDelete(ctx context.Context, d *schema.ResourceData, met } func resourceNodeTemplateUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { - if !d.HasChanges( + return updateNodeTemplate(ctx, d, meta, false) +} + +func updateNodeTemplate(ctx context.Context, d *schema.ResourceData, meta any, skipChangeCheck bool) diag.Diagnostics { + if !skipChangeCheck && !d.HasChanges( FieldNodeTemplateName, FieldNodeTemplateShouldTaint, FieldNodeTemplateConfigurationId, @@ -578,7 +583,7 @@ func resourceNodeTemplateUpdate(ctx context.Context, d *schema.ResourceData, met FieldNodeTemplateConstraints, FieldNodeTemplateIsEnabled, ) { - log.Printf("[INFO] Nothing to update in node configuration") + log.Printf("[INFO] Nothing to update in node template") return nil } @@ -659,6 +664,12 @@ func resourceNodeTemplateCreate(ctx context.Context, d *schema.ResourceData, met defer log.Printf("[INFO] Create Node Template post call end") client := meta.(*ProviderConfig).api clusterID := d.Get(FieldClusterID).(string) + + // default node template is created by default in the background, therefore we need to use PUT instead of POST + if d.Get(FieldNodeTemplateIsDefault).(bool) { + return updateDefaultNodeTemplate(ctx, d, meta) + } + req := sdk.NodeTemplatesAPICreateNodeTemplateJSONRequestBody{ Name: lo.ToPtr(d.Get(FieldNodeTemplateName).(string)), IsDefault: lo.ToPtr(d.Get(FieldNodeTemplateIsDefault).(bool)), @@ -723,6 +734,29 @@ func resourceNodeTemplateCreate(ctx context.Context, d *schema.ResourceData, met return resourceNodeTemplateRead(ctx, d, meta) } +func updateDefaultNodeTemplate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { + d.SetId(d.Get(FieldNodeTemplateName).(string)) + // make timeout 5 seconds less than the creation timeout + timeout := d.Timeout(schema.TimeoutCreate) - 5*time.Second + // handle situation when default node template is not created yet by autoscaler policy + if err := retry.RetryContext(ctx, timeout, func() *retry.RetryError { + diagnostics := updateNodeTemplate(ctx, d, meta, true) + + for _, d := range diagnostics { + if d.Severity == diag.Error { + if strings.Contains(d.Summary, "node template not found") { + return retry.RetryableError(fmt.Errorf(d.Summary)) + } + return retry.NonRetryableError(fmt.Errorf(d.Summary)) + } + } + return nil + }); err != nil { + return diag.FromErr(err) + } + return nil +} + func getNodeTemplateByName(ctx context.Context, data *schema.ResourceData, meta any, clusterID string) (*sdk.NodetemplatesV1NodeTemplate, error) { client := meta.(*ProviderConfig).api nodeTemplateName := data.Id() diff --git a/castai/resource_node_template_test.go b/castai/resource_node_template_test.go index 6d931359..5c1593ae 100644 --- a/castai/resource_node_template_test.go +++ b/castai/resource_node_template_test.go @@ -214,6 +214,73 @@ func TestNodeTemplateResourceReadContextEmptyList(t *testing.T) { r.Equal(result[0].Summary, "failed to find node template with name: gpu") } +func TestNodeTemplateResourceCreate_defaultNodeTemplate(t *testing.T) { + r := require.New(t) + mockctrl := gomock.NewController(t) + mockClient := mock_sdk.NewMockClientInterface(mockctrl) + + ctx := context.Background() + provider := &ProviderConfig{ + api: &sdk.ClientWithResponses{ + ClientInterface: mockClient, + }, + } + + clusterId := "b6bfc074-a267-400f-b8f1-db0850c369b1" + body := io.NopCloser(bytes.NewReader([]byte(` + { + "items": [ + { + "template": { + "configurationId": "7dc4f922-29c9-4377-889c-0c8c5fb8d497", + "configurationName": "default", + "name": "default-by-castai", + "isEnabled": true, + "isDefault": true, + "constraints": { + "spot": false, + "onDemand": true, + "minCpu": 10, + "maxCpu": 10000, + "architectures": ["amd64", "arm64"] + }, + "version": "3", + "shouldTaint": true, + "customLabels": {}, + "customTaints": [], + "rebalancingConfig": { + "minNodes": 0 + }, + "customInstancesEnabled": true + } + } + ] + } + `))) + mockClient.EXPECT(). + NodeTemplatesAPIListNodeTemplates(gomock.Any(), clusterId, &sdk.NodeTemplatesAPIListNodeTemplatesParams{IncludeDefault: lo.ToPtr(true)}). + Return(&http.Response{StatusCode: 200, Body: body, Header: map[string][]string{"Content-Type": {"json"}}}, nil) + + mockClient.EXPECT(). + NodeTemplatesAPIUpdateNodeTemplate(gomock.Any(), clusterId, "default-by-castai", gomock.Any()). + Return(&http.Response{StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte{}))}, nil) + + resource := resourceNodeTemplate() + val := cty.ObjectVal(map[string]cty.Value{ + FieldClusterId: cty.StringVal(clusterId), + FieldNodeTemplateName: cty.StringVal("default-by-castai"), + FieldNodeTemplateIsDefault: cty.BoolVal(true), + FieldNodeTemplateCustomInstancesEnabled: cty.BoolVal(true), + }) + state := terraform.NewInstanceStateShimmedFromValue(val, 0) + state.ID = "default-by-castai" + + data := resource.Data(state) + result := resource.CreateContext(ctx, data, provider) + r.Nil(result) + r.False(result.HasError()) +} + func TestNodeTemplateResourceDelete_defaultNodeTemplate(t *testing.T) { r := require.New(t) mockctrl := gomock.NewController(t) @@ -479,7 +546,7 @@ func testAccCheckNodeTemplateDestroy(s *terraform.State) error { id := rs.Primary.ID clusterID := rs.Primary.Attributes["cluster_id"] - response, err := client.NodeTemplatesAPIListNodeTemplatesWithResponse(ctx, clusterID, &sdk.NodeTemplatesAPIListNodeTemplatesParams{IncludeDefault: lo.ToPtr(true)}) + response, err := client.NodeTemplatesAPIListNodeTemplatesWithResponse(ctx, clusterID, &sdk.NodeTemplatesAPIListNodeTemplatesParams{IncludeDefault: lo.ToPtr(false)}) if err != nil { return err } @@ -491,7 +558,7 @@ func testAccCheckNodeTemplateDestroy(s *terraform.State) error { return nil } - return fmt.Errorf("node template %q still exists", id) + return fmt.Errorf("node template %q still exists; %v", id, response) } return nil diff --git a/examples/aks/aks_cluster_autoscaler_policies/castai.tf b/examples/aks/aks_cluster_autoscaler_policies/castai.tf index 56f1f837..29854685 100644 --- a/examples/aks/aks_cluster_autoscaler_policies/castai.tf +++ b/examples/aks/aks_cluster_autoscaler_policies/castai.tf @@ -53,6 +53,21 @@ module "castai-aks-cluster" { } node_templates = { + default_by_castai = { + name = "default-by-castai" + configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] + is_default = true + should_taint = false + + constraints = { + on_demand = true + spot = true + use_spot_fallbacks = true + + enable_spot_diversity = false + spot_diversity_price_increase_limit_percent = 20 + } + } spot_tmpl = { configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] should_taint = true @@ -91,7 +106,6 @@ module "castai-aks-cluster" { // Configure Autoscaler policies as per API specification https://api.cast.ai/v1/spec/#/PoliciesAPI/PoliciesAPIUpsertClusterPolicies. // Here: // - unschedulablePods - Unscheduled pods policy - // - spotInstances - Spot instances configuration // - nodeDownscaler - Node deletion policy autoscaler_policies_json = <<-EOT { @@ -99,15 +113,6 @@ module "castai-aks-cluster" { "unschedulablePods": { "enabled": true }, - "spotInstances": { - "enabled": true, - "clouds": ["azure"], - "spotBackups": { - "enabled": true - }, - "spotDiversityEnabled": false, - "spotDiversityPriceIncreaseLimitPercent": 20 - }, "nodeDownscaler": { "enabled": true, "emptyNodes": { diff --git a/examples/eks/eks_cluster_autoscaler_policies/castai.tf b/examples/eks/eks_cluster_autoscaler_policies/castai.tf index eb39ee07..7a2fb4be 100644 --- a/examples/eks/eks_cluster_autoscaler_policies/castai.tf +++ b/examples/eks/eks_cluster_autoscaler_policies/castai.tf @@ -101,6 +101,24 @@ module "castai-eks-cluster" { } node_templates = { + default_by_castai = { + name = "default-by-castai" + configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] + is_default = true + should_taint = false + + constraints = { + on_demand = true + spot = true + use_spot_fallbacks = true + + enable_spot_diversity = false + spot_diversity_price_increase_limit_percent = 20 + + spot_interruption_predictions_enabled = true + spot_interruption_predictions_type = "aws-rebalance-recommendations" + } + } spot_tmpl = { configuration_id = module.castai-eks-cluster.castai_node_configurations["default"] should_taint = true @@ -140,7 +158,6 @@ module "castai-eks-cluster" { # Configure Autoscaler policies as per API specification https://api.cast.ai/v1/spec/#/PoliciesAPI/PoliciesAPIUpsertClusterPolicies. # Here: # - unschedulablePods - Unscheduled pods policy - # - spotInstances - Spot instances configuration # - nodeDownscaler - Node deletion policy autoscaler_policies_json = <<-EOT { @@ -148,19 +165,6 @@ module "castai-eks-cluster" { "unschedulablePods": { "enabled": true }, - "spotInstances": { - "enabled": true, - "clouds": ["aws"], - "spotBackups": { - "enabled": true - }, - "spotDiversityEnabled": false, - "spotDiversityPriceIncreaseLimitPercent": 20, - "spotInterruptionPredictions": { - "enabled": true, - "type": "AWSRebalanceRecommendations" - } - }, "nodeDownscaler": { "enabled": true, "emptyNodes": { diff --git a/examples/gke/gke_cluster_autoscaler_policies/castai.tf b/examples/gke/gke_cluster_autoscaler_policies/castai.tf index 17fdcc79..3ffe65b6 100644 --- a/examples/gke/gke_cluster_autoscaler_policies/castai.tf +++ b/examples/gke/gke_cluster_autoscaler_policies/castai.tf @@ -60,6 +60,21 @@ module "castai-gke-cluster" { } node_templates = { + default_by_castai = { + name = "default-by-castai" + configuration_id = module.castai-aks-cluster.castai_node_configurations["default"] + is_default = true + should_taint = false + + constraints = { + on_demand = true + spot = true + use_spot_fallbacks = true + + enable_spot_diversity = false + spot_diversity_price_increase_limit_percent = 20 + } + } spot_tmpl = { configuration_id = module.castai-gke-cluster.castai_node_configurations["default"] should_taint = true @@ -100,7 +115,6 @@ module "castai-gke-cluster" { // Configure Autoscaler policies as per API specification https://api.cast.ai/v1/spec/#/PoliciesAPI/PoliciesAPIUpsertClusterPolicies. // Here: // - unschedulablePods - Unscheduled pods policy - // - spotInstances - Spot instances configuration // - nodeDownscaler - Node deletion policy autoscaler_policies_json = <<-EOT { @@ -108,15 +122,6 @@ module "castai-gke-cluster" { "unschedulablePods": { "enabled": true }, - "spotInstances": { - "enabled": true, - "clouds": ["gcp"], - "spotBackups": { - "enabled": true - }, - "spotDiversityEnabled": false, - "spotDiversityPriceIncreaseLimitPercent": 20 - }, "nodeDownscaler": { "enabled": true, "emptyNodes": {