diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/client.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/client.go new file mode 100644 index 00000000000..50e55c95690 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/client.go @@ -0,0 +1,37 @@ +package v2024_01_01 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances" + "github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + ProvisionedClusterInstances *provisionedclusterinstances.ProvisionedClusterInstancesClient + VirtualNetworks *virtualnetworks.VirtualNetworksClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + provisionedClusterInstancesClient, err := provisionedclusterinstances.NewProvisionedClusterInstancesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ProvisionedClusterInstances client: %+v", err) + } + configureFunc(provisionedClusterInstancesClient.Client) + + virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) + } + configureFunc(virtualNetworksClient.Client) + + return &Client{ + ProvisionedClusterInstances: provisionedClusterInstancesClient, + VirtualNetworks: virtualNetworksClient, + }, nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/README.md b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/README.md new file mode 100644 index 00000000000..00e8690996e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/README.md @@ -0,0 +1,374 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances` Documentation + +The `provisionedclusterinstances` SDK allows for interaction with the Azure Resource Manager Service `hybridazurekubernetesservice` (API Version `2024-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances" +``` + + +### Client Initialization + +```go +client := provisionedclusterinstances.NewProvisionedClusterInstancesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.AgentPoolCreateOrUpdate` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopedAgentPoolID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "agentPoolValue") + +payload := provisionedclusterinstances.AgentPool{ + // ... +} + + +if err := client.AgentPoolCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.AgentPoolDelete` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopedAgentPoolID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "agentPoolValue") + +if err := client.AgentPoolDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.AgentPoolGet` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopedAgentPoolID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "agentPoolValue") + +read, err := client.AgentPoolGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.AgentPoolListByProvisionedCluster` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.AgentPoolListByProvisionedCluster(ctx, id)` can be used to do batched pagination +items, err := client.AgentPoolListByProvisionedClusterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.DeleteKubernetesVersions` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.DeleteKubernetesVersionsThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.DeleteVMSkus` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.DeleteVMSkusThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.GetKubernetesVersions` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.GetKubernetesVersions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.GetUpgradeProfile` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.GetUpgradeProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.GetVMSkus` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.GetVMSkus(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.HybridIdentityMetadataDelete` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.HybridIdentityMetadataDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.HybridIdentityMetadataGet` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.HybridIdentityMetadataGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.HybridIdentityMetadataListByCluster` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.HybridIdentityMetadataListByCluster(ctx, id)` can be used to do batched pagination +items, err := client.HybridIdentityMetadataListByClusterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.HybridIdentityMetadataPut` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := provisionedclusterinstances.HybridIdentityMetadata{ + // ... +} + + +read, err := client.HybridIdentityMetadataPut(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.KubernetesVersionsList` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.KubernetesVersionsList(ctx, id)` can be used to do batched pagination +items, err := client.KubernetesVersionsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ListAdminKubeconfig` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.ListAdminKubeconfigThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ListUserKubeconfig` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.ListUserKubeconfigThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ProvisionedClusterInstancesCreateOrUpdate` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := provisionedclusterinstances.ProvisionedCluster{ + // ... +} + + +if err := client.ProvisionedClusterInstancesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ProvisionedClusterInstancesDelete` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.ProvisionedClusterInstancesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ProvisionedClusterInstancesGet` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.ProvisionedClusterInstancesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.ProvisionedClusterInstancesList` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.ProvisionedClusterInstancesList(ctx, id)` can be used to do batched pagination +items, err := client.ProvisionedClusterInstancesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.PutKubernetesVersions` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := provisionedclusterinstances.KubernetesVersionProfile{ + // ... +} + + +if err := client.PutKubernetesVersionsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.PutVMSkus` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := provisionedclusterinstances.VMSkuProfile{ + // ... +} + + +if err := client.PutVMSkusThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ProvisionedClusterInstancesClient.VMSkusList` + +```go +ctx := context.TODO() +id := provisionedclusterinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.VMSkusList(ctx, id)` can be used to do batched pagination +items, err := client.VMSkusListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/client.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/client.go new file mode 100644 index 00000000000..6a00319ff27 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/client.go @@ -0,0 +1,26 @@ +package provisionedclusterinstances + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterInstancesClient struct { + Client *resourcemanager.Client +} + +func NewProvisionedClusterInstancesClientWithBaseURI(sdkApi sdkEnv.Api) (*ProvisionedClusterInstancesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "provisionedclusterinstances", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ProvisionedClusterInstancesClient: %+v", err) + } + + return &ProvisionedClusterInstancesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/constants.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/constants.go new file mode 100644 index 00000000000..a2569641fbf --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/constants.go @@ -0,0 +1,383 @@ +package provisionedclusterinstances + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AddonPhase string + +const ( + AddonPhaseDeleting AddonPhase = "deleting" + AddonPhaseFailed AddonPhase = "failed" + AddonPhasePending AddonPhase = "pending" + AddonPhaseProvisioned AddonPhase = "provisioned" + AddonPhaseProvisioning AddonPhase = "provisioning" + AddonPhaseProvisioningHelmChartInstalled AddonPhase = "provisioning {HelmChartInstalled}" + AddonPhaseProvisioningMSICertificateDownloaded AddonPhase = "provisioning {MSICertificateDownloaded}" + AddonPhaseUpgrading AddonPhase = "upgrading" +) + +func PossibleValuesForAddonPhase() []string { + return []string{ + string(AddonPhaseDeleting), + string(AddonPhaseFailed), + string(AddonPhasePending), + string(AddonPhaseProvisioned), + string(AddonPhaseProvisioning), + string(AddonPhaseProvisioningHelmChartInstalled), + string(AddonPhaseProvisioningMSICertificateDownloaded), + string(AddonPhaseUpgrading), + } +} + +func (s *AddonPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAddonPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAddonPhase(input string) (*AddonPhase, error) { + vals := map[string]AddonPhase{ + "deleting": AddonPhaseDeleting, + "failed": AddonPhaseFailed, + "pending": AddonPhasePending, + "provisioned": AddonPhaseProvisioned, + "provisioning": AddonPhaseProvisioning, + "provisioning {helmchartinstalled}": AddonPhaseProvisioningHelmChartInstalled, + "provisioning {msicertificatedownloaded}": AddonPhaseProvisioningMSICertificateDownloaded, + "upgrading": AddonPhaseUpgrading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AddonPhase(input) + return &out, nil +} + +type AzureHybridBenefit string + +const ( + AzureHybridBenefitFalse AzureHybridBenefit = "False" + AzureHybridBenefitNotApplicable AzureHybridBenefit = "NotApplicable" + AzureHybridBenefitTrue AzureHybridBenefit = "True" +) + +func PossibleValuesForAzureHybridBenefit() []string { + return []string{ + string(AzureHybridBenefitFalse), + string(AzureHybridBenefitNotApplicable), + string(AzureHybridBenefitTrue), + } +} + +func (s *AzureHybridBenefit) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureHybridBenefit(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureHybridBenefit(input string) (*AzureHybridBenefit, error) { + vals := map[string]AzureHybridBenefit{ + "false": AzureHybridBenefitFalse, + "notapplicable": AzureHybridBenefitNotApplicable, + "true": AzureHybridBenefitTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureHybridBenefit(input) + return &out, nil +} + +type Expander string + +const ( + ExpanderLeastNegativewaste Expander = "least-waste" + ExpanderMostNegativepods Expander = "most-pods" + ExpanderPriority Expander = "priority" + ExpanderRandom Expander = "random" +) + +func PossibleValuesForExpander() []string { + return []string{ + string(ExpanderLeastNegativewaste), + string(ExpanderMostNegativepods), + string(ExpanderPriority), + string(ExpanderRandom), + } +} + +func (s *Expander) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpander(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpander(input string) (*Expander, error) { + vals := map[string]Expander{ + "least-waste": ExpanderLeastNegativewaste, + "most-pods": ExpanderMostNegativepods, + "priority": ExpanderPriority, + "random": ExpanderRandom, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Expander(input) + return &out, nil +} + +type ExtendedLocationTypes string + +const ( + ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" +) + +func PossibleValuesForExtendedLocationTypes() []string { + return []string{ + string(ExtendedLocationTypesCustomLocation), + } +} + +func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExtendedLocationTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { + vals := map[string]ExtendedLocationTypes{ + "customlocation": ExtendedLocationTypesCustomLocation, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExtendedLocationTypes(input) + return &out, nil +} + +type NetworkPolicy string + +const ( + NetworkPolicyCalico NetworkPolicy = "calico" +) + +func PossibleValuesForNetworkPolicy() []string { + return []string{ + string(NetworkPolicyCalico), + } +} + +func (s *NetworkPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkPolicy(input string) (*NetworkPolicy, error) { + vals := map[string]NetworkPolicy{ + "calico": NetworkPolicyCalico, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkPolicy(input) + return &out, nil +} + +type OSSKU string + +const ( + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" + OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" +) + +func PossibleValuesForOSSKU() []string { + return []string{ + string(OSSKUCBLMariner), + string(OSSKUWindowsTwoZeroOneNine), + string(OSSKUWindowsTwoZeroTwoTwo), + } +} + +func (s *OSSKU) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSSKU(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSSKU(input string) (*OSSKU, error) { + vals := map[string]OSSKU{ + "cblmariner": OSSKUCBLMariner, + "windows2019": OSSKUWindowsTwoZeroOneNine, + "windows2022": OSSKUWindowsTwoZeroTwoTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSSKU(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeWindows), + } +} + +func (s *OsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOsType(input string) (*OsType, error) { + vals := map[string]OsType{ + "linux": OsTypeLinux, + "windows": OsTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OsType(input) + return &out, nil +} + +type ResourceProvisioningState string + +const ( + ResourceProvisioningStateAccepted ResourceProvisioningState = "Accepted" + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + ResourceProvisioningStateCreating ResourceProvisioningState = "Creating" + ResourceProvisioningStateDeleting ResourceProvisioningState = "Deleting" + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + ResourceProvisioningStatePending ResourceProvisioningState = "Pending" + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" + ResourceProvisioningStateUpdating ResourceProvisioningState = "Updating" + ResourceProvisioningStateUpgrading ResourceProvisioningState = "Upgrading" +) + +func PossibleValuesForResourceProvisioningState() []string { + return []string{ + string(ResourceProvisioningStateAccepted), + string(ResourceProvisioningStateCanceled), + string(ResourceProvisioningStateCreating), + string(ResourceProvisioningStateDeleting), + string(ResourceProvisioningStateFailed), + string(ResourceProvisioningStatePending), + string(ResourceProvisioningStateSucceeded), + string(ResourceProvisioningStateUpdating), + string(ResourceProvisioningStateUpgrading), + } +} + +func (s *ResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceProvisioningState(input string) (*ResourceProvisioningState, error) { + vals := map[string]ResourceProvisioningState{ + "accepted": ResourceProvisioningStateAccepted, + "canceled": ResourceProvisioningStateCanceled, + "creating": ResourceProvisioningStateCreating, + "deleting": ResourceProvisioningStateDeleting, + "failed": ResourceProvisioningStateFailed, + "pending": ResourceProvisioningStatePending, + "succeeded": ResourceProvisioningStateSucceeded, + "updating": ResourceProvisioningStateUpdating, + "upgrading": ResourceProvisioningStateUpgrading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool.go new file mode 100644 index 00000000000..c1924811514 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool.go @@ -0,0 +1,117 @@ +package provisionedclusterinstances + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &ScopedAgentPoolId{} + +// ScopedAgentPoolId is a struct representing the Resource ID for a Scoped Agent Pool +type ScopedAgentPoolId struct { + ConnectedClusterResourceUri string + AgentPoolName string +} + +// NewScopedAgentPoolID returns a new ScopedAgentPoolId struct +func NewScopedAgentPoolID(connectedClusterResourceUri string, agentPoolName string) ScopedAgentPoolId { + return ScopedAgentPoolId{ + ConnectedClusterResourceUri: connectedClusterResourceUri, + AgentPoolName: agentPoolName, + } +} + +// ParseScopedAgentPoolID parses 'input' into a ScopedAgentPoolId +func ParseScopedAgentPoolID(input string) (*ScopedAgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ScopedAgentPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ScopedAgentPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseScopedAgentPoolIDInsensitively parses 'input' case-insensitively into a ScopedAgentPoolId +// note: this method should only be used for API response data and not user input +func ParseScopedAgentPoolIDInsensitively(input string) (*ScopedAgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ScopedAgentPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ScopedAgentPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ScopedAgentPoolId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.ConnectedClusterResourceUri, ok = input.Parsed["connectedClusterResourceUri"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "connectedClusterResourceUri", input) + } + + if id.AgentPoolName, ok = input.Parsed["agentPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "agentPoolName", input) + } + + return nil +} + +// ValidateScopedAgentPoolID checks that 'input' can be parsed as a Scoped Agent Pool ID +func ValidateScopedAgentPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseScopedAgentPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Scoped Agent Pool ID +func (id ScopedAgentPoolId) ID() string { + fmtString := "/%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/%s" + return fmt.Sprintf(fmtString, strings.TrimPrefix(id.ConnectedClusterResourceUri, "/"), id.AgentPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Scoped Agent Pool ID +func (id ScopedAgentPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.ScopeSegment("connectedClusterResourceUri", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftHybridContainerService", "Microsoft.HybridContainerService", "Microsoft.HybridContainerService"), + resourceids.StaticSegment("staticProvisionedClusterInstances", "provisionedClusterInstances", "provisionedClusterInstances"), + resourceids.StaticSegment("staticDefault", "default", "default"), + resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), + resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolValue"), + } +} + +// String returns a human-readable description of this Scoped Agent Pool ID +func (id ScopedAgentPoolId) String() string { + components := []string{ + fmt.Sprintf("Connected Cluster Resource Uri: %q", id.ConnectedClusterResourceUri), + fmt.Sprintf("Agent Pool Name: %q", id.AgentPoolName), + } + return fmt.Sprintf("Scoped Agent Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool_test.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool_test.go new file mode 100644 index 00000000000..1f3be9c029b --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/id_scopedagentpool_test.go @@ -0,0 +1,252 @@ +package provisionedclusterinstances + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &ScopedAgentPoolId{} + +func TestNewScopedAgentPoolID(t *testing.T) { + id := NewScopedAgentPoolID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "agentPoolValue") + + if id.ConnectedClusterResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectedClusterResourceUri'", id.ConnectedClusterResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + } + + if id.AgentPoolName != "agentPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolValue") + } +} + +func TestFormatScopedAgentPoolID(t *testing.T) { + actual := NewScopedAgentPoolID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "agentPoolValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/agentPoolValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseScopedAgentPoolID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ScopedAgentPoolId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/agentPoolValue", + Expected: &ScopedAgentPoolId{ + ConnectedClusterResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + AgentPoolName: "agentPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/agentPoolValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseScopedAgentPoolID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.ConnectedClusterResourceUri != v.Expected.ConnectedClusterResourceUri { + t.Fatalf("Expected %q but got %q for ConnectedClusterResourceUri", v.Expected.ConnectedClusterResourceUri, actual.ConnectedClusterResourceUri) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) + } + + } +} + +func TestParseScopedAgentPoolIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ScopedAgentPoolId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/pRoViSiOnEdClUsTeRiNsTaNcEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/pRoViSiOnEdClUsTeRiNsTaNcEs/dEfAuLt", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/pRoViSiOnEdClUsTeRiNsTaNcEs/dEfAuLt/aGeNtPoOlS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/agentPoolValue", + Expected: &ScopedAgentPoolId{ + ConnectedClusterResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + AgentPoolName: "agentPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/agentPoolValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/pRoViSiOnEdClUsTeRiNsTaNcEs/dEfAuLt/aGeNtPoOlS/aGeNtPoOlVaLuE", + Expected: &ScopedAgentPoolId{ + ConnectedClusterResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + AgentPoolName: "aGeNtPoOlVaLuE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/pRoViSiOnEdClUsTeRiNsTaNcEs/dEfAuLt/aGeNtPoOlS/aGeNtPoOlVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseScopedAgentPoolIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.ConnectedClusterResourceUri != v.Expected.ConnectedClusterResourceUri { + t.Fatalf("Expected %q but got %q for ConnectedClusterResourceUri", v.Expected.ConnectedClusterResourceUri, actual.ConnectedClusterResourceUri) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) + } + + } +} + +func TestSegmentsForScopedAgentPoolId(t *testing.T) { + segments := ScopedAgentPoolId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ScopedAgentPoolId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolcreateorupdate.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolcreateorupdate.go new file mode 100644 index 00000000000..c3c28ad2d81 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolcreateorupdate.go @@ -0,0 +1,75 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AgentPool +} + +// AgentPoolCreateOrUpdate ... +func (c ProvisionedClusterInstancesClient) AgentPoolCreateOrUpdate(ctx context.Context, id ScopedAgentPoolId, input AgentPool) (result AgentPoolCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AgentPoolCreateOrUpdateThenPoll performs AgentPoolCreateOrUpdate then polls until it's completed +func (c ProvisionedClusterInstancesClient) AgentPoolCreateOrUpdateThenPoll(ctx context.Context, id ScopedAgentPoolId, input AgentPool) error { + result, err := c.AgentPoolCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AgentPoolCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AgentPoolCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpooldelete.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpooldelete.go new file mode 100644 index 00000000000..a91b77fa518 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpooldelete.go @@ -0,0 +1,70 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AgentPoolDelete ... +func (c ProvisionedClusterInstancesClient) AgentPoolDelete(ctx context.Context, id ScopedAgentPoolId) (result AgentPoolDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AgentPoolDeleteThenPoll performs AgentPoolDelete then polls until it's completed +func (c ProvisionedClusterInstancesClient) AgentPoolDeleteThenPoll(ctx context.Context, id ScopedAgentPoolId) error { + result, err := c.AgentPoolDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AgentPoolDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AgentPoolDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolget.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolget.go new file mode 100644 index 00000000000..9bf50b9bd87 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoolget.go @@ -0,0 +1,51 @@ +package provisionedclusterinstances + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AgentPool +} + +// AgentPoolGet ... +func (c ProvisionedClusterInstancesClient) AgentPoolGet(ctx context.Context, id ScopedAgentPoolId) (result AgentPoolGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoollistbyprovisionedcluster.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoollistbyprovisionedcluster.go new file mode 100644 index 00000000000..8da32cef6d7 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_agentpoollistbyprovisionedcluster.go @@ -0,0 +1,92 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolListByProvisionedClusterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AgentPool +} + +type AgentPoolListByProvisionedClusterCompleteResult struct { + LatestHttpResponse *http.Response + Items []AgentPool +} + +// AgentPoolListByProvisionedCluster ... +func (c ProvisionedClusterInstancesClient) AgentPoolListByProvisionedCluster(ctx context.Context, id commonids.ScopeId) (result AgentPoolListByProvisionedClusterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]AgentPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// AgentPoolListByProvisionedClusterComplete retrieves all the results into a single object +func (c ProvisionedClusterInstancesClient) AgentPoolListByProvisionedClusterComplete(ctx context.Context, id commonids.ScopeId) (AgentPoolListByProvisionedClusterCompleteResult, error) { + return c.AgentPoolListByProvisionedClusterCompleteMatchingPredicate(ctx, id, AgentPoolOperationPredicate{}) +} + +// AgentPoolListByProvisionedClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ProvisionedClusterInstancesClient) AgentPoolListByProvisionedClusterCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate AgentPoolOperationPredicate) (result AgentPoolListByProvisionedClusterCompleteResult, err error) { + items := make([]AgentPool, 0) + + resp, err := c.AgentPoolListByProvisionedCluster(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = AgentPoolListByProvisionedClusterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletekubernetesversions.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletekubernetesversions.go new file mode 100644 index 00000000000..f2fe944848a --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletekubernetesversions.go @@ -0,0 +1,71 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteKubernetesVersionsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteKubernetesVersions ... +func (c ProvisionedClusterInstancesClient) DeleteKubernetesVersions(ctx context.Context, id commonids.ScopeId) (result DeleteKubernetesVersionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/kubernetesVersions/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteKubernetesVersionsThenPoll performs DeleteKubernetesVersions then polls until it's completed +func (c ProvisionedClusterInstancesClient) DeleteKubernetesVersionsThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.DeleteKubernetesVersions(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteKubernetesVersions: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteKubernetesVersions: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletevmskus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletevmskus.go new file mode 100644 index 00000000000..2092c810f00 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_deletevmskus.go @@ -0,0 +1,71 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteVMSkusOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteVMSkus ... +func (c ProvisionedClusterInstancesClient) DeleteVMSkus(ctx context.Context, id commonids.ScopeId) (result DeleteVMSkusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/skus/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteVMSkusThenPoll performs DeleteVMSkus then polls until it's completed +func (c ProvisionedClusterInstancesClient) DeleteVMSkusThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.DeleteVMSkus(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteVMSkus: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteVMSkus: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getkubernetesversions.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getkubernetesversions.go new file mode 100644 index 00000000000..53560ccc26a --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getkubernetesversions.go @@ -0,0 +1,53 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetKubernetesVersionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *KubernetesVersionProfile +} + +// GetKubernetesVersions ... +func (c ProvisionedClusterInstancesClient) GetKubernetesVersions(ctx context.Context, id commonids.ScopeId) (result GetKubernetesVersionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/kubernetesVersions/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getupgradeprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getupgradeprofile.go new file mode 100644 index 00000000000..f0998322e7d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getupgradeprofile.go @@ -0,0 +1,53 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUpgradeProfileOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ProvisionedClusterUpgradeProfile +} + +// GetUpgradeProfile ... +func (c ProvisionedClusterInstancesClient) GetUpgradeProfile(ctx context.Context, id commonids.ScopeId) (result GetUpgradeProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/upgradeProfiles/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getvmskus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getvmskus.go new file mode 100644 index 00000000000..7e4bb2a71aa --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_getvmskus.go @@ -0,0 +1,53 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetVMSkusOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VMSkuProfile +} + +// GetVMSkus ... +func (c ProvisionedClusterInstancesClient) GetVMSkus(ctx context.Context, id commonids.ScopeId) (result GetVMSkusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/skus/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatadelete.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatadelete.go new file mode 100644 index 00000000000..8d6e9cdc7ca --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatadelete.go @@ -0,0 +1,71 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadataDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// HybridIdentityMetadataDelete ... +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataDelete(ctx context.Context, id commonids.ScopeId) (result HybridIdentityMetadataDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/hybridIdentityMetadata/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// HybridIdentityMetadataDeleteThenPoll performs HybridIdentityMetadataDelete then polls until it's completed +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataDeleteThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.HybridIdentityMetadataDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing HybridIdentityMetadataDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after HybridIdentityMetadataDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataget.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataget.go new file mode 100644 index 00000000000..a0e7b277801 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataget.go @@ -0,0 +1,53 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadataGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *HybridIdentityMetadata +} + +// HybridIdentityMetadataGet ... +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataGet(ctx context.Context, id commonids.ScopeId) (result HybridIdentityMetadataGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/hybridIdentityMetadata/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatalistbycluster.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatalistbycluster.go new file mode 100644 index 00000000000..378f67e7ed6 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadatalistbycluster.go @@ -0,0 +1,92 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadataListByClusterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]HybridIdentityMetadata +} + +type HybridIdentityMetadataListByClusterCompleteResult struct { + LatestHttpResponse *http.Response + Items []HybridIdentityMetadata +} + +// HybridIdentityMetadataListByCluster ... +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataListByCluster(ctx context.Context, id commonids.ScopeId) (result HybridIdentityMetadataListByClusterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/hybridIdentityMetadata", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]HybridIdentityMetadata `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// HybridIdentityMetadataListByClusterComplete retrieves all the results into a single object +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataListByClusterComplete(ctx context.Context, id commonids.ScopeId) (HybridIdentityMetadataListByClusterCompleteResult, error) { + return c.HybridIdentityMetadataListByClusterCompleteMatchingPredicate(ctx, id, HybridIdentityMetadataOperationPredicate{}) +} + +// HybridIdentityMetadataListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataListByClusterCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate HybridIdentityMetadataOperationPredicate) (result HybridIdentityMetadataListByClusterCompleteResult, err error) { + items := make([]HybridIdentityMetadata, 0) + + resp, err := c.HybridIdentityMetadataListByCluster(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = HybridIdentityMetadataListByClusterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataput.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataput.go new file mode 100644 index 00000000000..001039a6977 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_hybrididentitymetadataput.go @@ -0,0 +1,58 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadataPutOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *HybridIdentityMetadata +} + +// HybridIdentityMetadataPut ... +func (c ProvisionedClusterInstancesClient) HybridIdentityMetadataPut(ctx context.Context, id commonids.ScopeId, input HybridIdentityMetadata) (result HybridIdentityMetadataPutOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/hybridIdentityMetadata/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_kubernetesversionslist.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_kubernetesversionslist.go new file mode 100644 index 00000000000..106533e3061 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_kubernetesversionslist.go @@ -0,0 +1,92 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]KubernetesVersionProfile +} + +type KubernetesVersionsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []KubernetesVersionProfile +} + +// KubernetesVersionsList ... +func (c ProvisionedClusterInstancesClient) KubernetesVersionsList(ctx context.Context, id commonids.ScopeId) (result KubernetesVersionsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/kubernetesVersions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]KubernetesVersionProfile `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// KubernetesVersionsListComplete retrieves all the results into a single object +func (c ProvisionedClusterInstancesClient) KubernetesVersionsListComplete(ctx context.Context, id commonids.ScopeId) (KubernetesVersionsListCompleteResult, error) { + return c.KubernetesVersionsListCompleteMatchingPredicate(ctx, id, KubernetesVersionProfileOperationPredicate{}) +} + +// KubernetesVersionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ProvisionedClusterInstancesClient) KubernetesVersionsListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate KubernetesVersionProfileOperationPredicate) (result KubernetesVersionsListCompleteResult, err error) { + items := make([]KubernetesVersionProfile, 0) + + resp, err := c.KubernetesVersionsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = KubernetesVersionsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listadminkubeconfig.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listadminkubeconfig.go new file mode 100644 index 00000000000..50c24cc9973 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listadminkubeconfig.go @@ -0,0 +1,72 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAdminKubeconfigOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ListCredentialResponse +} + +// ListAdminKubeconfig ... +func (c ProvisionedClusterInstancesClient) ListAdminKubeconfig(ctx context.Context, id commonids.ScopeId) (result ListAdminKubeconfigOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/listAdminKubeconfig", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ListAdminKubeconfigThenPoll performs ListAdminKubeconfig then polls until it's completed +func (c ProvisionedClusterInstancesClient) ListAdminKubeconfigThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.ListAdminKubeconfig(ctx, id) + if err != nil { + return fmt.Errorf("performing ListAdminKubeconfig: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ListAdminKubeconfig: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listuserkubeconfig.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listuserkubeconfig.go new file mode 100644 index 00000000000..7def6ef1e2e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_listuserkubeconfig.go @@ -0,0 +1,72 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListUserKubeconfigOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ListCredentialResponse +} + +// ListUserKubeconfig ... +func (c ProvisionedClusterInstancesClient) ListUserKubeconfig(ctx context.Context, id commonids.ScopeId) (result ListUserKubeconfigOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/listUserKubeconfig", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ListUserKubeconfigThenPoll performs ListUserKubeconfig then polls until it's completed +func (c ProvisionedClusterInstancesClient) ListUserKubeconfigThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.ListUserKubeconfig(ctx, id) + if err != nil { + return fmt.Errorf("performing ListUserKubeconfig: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ListUserKubeconfig: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancescreateorupdate.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancescreateorupdate.go new file mode 100644 index 00000000000..790d3443462 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancescreateorupdate.go @@ -0,0 +1,76 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterInstancesCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ProvisionedCluster +} + +// ProvisionedClusterInstancesCreateOrUpdate ... +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesCreateOrUpdate(ctx context.Context, id commonids.ScopeId, input ProvisionedCluster) (result ProvisionedClusterInstancesCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ProvisionedClusterInstancesCreateOrUpdateThenPoll performs ProvisionedClusterInstancesCreateOrUpdate then polls until it's completed +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesCreateOrUpdateThenPoll(ctx context.Context, id commonids.ScopeId, input ProvisionedCluster) error { + result, err := c.ProvisionedClusterInstancesCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ProvisionedClusterInstancesCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ProvisionedClusterInstancesCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesdelete.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesdelete.go new file mode 100644 index 00000000000..b37952d6590 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesdelete.go @@ -0,0 +1,71 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterInstancesDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ProvisionedClusterInstancesDelete ... +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesDelete(ctx context.Context, id commonids.ScopeId) (result ProvisionedClusterInstancesDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ProvisionedClusterInstancesDeleteThenPoll performs ProvisionedClusterInstancesDelete then polls until it's completed +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesDeleteThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.ProvisionedClusterInstancesDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing ProvisionedClusterInstancesDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ProvisionedClusterInstancesDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesget.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesget.go new file mode 100644 index 00000000000..73ce462500e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstancesget.go @@ -0,0 +1,53 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterInstancesGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ProvisionedCluster +} + +// ProvisionedClusterInstancesGet ... +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesGet(ctx context.Context, id commonids.ScopeId) (result ProvisionedClusterInstancesGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstanceslist.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstanceslist.go new file mode 100644 index 00000000000..bc8c2c993b7 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_provisionedclusterinstanceslist.go @@ -0,0 +1,92 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterInstancesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ProvisionedCluster +} + +type ProvisionedClusterInstancesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ProvisionedCluster +} + +// ProvisionedClusterInstancesList ... +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesList(ctx context.Context, id commonids.ScopeId) (result ProvisionedClusterInstancesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/provisionedClusterInstances", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ProvisionedCluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ProvisionedClusterInstancesListComplete retrieves all the results into a single object +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesListComplete(ctx context.Context, id commonids.ScopeId) (ProvisionedClusterInstancesListCompleteResult, error) { + return c.ProvisionedClusterInstancesListCompleteMatchingPredicate(ctx, id, ProvisionedClusterOperationPredicate{}) +} + +// ProvisionedClusterInstancesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ProvisionedClusterInstancesClient) ProvisionedClusterInstancesListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ProvisionedClusterOperationPredicate) (result ProvisionedClusterInstancesListCompleteResult, err error) { + items := make([]ProvisionedCluster, 0) + + resp, err := c.ProvisionedClusterInstancesList(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ProvisionedClusterInstancesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putkubernetesversions.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putkubernetesversions.go new file mode 100644 index 00000000000..57aa50f3b12 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putkubernetesversions.go @@ -0,0 +1,76 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PutKubernetesVersionsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *KubernetesVersionProfile +} + +// PutKubernetesVersions ... +func (c ProvisionedClusterInstancesClient) PutKubernetesVersions(ctx context.Context, id commonids.ScopeId, input KubernetesVersionProfile) (result PutKubernetesVersionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/kubernetesVersions/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// PutKubernetesVersionsThenPoll performs PutKubernetesVersions then polls until it's completed +func (c ProvisionedClusterInstancesClient) PutKubernetesVersionsThenPoll(ctx context.Context, id commonids.ScopeId, input KubernetesVersionProfile) error { + result, err := c.PutKubernetesVersions(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PutKubernetesVersions: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PutKubernetesVersions: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putvmskus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putvmskus.go new file mode 100644 index 00000000000..18ca7ccedf5 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_putvmskus.go @@ -0,0 +1,76 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PutVMSkusOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VMSkuProfile +} + +// PutVMSkus ... +func (c ProvisionedClusterInstancesClient) PutVMSkus(ctx context.Context, id commonids.ScopeId, input VMSkuProfile) (result PutVMSkusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/skus/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// PutVMSkusThenPoll performs PutVMSkus then polls until it's completed +func (c ProvisionedClusterInstancesClient) PutVMSkusThenPoll(ctx context.Context, id commonids.ScopeId, input VMSkuProfile) error { + result, err := c.PutVMSkus(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PutVMSkus: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PutVMSkus: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_vmskuslist.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_vmskuslist.go new file mode 100644 index 00000000000..988ec060cf9 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/method_vmskuslist.go @@ -0,0 +1,92 @@ +package provisionedclusterinstances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSkusListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VMSkuProfile +} + +type VMSkusListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VMSkuProfile +} + +// VMSkusList ... +func (c ProvisionedClusterInstancesClient) VMSkusList(ctx context.Context, id commonids.ScopeId) (result VMSkusListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/skus", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]VMSkuProfile `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// VMSkusListComplete retrieves all the results into a single object +func (c ProvisionedClusterInstancesClient) VMSkusListComplete(ctx context.Context, id commonids.ScopeId) (VMSkusListCompleteResult, error) { + return c.VMSkusListCompleteMatchingPredicate(ctx, id, VMSkuProfileOperationPredicate{}) +} + +// VMSkusListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ProvisionedClusterInstancesClient) VMSkusListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VMSkuProfileOperationPredicate) (result VMSkusListCompleteResult, err error) { + items := make([]VMSkuProfile, 0) + + resp, err := c.VMSkusList(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = VMSkusListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_addonstatusprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_addonstatusprofile.go new file mode 100644 index 00000000000..1248fbea3c4 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_addonstatusprofile.go @@ -0,0 +1,11 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AddonStatusProfile struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Name *string `json:"name,omitempty"` + Phase *AddonPhase `json:"phase,omitempty"` + Ready *bool `json:"ready,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpool.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpool.go new file mode 100644 index 00000000000..4989e4e325f --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpool.go @@ -0,0 +1,18 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPool struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AgentPoolProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolproperties.go new file mode 100644 index 00000000000..2dfc2e4608d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolproperties.go @@ -0,0 +1,20 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolProperties struct { + Count *int64 `json:"count,omitempty"` + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + MaxCount *int64 `json:"maxCount,omitempty"` + MaxPods *int64 `json:"maxPods,omitempty"` + MinCount *int64 `json:"minCount,omitempty"` + NodeLabels *map[string]string `json:"nodeLabels,omitempty"` + NodeTaints *[]string `json:"nodeTaints,omitempty"` + OsSKU *OSSKU `json:"osSKU,omitempty"` + OsType *OsType `json:"osType,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Status *AgentPoolProvisioningStatusStatus `json:"status,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolprovisioningstatusstatus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolprovisioningstatusstatus.go new file mode 100644 index 00000000000..032b4a09149 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolprovisioningstatusstatus.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolProvisioningStatusStatus struct { + CurrentState *ResourceProvisioningState `json:"currentState,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + ReadyReplicas *[]AgentPoolUpdateProfile `json:"readyReplicas,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolupdateprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolupdateprofile.go new file mode 100644 index 00000000000..9e34bda2b1c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_agentpoolupdateprofile.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpdateProfile struct { + Count *int64 `json:"count,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofile.go new file mode 100644 index 00000000000..15ef3afdf38 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofile.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudProviderProfile struct { + InfraNetworkProfile *CloudProviderProfileInfraNetworkProfile `json:"infraNetworkProfile,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofileinfranetworkprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofileinfranetworkprofile.go new file mode 100644 index 00000000000..8dd11032486 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_cloudproviderprofileinfranetworkprofile.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudProviderProfileInfraNetworkProfile struct { + VnetSubnetIds *[]string `json:"vnetSubnetIds,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_clustervmaccessprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_clustervmaccessprofile.go new file mode 100644 index 00000000000..3ca8479e173 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_clustervmaccessprofile.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterVMAccessProfile struct { + AuthorizedIPRanges *string `json:"authorizedIPRanges,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofile.go new file mode 100644 index 00000000000..356f71d0a38 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofile.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ControlPlaneProfile struct { + ControlPlaneEndpoint *ControlPlaneProfileControlPlaneEndpoint `json:"controlPlaneEndpoint,omitempty"` + Count *int64 `json:"count,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofilecontrolplaneendpoint.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofilecontrolplaneendpoint.go new file mode 100644 index 00000000000..d8e6b22b877 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_controlplaneprofilecontrolplaneendpoint.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ControlPlaneProfileControlPlaneEndpoint struct { + HostIP *string `json:"hostIP,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_credentialresult.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_credentialresult.go new file mode 100644 index 00000000000..f53ff3e4730 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_credentialresult.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialResult struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_extendedlocation.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_extendedlocation.go new file mode 100644 index 00000000000..df5c35f415d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_extendedlocation.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *ExtendedLocationTypes `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadata.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadata.go new file mode 100644 index 00000000000..ba1c943e557 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadata.go @@ -0,0 +1,16 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadata struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties HybridIdentityMetadataProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadataproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadataproperties.go new file mode 100644 index 00000000000..775c85af498 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_hybrididentitymetadataproperties.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridIdentityMetadataProperties struct { + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` + ResourceUid *string `json:"resourceUid,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetespatchversions.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetespatchversions.go new file mode 100644 index 00000000000..a1a2681bf52 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetespatchversions.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesPatchVersions struct { + Readiness *[]KubernetesVersionReadiness `json:"readiness,omitempty"` + Upgrades *[]string `json:"upgrades,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofile.go new file mode 100644 index 00000000000..9e500cc683d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofile.go @@ -0,0 +1,17 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionProfile struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *KubernetesVersionProfileProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofileproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofileproperties.go new file mode 100644 index 00000000000..93c54b0a9ca --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionprofileproperties.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionProfileProperties struct { + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Values *[]KubernetesVersionProperties `json:"values,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionproperties.go new file mode 100644 index 00000000000..595551b647b --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionproperties.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionProperties struct { + IsPreview *bool `json:"isPreview,omitempty"` + PatchVersions *map[string]KubernetesPatchVersions `json:"patchVersions,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionreadiness.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionreadiness.go new file mode 100644 index 00000000000..54e2ba9b537 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_kubernetesversionreadiness.go @@ -0,0 +1,11 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionReadiness struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + OsSku *OSSKU `json:"osSku,omitempty"` + OsType *OsType `json:"osType,omitempty"` + Ready *bool `json:"ready,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofileproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofileproperties.go new file mode 100644 index 00000000000..79cdda20ec9 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofileproperties.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxProfileProperties struct { + Ssh *LinuxProfilePropertiesSsh `json:"ssh,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiesssh.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiesssh.go new file mode 100644 index 00000000000..12a2d64608f --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiesssh.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxProfilePropertiesSsh struct { + PublicKeys *[]LinuxProfilePropertiesSshPublicKeysInlined `json:"publicKeys,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiessshpublickeysinlined.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiessshpublickeysinlined.go new file mode 100644 index 00000000000..522a08e10ec --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_linuxprofilepropertiessshpublickeysinlined.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxProfilePropertiesSshPublicKeysInlined struct { + KeyData *string `json:"keyData,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponse.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponse.go new file mode 100644 index 00000000000..2cf150dacb8 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponse.go @@ -0,0 +1,13 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListCredentialResponse struct { + Error *ListCredentialResponseError `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ListCredentialResponseProperties `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + Status *ResourceProvisioningState `json:"status,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseerror.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseerror.go new file mode 100644 index 00000000000..65631706ff8 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseerror.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListCredentialResponseError struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseproperties.go new file mode 100644 index 00000000000..9993f067819 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_listcredentialresponseproperties.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListCredentialResponseProperties struct { + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_namedagentpoolprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_namedagentpoolprofile.go new file mode 100644 index 00000000000..ac5e4b41eb2 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_namedagentpoolprofile.go @@ -0,0 +1,19 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NamedAgentPoolProfile struct { + Count *int64 `json:"count,omitempty"` + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + MaxCount *int64 `json:"maxCount,omitempty"` + MaxPods *int64 `json:"maxPods,omitempty"` + MinCount *int64 `json:"minCount,omitempty"` + Name *string `json:"name,omitempty"` + NodeLabels *map[string]string `json:"nodeLabels,omitempty"` + NodeTaints *[]string `json:"nodeTaints,omitempty"` + OsSKU *OSSKU `json:"osSKU,omitempty"` + OsType *OsType `json:"osType,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofile.go new file mode 100644 index 00000000000..8f542600c3d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofile.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfile struct { + LoadBalancerProfile *NetworkProfileLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` + NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` + PodCidr *string `json:"podCidr,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofileloadbalancerprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofileloadbalancerprofile.go new file mode 100644 index 00000000000..6a9fa9a386c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_networkprofileloadbalancerprofile.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfileLoadBalancerProfile struct { + Count *int64 `json:"count,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedcluster.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedcluster.go new file mode 100644 index 00000000000..9093c96fc94 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedcluster.go @@ -0,0 +1,17 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedCluster struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ProvisionedClusterProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterlicenseprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterlicenseprofile.go new file mode 100644 index 00000000000..bec6f9004f1 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterlicenseprofile.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterLicenseProfile struct { + AzureHybridBenefit *AzureHybridBenefit `json:"azureHybridBenefit,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofile.go new file mode 100644 index 00000000000..64afa5f5e96 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofile.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterPoolUpgradeProfile struct { + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + OsType *OsType `json:"osType,omitempty"` + Upgrades *[]ProvisionedClusterPoolUpgradeProfileProperties `json:"upgrades,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofileproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofileproperties.go new file mode 100644 index 00000000000..8bfed453df6 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpoolupgradeprofileproperties.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterPoolUpgradeProfileProperties struct { + IsPreview *bool `json:"isPreview,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterproperties.go new file mode 100644 index 00000000000..fcb6073e7b2 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterproperties.go @@ -0,0 +1,19 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterProperties struct { + AgentPoolProfiles *[]NamedAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + AutoScalerProfile *ProvisionedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` + CloudProviderProfile *CloudProviderProfile `json:"cloudProviderProfile,omitempty"` + ClusterVMAccessProfile *ClusterVMAccessProfile `json:"clusterVMAccessProfile,omitempty"` + ControlPlane *ControlPlaneProfile `json:"controlPlane,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + LicenseProfile *ProvisionedClusterLicenseProfile `json:"licenseProfile,omitempty"` + LinuxProfile *LinuxProfileProperties `json:"linuxProfile,omitempty"` + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Status *ProvisionedClusterPropertiesStatus `json:"status,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesautoscalerprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesautoscalerprofile.go new file mode 100644 index 00000000000..59a043e44dd --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesautoscalerprofile.go @@ -0,0 +1,24 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterPropertiesAutoScalerProfile struct { + BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"` + Expander *Expander `json:"expander,omitempty"` + MaxEmptyBulkDelete *string `json:"max-empty-bulk-delete,omitempty"` + MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"` + MaxNodeProvisionTime *string `json:"max-node-provision-time,omitempty"` + MaxTotalUnreadyPercentage *string `json:"max-total-unready-percentage,omitempty"` + NewPodScaleUpDelay *string `json:"new-pod-scale-up-delay,omitempty"` + OkTotalUnreadyCount *string `json:"ok-total-unready-count,omitempty"` + ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"` + ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"` + ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"` + ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"` + ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"` + ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"` + ScanInterval *string `json:"scan-interval,omitempty"` + SkipNodesWithLocalStorage *string `json:"skip-nodes-with-local-storage,omitempty"` + SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesstatus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesstatus.go new file mode 100644 index 00000000000..6c7d9e52430 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterpropertiesstatus.go @@ -0,0 +1,10 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterPropertiesStatus struct { + ControlPlaneStatus *[]AddonStatusProfile `json:"controlPlaneStatus,omitempty"` + CurrentState *ResourceProvisioningState `json:"currentState,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofile.go new file mode 100644 index 00000000000..7cbd0fe69da --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofile.go @@ -0,0 +1,16 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterUpgradeProfile struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProvisionedClusterUpgradeProfileProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofileproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofileproperties.go new file mode 100644 index 00000000000..93bc41c63b0 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_provisionedclusterupgradeprofileproperties.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisionedClusterUpgradeProfileProperties struct { + ControlPlaneProfile ProvisionedClusterPoolUpgradeProfile `json:"controlPlaneProfile"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofile.go new file mode 100644 index 00000000000..2a27029606c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofile.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfile struct { + NfsCsiDriver *StorageProfileNfsCSIDriver `json:"nfsCsiDriver,omitempty"` + SmbCsiDriver *StorageProfileSmbCSIDriver `json:"smbCsiDriver,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilenfscsidriver.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilenfscsidriver.go new file mode 100644 index 00000000000..4064e020e57 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilenfscsidriver.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfileNfsCSIDriver struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilesmbcsidriver.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilesmbcsidriver.go new file mode 100644 index 00000000000..f6eec488284 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_storageprofilesmbcsidriver.go @@ -0,0 +1,8 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfileSmbCSIDriver struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskucapabilities.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskucapabilities.go new file mode 100644 index 00000000000..905c81b2937 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskucapabilities.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSkuCapabilities struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofile.go new file mode 100644 index 00000000000..a7bdad2924d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofile.go @@ -0,0 +1,17 @@ +package provisionedclusterinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSkuProfile struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VMSkuProfileProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofileproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofileproperties.go new file mode 100644 index 00000000000..fcdfdb3244b --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuprofileproperties.go @@ -0,0 +1,9 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSkuProfileProperties struct { + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Values *[]VMSkuProperties `json:"values,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuproperties.go new file mode 100644 index 00000000000..fa2c904d575 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/model_vmskuproperties.go @@ -0,0 +1,12 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSkuProperties struct { + Capabilities *[]VMSkuCapabilities `json:"capabilities,omitempty"` + Name *string `json:"name,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Size *string `json:"size,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/predicates.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/predicates.go new file mode 100644 index 00000000000..d8296c2d72d --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/predicates.go @@ -0,0 +1,119 @@ +package provisionedclusterinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p AgentPoolOperationPredicate) Matches(input AgentPool) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type HybridIdentityMetadataOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p HybridIdentityMetadataOperationPredicate) Matches(input HybridIdentityMetadata) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type KubernetesVersionProfileOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p KubernetesVersionProfileOperationPredicate) Matches(input KubernetesVersionProfile) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type ProvisionedClusterOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ProvisionedClusterOperationPredicate) Matches(input ProvisionedCluster) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type VMSkuProfileOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VMSkuProfileOperationPredicate) Matches(input VMSkuProfile) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/version.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/version.go new file mode 100644 index 00000000000..0ebd18f17bf --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/provisionedclusterinstances/version.go @@ -0,0 +1,12 @@ +package provisionedclusterinstances + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/provisionedclusterinstances/%s", defaultApiVersion) +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/README.md b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/README.md new file mode 100644 index 00000000000..9b6c0804314 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks` Documentation + +The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `hybridazurekubernetesservice` (API Version `2024-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks" +``` + + +### Client Initialization + +```go +client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworksClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.VirtualNetwork{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := virtualnetworks.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.ListBySubscription` + +```go +ctx := context.TODO() +id := virtualnetworks.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.Retrieve` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +read, err := client.Retrieve(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworksClient.Update` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.VirtualNetworksPatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/client.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/client.go new file mode 100644 index 00000000000..15c346279f6 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/client.go @@ -0,0 +1,26 @@ +package virtualnetworks + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworksClient struct { + Client *resourcemanager.Client +} + +func NewVirtualNetworksClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualNetworksClient: %+v", err) + } + + return &VirtualNetworksClient{ + Client: client, + }, nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/constants.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/constants.go new file mode 100644 index 00000000000..07fc4f0f315 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/constants.go @@ -0,0 +1,107 @@ +package virtualnetworks + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocationTypes string + +const ( + ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" +) + +func PossibleValuesForExtendedLocationTypes() []string { + return []string{ + string(ExtendedLocationTypesCustomLocation), + } +} + +func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExtendedLocationTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { + vals := map[string]ExtendedLocationTypes{ + "customlocation": ExtendedLocationTypesCustomLocation, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExtendedLocationTypes(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStatePending ProvisioningState = "Pending" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStatePending), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "pending": ProvisioningStatePending, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork.go new file mode 100644 index 00000000000..c50dba1e5e3 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork.go @@ -0,0 +1,125 @@ +package virtualnetworks + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &VirtualNetworkId{} + +// VirtualNetworkId is a struct representing the Resource ID for a Virtual Network +type VirtualNetworkId struct { + SubscriptionId string + ResourceGroupName string + VirtualNetworkName string +} + +// NewVirtualNetworkID returns a new VirtualNetworkId struct +func NewVirtualNetworkID(subscriptionId string, resourceGroupName string, virtualNetworkName string) VirtualNetworkId { + return VirtualNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualNetworkName: virtualNetworkName, + } +} + +// ParseVirtualNetworkID parses 'input' into a VirtualNetworkId +func ParseVirtualNetworkID(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVirtualNetworkIDInsensitively parses 'input' case-insensitively into a VirtualNetworkId +// note: this method should only be used for API response data and not user input +func ParseVirtualNetworkIDInsensitively(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VirtualNetworkId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.VirtualNetworkName, ok = input.Parsed["virtualNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", input) + } + + return nil +} + +// ValidateVirtualNetworkID checks that 'input' can be parsed as a Virtual Network ID +func ValidateVirtualNetworkID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Network ID +func (id VirtualNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HybridContainerService/virtualNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Network ID +func (id VirtualNetworkId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftHybridContainerService", "Microsoft.HybridContainerService", "Microsoft.HybridContainerService"), + resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), + resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), + } +} + +// String returns a human-readable description of this Virtual Network ID +func (id VirtualNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Network Name: %q", id.VirtualNetworkName), + } + return fmt.Sprintf("Virtual Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork_test.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork_test.go new file mode 100644 index 00000000000..7fca3b343bf --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/id_virtualnetwork_test.go @@ -0,0 +1,282 @@ +package virtualnetworks + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &VirtualNetworkId{} + +func TestNewVirtualNetworkID(t *testing.T) { + id := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.VirtualNetworkName != "virtualNetworkValue" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "virtualNetworkValue") + } +} + +func TestFormatVirtualNetworkID(t *testing.T) { + actual := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks/virtualNetworkValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVirtualNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks/virtualNetworkValue", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualNetworkName: "virtualNetworkValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks/virtualNetworkValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualNetworkID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.VirtualNetworkName != v.Expected.VirtualNetworkName { + t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) + } + + } +} + +func TestParseVirtualNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/vIrTuAlNeTwOrKs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks/virtualNetworkValue", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualNetworkName: "virtualNetworkValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridContainerService/virtualNetworks/virtualNetworkValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VirtualNetworkName: "vIrTuAlNeTwOrKvAlUe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOnTaInErSeRvIcE/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualNetworkIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.VirtualNetworkName != v.Expected.VirtualNetworkName { + t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) + } + + } +} + +func TestSegmentsForVirtualNetworkId(t *testing.T) { + segments := VirtualNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VirtualNetworkId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_createorupdate.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_createorupdate.go new file mode 100644 index 00000000000..39163471a54 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_createorupdate.go @@ -0,0 +1,75 @@ +package virtualnetworks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetwork +} + +// CreateOrUpdate ... +func (c VirtualNetworksClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualNetworksClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_delete.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_delete.go new file mode 100644 index 00000000000..2427ac447df --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_delete.go @@ -0,0 +1,70 @@ +package virtualnetworks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c VirtualNetworksClient) Delete(ctx context.Context, id VirtualNetworkId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VirtualNetworksClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbyresourcegroup.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbyresourcegroup.go new file mode 100644 index 00000000000..d16e617353c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package virtualnetworks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VirtualNetwork +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualNetwork +} + +// ListByResourceGroup ... +func (c VirtualNetworksClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/virtualNetworks", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]VirtualNetwork `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c VirtualNetworksClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VirtualNetwork, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbysubscription.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbysubscription.go new file mode 100644 index 00000000000..6870af03a5a --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_listbysubscription.go @@ -0,0 +1,92 @@ +package virtualnetworks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VirtualNetwork +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualNetwork +} + +// ListBySubscription ... +func (c VirtualNetworksClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HybridContainerService/virtualNetworks", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]VirtualNetwork `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c VirtualNetworksClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]VirtualNetwork, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_retrieve.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_retrieve.go new file mode 100644 index 00000000000..7c6a7e6996e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_retrieve.go @@ -0,0 +1,51 @@ +package virtualnetworks + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RetrieveOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetwork +} + +// Retrieve ... +func (c VirtualNetworksClient) Retrieve(ctx context.Context, id VirtualNetworkId) (result RetrieveOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_update.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_update.go new file mode 100644 index 00000000000..6300e8e174c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/method_update.go @@ -0,0 +1,75 @@ +package virtualnetworks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetwork +} + +// Update ... +func (c VirtualNetworksClient) Update(ctx context.Context, id VirtualNetworkId, input VirtualNetworksPatch) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VirtualNetworksClient) UpdateThenPoll(ctx context.Context, id VirtualNetworkId, input VirtualNetworksPatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetwork.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetwork.go new file mode 100644 index 00000000000..d144fa2810e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetwork.go @@ -0,0 +1,19 @@ +package virtualnetworks + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetwork struct { + ExtendedLocation *VirtualNetworkExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *VirtualNetworkProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkextendedlocation.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkextendedlocation.go new file mode 100644 index 00000000000..b03e561f99e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkextendedlocation.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *ExtendedLocationTypes `json:"type,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkproperties.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkproperties.go new file mode 100644 index 00000000000..8715a8e1721 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkproperties.go @@ -0,0 +1,16 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkProperties struct { + DnsServers *[]string `json:"dnsServers,omitempty"` + Gateway *string `json:"gateway,omitempty"` + IPAddressPrefix *string `json:"ipAddressPrefix,omitempty"` + InfraVnetProfile *VirtualNetworkPropertiesInfraVnetProfile `json:"infraVnetProfile,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Status *VirtualNetworkPropertiesStatus `json:"status,omitempty"` + VMipPool *[]VirtualNetworkPropertiesVMipPoolInlined `json:"vmipPool,omitempty"` + VipPool *[]VirtualNetworkPropertiesVipPoolInlined `json:"vipPool,omitempty"` + VlanID *int64 `json:"vlanID,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofile.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofile.go new file mode 100644 index 00000000000..75ebed49c53 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofile.go @@ -0,0 +1,8 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesInfraVnetProfile struct { + Hci *VirtualNetworkPropertiesInfraVnetProfileHci `json:"hci,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofilehci.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofilehci.go new file mode 100644 index 00000000000..1a56907ec8c --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesinfravnetprofilehci.go @@ -0,0 +1,10 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesInfraVnetProfileHci struct { + MocGroup *string `json:"mocGroup,omitempty"` + MocLocation *string `json:"mocLocation,omitempty"` + MocVnetName *string `json:"mocVnetName,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatus.go new file mode 100644 index 00000000000..d472b60c84e --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatus.go @@ -0,0 +1,8 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesStatus struct { + OperationStatus *VirtualNetworkPropertiesStatusOperationStatus `json:"operationStatus,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatus.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatus.go new file mode 100644 index 00000000000..7a56e25a678 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatus.go @@ -0,0 +1,10 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesStatusOperationStatus struct { + Error *VirtualNetworkPropertiesStatusOperationStatusError `json:"error,omitempty"` + OperationId *string `json:"operationId,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatuserror.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatuserror.go new file mode 100644 index 00000000000..29d4c7d1585 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesstatusoperationstatuserror.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesStatusOperationStatusError struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvippoolinlined.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvippoolinlined.go new file mode 100644 index 00000000000..f58acc03b90 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvippoolinlined.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesVipPoolInlined struct { + EndIP *string `json:"endIP,omitempty"` + StartIP *string `json:"startIP,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvmippoolinlined.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvmippoolinlined.go new file mode 100644 index 00000000000..3435820cb24 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkpropertiesvmippoolinlined.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesVMipPoolInlined struct { + EndIP *string `json:"endIP,omitempty"` + StartIP *string `json:"startIP,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkspatch.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkspatch.go new file mode 100644 index 00000000000..d2fc152d803 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/model_virtualnetworkspatch.go @@ -0,0 +1,8 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworksPatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/predicates.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/predicates.go new file mode 100644 index 00000000000..34e415f32c2 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/predicates.go @@ -0,0 +1,32 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p VirtualNetworkOperationPredicate) Matches(input VirtualNetwork) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/version.go b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/version.go new file mode 100644 index 00000000000..d9a791b9024 --- /dev/null +++ b/resource-manager/hybridazurekubernetesservice/2024-01-01/virtualnetworks/version.go @@ -0,0 +1,12 @@ +package virtualnetworks + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) +}