diff --git a/.github/workflows/link-milestone.yaml b/.github/workflows/link-milestone.yaml index d5223da0ed5f..3b1922367f6c 100644 --- a/.github/workflows/link-milestone.yaml +++ b/.github/workflows/link-milestone.yaml @@ -17,7 +17,8 @@ jobs: steps: - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: - go-version-file: ./.go-version + # we cannot use go-version-file here because no repositories are checked out so there is no file to reference + go-version: '1.20.5' - run: | go install github.com/stephybun/link-milestone@latest link-milestone diff --git a/go.mod b/go.mod index 8456037f963f..d7401cbd8e20 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.1.2 - github.com/hashicorp/go-azure-helpers v0.56.0 - github.com/hashicorp/go-azure-sdk v0.20230614.1151152 + github.com/hashicorp/go-azure-helpers v0.57.0 + github.com/hashicorp/go-azure-sdk v0.20230622.1085613 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index b53ceb9bca40..3e37a930c299 100644 --- a/go.sum +++ b/go.sum @@ -139,10 +139,10 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= -github.com/hashicorp/go-azure-helpers v0.56.0 h1:KxDXISHwWe4PKEz6FSSPG8vCXNrFGsCcCn/AI94ccig= -github.com/hashicorp/go-azure-helpers v0.56.0/go.mod h1:MbnCV9jPmlkbdH7VsoBK8IbCHvo3pLWRbRvq+F6u9sI= -github.com/hashicorp/go-azure-sdk v0.20230614.1151152 h1:R2KVDHjcjgR9xjaaR1HNkx9KZQEsDu/0lG7xujFO7MA= -github.com/hashicorp/go-azure-sdk v0.20230614.1151152/go.mod h1:ARDIozwF5NoDJDfnh+MlG4eicP0mVxmVt3CQVSbNrq0= +github.com/hashicorp/go-azure-helpers v0.57.0 h1:85CWEUtIjMtx8DaXisFbEb2GCWR4S2UZlYvJpSPYoZ4= +github.com/hashicorp/go-azure-helpers v0.57.0/go.mod h1:BQUQp5udwbJ8pnzl0wByCLVEEyPMAFpJ9vOREiCzObo= +github.com/hashicorp/go-azure-sdk v0.20230622.1085613 h1:MW3KOLRKOeWmQm27plcfBzXUSiakYmlcuSURsigyfCg= +github.com/hashicorp/go-azure-sdk v0.20230622.1085613/go.mod h1:iZrpp7qJSZxocEkr4SjslzxpDrhuRLmedyVGGcCPbhk= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/internal/acceptance/locations.go b/internal/acceptance/locations.go index 064f15cdd154..408d67d779a6 100644 --- a/internal/acceptance/locations.go +++ b/internal/acceptance/locations.go @@ -28,6 +28,7 @@ func availableLocations() Regions { os.Getenv("ARM_TEST_LOCATION_ALT2"), } + // nolint: staticcheck rand.Seed(time.Now().UnixNano()) rand.Shuffle(len(locations), func(i, j int) { locations[i], locations[j] = locations[j], locations[i] diff --git a/internal/services/apimanagement/api_management_resource.go b/internal/services/apimanagement/api_management_resource.go index 298873c139ec..05d193ffe2ad 100644 --- a/internal/services/apimanagement/api_management_resource.go +++ b/internal/services/apimanagement/api_management_resource.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -23,7 +24,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/schemaz" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -138,7 +138,7 @@ func resourceApiManagementSchema() map[string]*pluginsdk.Schema { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, @@ -190,7 +190,7 @@ func resourceApiManagementSchema() map[string]*pluginsdk.Schema { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, @@ -1809,7 +1809,7 @@ func flattenApiManagementVirtualNetworkConfiguration(input *apimanagement.Virtua virtualNetworkConfiguration := make(map[string]interface{}) if input.SubnetResourceID != nil { - subnetId, err := networkParse.SubnetIDInsensitively(*input.SubnetResourceID) + subnetId, err := commonids.ParseSubnetIDInsensitively(*input.SubnetResourceID) if err != nil { return []interface{}{}, err } diff --git a/internal/services/appservice/helpers/shared_schema.go b/internal/services/appservice/helpers/shared_schema.go index 22263a22a9e5..3ee7eb8ee1f9 100644 --- a/internal/services/appservice/helpers/shared_schema.go +++ b/internal/services/appservice/helpers/shared_schema.go @@ -6,8 +6,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -69,7 +69,7 @@ func IpRestrictionSchema() *pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, Description: "The Virtual Network Subnet ID used for this IP Restriction.", }, diff --git a/internal/services/appservice/linux_function_app_resource.go b/internal/services/appservice/linux_function_app_resource.go index 8da6f066210b..7e0479beae56 100644 --- a/internal/services/appservice/linux_function_app_resource.go +++ b/internal/services/appservice/linux_function_app_resource.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" kvValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -264,7 +263,7 @@ func (r LinuxFunctionAppResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "zip_deploy_file": { diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index 830c69778b77..49bd34629471 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" kvValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -253,7 +252,7 @@ func (r LinuxFunctionAppSlotResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, } } diff --git a/internal/services/appservice/linux_web_app_resource.go b/internal/services/appservice/linux_web_app_resource.go index 3be93428c3d3..ba90a64180c7 100644 --- a/internal/services/appservice/linux_web_app_resource.go +++ b/internal/services/appservice/linux_web_app_resource.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -145,7 +144,7 @@ func (r LinuxWebAppResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), diff --git a/internal/services/appservice/linux_web_app_slot_resource.go b/internal/services/appservice/linux_web_app_slot_resource.go index a566c2192869..3afc24be6e0a 100644 --- a/internal/services/appservice/linux_web_app_slot_resource.go +++ b/internal/services/appservice/linux_web_app_slot_resource.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -156,7 +155,7 @@ func (r LinuxWebAppSlotResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), diff --git a/internal/services/appservice/windows_function_app_resource.go b/internal/services/appservice/windows_function_app_resource.go index 618436beaa24..0d457baad62e 100644 --- a/internal/services/appservice/windows_function_app_resource.go +++ b/internal/services/appservice/windows_function_app_resource.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" kvValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -264,7 +263,7 @@ func (r WindowsFunctionAppResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "zip_deploy_file": { diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index 2ec7c707d624..59bf3728885e 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" kvValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -253,7 +252,7 @@ func (r WindowsFunctionAppSlotResource) Arguments() map[string]*pluginsdk.Schema "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, } } diff --git a/internal/services/appservice/windows_web_app_resource.go b/internal/services/appservice/windows_web_app_resource.go index 71926097bf80..382d57bdc021 100644 --- a/internal/services/appservice/windows_web_app_resource.go +++ b/internal/services/appservice/windows_web_app_resource.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -170,7 +169,7 @@ func (r WindowsWebAppResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, } } diff --git a/internal/services/appservice/windows_web_app_slot_resource.go b/internal/services/appservice/windows_web_app_slot_resource.go index fdf93a77d06f..045e47a0b150 100644 --- a/internal/services/appservice/windows_web_app_slot_resource.go +++ b/internal/services/appservice/windows_web_app_slot_resource.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -181,7 +180,7 @@ func (r WindowsWebAppSlotResource) Arguments() map[string]*pluginsdk.Schema { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, } } diff --git a/internal/services/cognitive/cognitive_account_resource.go b/internal/services/cognitive/cognitive_account_resource.go index a12b240b00cb..8369245e61a0 100644 --- a/internal/services/cognitive/cognitive_account_resource.go +++ b/internal/services/cognitive/cognitive_account_resource.go @@ -7,6 +7,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -22,7 +23,6 @@ import ( keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/set" @@ -345,7 +345,7 @@ func resourceCognitiveAccountCreate(d *pluginsdk.ResourceData, meta interface{}) // also lock on the Virtual Network ID's since modifications in the networking stack are exclusive virtualNetworkNames := make([]string, 0) for _, v := range subnetIds { - id, err := networkParse.SubnetIDInsensitively(v) + id, err := commonids.ParseSubnetIDInsensitively(v) if err != nil { return err } @@ -432,7 +432,7 @@ func resourceCognitiveAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) // also lock on the Virtual Network ID's since modifications in the networking stack are exclusive virtualNetworkNames := make([]string, 0) for _, v := range subnetIds { - id, err := networkParse.SubnetIDInsensitively(v) + id, err := commonids.ParseSubnetIDInsensitively(v) if err != nil { return err } @@ -807,7 +807,7 @@ func flattenCognitiveAccountNetworkAcls(input *cognitiveservicesaccounts.Network if input.VirtualNetworkRules != nil { for _, v := range *input.VirtualNetworkRules { id := v.Id - subnetId, err := networkParse.SubnetIDInsensitively(v.Id) + subnetId, err := commonids.ParseSubnetIDInsensitively(v.Id) if err == nil { id = subnetId.ID() } diff --git a/internal/services/compute/orchestrated_virtual_machine_scale_set.go b/internal/services/compute/orchestrated_virtual_machine_scale_set.go index 15c19bcede6d..94a98c5c651d 100644 --- a/internal/services/compute/orchestrated_virtual_machine_scale_set.go +++ b/internal/services/compute/orchestrated_virtual_machine_scale_set.go @@ -5,6 +5,7 @@ import ( "regexp" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" @@ -364,7 +365,7 @@ func orchestratedVirtualMachineScaleSetIPConfigurationSchema() *pluginsdk.Schema "subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "version": { diff --git a/internal/services/compute/virtual_machine_scale_set.go b/internal/services/compute/virtual_machine_scale_set.go index e751daadbb2b..1e9b74fc3e6d 100644 --- a/internal/services/compute/virtual_machine_scale_set.go +++ b/internal/services/compute/virtual_machine_scale_set.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplicationversions" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" @@ -665,7 +666,7 @@ func virtualMachineScaleSetIPConfigurationSchema() *pluginsdk.Schema { "subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "version": { diff --git a/internal/services/containerapps/container_app_environment_resource.go b/internal/services/containerapps/container_app_environment_resource.go index 7d09e33c3a09..ebeda9081ae0 100644 --- a/internal/services/containerapps/container_app_environment_resource.go +++ b/internal/services/containerapps/container_app_environment_resource.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -14,7 +15,6 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) @@ -76,7 +76,7 @@ func (r ContainerAppEnvironmentResource) Arguments() map[string]*pluginsdk.Schem Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, Description: "The existing Subnet to use for the Container Apps Control Plane. **NOTE:** The Subnet must have a `/21` or larger address space.", }, diff --git a/internal/services/containers/container_group_resource.go b/internal/services/containers/container_group_resource.go index 051e6c271e7c..85c333e8720a 100644 --- a/internal/services/containers/container_group_resource.go +++ b/internal/services/containers/container_group_resource.go @@ -22,8 +22,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/locks" keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -138,7 +136,7 @@ func resourceContainerGroup() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, Set: pluginsdk.HashString, ConflictsWith: []string{"dns_name_label"}, @@ -751,7 +749,7 @@ func resourceContainerGroupCreate(d *pluginsdk.ResourceData, meta interface{}) e // Avoid parallel provisioning if "subnet_ids" are given. if subnets != nil && len(*subnets) != 0 { for _, item := range *subnets { - subnet, err := networkParse.SubnetID(item.Id) + subnet, err := commonids.ParseSubnetID(item.Id) if err != nil { return fmt.Errorf(`parsing subnet id %q: %v`, item.Id, err) } @@ -963,7 +961,7 @@ func resourceContainerGroupDelete(d *pluginsdk.ResourceData, meta interface{}) e if subnetIDs := props.SubnetIds; subnetIDs != nil && len(*subnetIDs) != 0 { // Avoid parallel deletion if "subnet_ids" are given. for _, item := range *subnetIDs { - subnet, err := networkParse.SubnetID(item.Id) + subnet, err := commonids.ParseSubnetID(item.Id) if err != nil { return fmt.Errorf(`parsing subnet id %q: %v`, item.Id, err) } @@ -2010,7 +2008,7 @@ func flattenContainerGroupSubnets(input *[]containerinstance.ContainerGroupSubne continue } - id, err := networkParse.SubnetIDInsensitively(resourceRef.Id) + id, err := commonids.ParseSubnetIDInsensitively(resourceRef.Id) if err != nil { return nil, fmt.Errorf(`parsing subnet id %q: %v`, resourceRef.Id, err) } @@ -2028,7 +2026,7 @@ func expandContainerGroupSubnets(input []interface{}) (*[]containerinstance.Cont results := make([]containerinstance.ContainerGroupSubnetId, 0) for _, item := range input { - id, err := networkParse.SubnetID(item.(string)) + id, err := commonids.ParseSubnetID(item.(string)) if err != nil { return nil, fmt.Errorf(`parsing subnet id %q: %v`, item, err) } diff --git a/internal/services/containers/container_registry_agent_pool_resource.go b/internal/services/containers/container_registry_agent_pool_resource.go index df74ffdf544f..8b8f1426ee4c 100644 --- a/internal/services/containers/container_registry_agent_pool_resource.go +++ b/internal/services/containers/container_registry_agent_pool_resource.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -14,7 +15,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" validate2 "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -82,7 +82,7 @@ func resourceContainerRegistryAgentPool() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "tags": commonschema.Tags(), diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index 0109de68872a..262db7a383df 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -25,7 +25,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/migration" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -1058,7 +1057,7 @@ func resourceContainerRegistrySchema() map[string]*pluginsdk.Schema { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, diff --git a/internal/services/containers/kubernetes_addons.go b/internal/services/containers/kubernetes_addons.go index 609387adfcb6..60d8c77e702a 100644 --- a/internal/services/containers/kubernetes_addons.go +++ b/internal/services/containers/kubernetes_addons.go @@ -5,12 +5,12 @@ import ( "strings" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" commonValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" applicationGatewayValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" - subnetValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -193,7 +193,7 @@ func schemaKubernetesAddOns() map[string]*pluginsdk.Schema { "ingress_application_gateway.0.subnet_cidr", "ingress_application_gateway.0.subnet_id", }, - ValidateFunc: subnetValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "effective_gateway_id": { Type: pluginsdk.TypeString, diff --git a/internal/services/containers/kubernetes_cluster_data_source.go b/internal/services/containers/kubernetes_cluster_data_source.go index 77115ce64f6d..ad586f3fa626 100644 --- a/internal/services/containers/kubernetes_cluster_data_source.go +++ b/internal/services/containers/kubernetes_cluster_data_source.go @@ -683,7 +683,7 @@ func dataSourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{} ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := managedclusters.NewManagedClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + id := commonids.NewKubernetesClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) resp, err := client.Get(ctx, id) if err != nil { if response.WasNotFound(resp.HttpResponse) { diff --git a/internal/services/containers/kubernetes_cluster_extension_resource.go b/internal/services/containers/kubernetes_cluster_extension_resource.go index 9308c56c12af..2cba9d06e524 100644 --- a/internal/services/containers/kubernetes_cluster_extension_resource.go +++ b/internal/services/containers/kubernetes_cluster_extension_resource.go @@ -8,9 +8,9 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/extensions" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -71,7 +71,7 @@ func (r KubernetesClusterExtensionResource) Arguments() map[string]*pluginsdk.Sc Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: managedclusters.ValidateManagedClusterID, + ValidateFunc: commonids.ValidateKubernetesClusterID, }, "extension_type": { @@ -204,7 +204,7 @@ func (r KubernetesClusterExtensionResource) Create() sdk.ResourceFunc { client := metadata.Client.Containers.KubernetesExtensionsClient subscriptionId := metadata.Client.Account.SubscriptionId - clusterID, err := managedclusters.ParseManagedClusterID(model.ClusterID) + clusterID, err := commonids.ParseKubernetesClusterID(model.ClusterID) if err != nil { return err } @@ -331,7 +331,7 @@ func (r KubernetesClusterExtensionResource) Read() sdk.ResourceFunc { state := KubernetesClusterExtensionModel{ Name: id.ExtensionName, - ClusterID: managedclusters.NewManagedClusterID(metadata.Client.Account.SubscriptionId, id.ResourceGroupName, id.ClusterName).ID(), + ClusterID: commonids.NewKubernetesClusterID(metadata.Client.Account.SubscriptionId, id.ResourceGroupName, id.ClusterName).ID(), } if model := resp.Model; model != nil { diff --git a/internal/services/containers/kubernetes_cluster_node_pool_data_source.go b/internal/services/containers/kubernetes_cluster_node_pool_data_source.go index 8fdb4f638c08..e6108a9e134b 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_data_source.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_data_source.go @@ -5,11 +5,11 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -165,7 +165,7 @@ func dataSourceKubernetesClusterNodePoolRead(d *pluginsdk.ResourceData, meta int ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - clusterId := managedclusters.NewManagedClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("kubernetes_cluster_name").(string)) + clusterId := commonids.NewKubernetesClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("kubernetes_cluster_name").(string)) // if the parent cluster doesn't exist then the node pool won't cluster, err := clustersClient.Get(ctx, clusterId) diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource.go b/internal/services/containers/kubernetes_cluster_node_pool_resource.go index 383c01865c44..63a33a450373 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource.go @@ -9,6 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" @@ -25,7 +26,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -279,7 +279,7 @@ func resourceKubernetesClusterNodePoolSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "priority": { @@ -336,7 +336,7 @@ func resourceKubernetesClusterNodePoolSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "upgrade_settings": upgradeSettingsSchema(), @@ -390,7 +390,7 @@ func resourceKubernetesClusterNodePoolCreate(d *pluginsdk.ResourceData, meta int ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - clusterId, err := managedclusters.ParseManagedClusterID(d.Get("kubernetes_cluster_id").(string)) + clusterId, err := commonids.ParseKubernetesClusterID(d.Get("kubernetes_cluster_id").(string)) if err != nil { return err } @@ -802,7 +802,7 @@ func resourceKubernetesClusterNodePoolRead(d *pluginsdk.ResourceData, meta inter } // if the parent cluster doesn't exist then the node pool won't - clusterId := managedclusters.NewManagedClusterID(id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) + clusterId := commonids.NewKubernetesClusterID(id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) cluster, err := clustersClient.Get(ctx, clusterId) if err != nil { if response.WasNotFound(cluster.HttpResponse) { diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go index f7c8a8febcc3..d6a54f46a684 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/snapshots" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -1049,7 +1049,7 @@ func (KubernetesClusterNodePoolResource) scaleNodePool(nodeCount int) acceptance return func(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) error { nodePoolName := state.Attributes["name"] kubernetesClusterId := state.Attributes["kubernetes_cluster_id"] - parsedK8sId, err := managedclusters.ParseManagedClusterID(kubernetesClusterId) + parsedK8sId, err := commonids.ParseKubernetesClusterID(kubernetesClusterId) if err != nil { return fmt.Errorf("parsing kubernetes cluster id: %+v", err) } diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index ac5a564233bc..1d695846a014 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -35,7 +35,6 @@ import ( keyVaultClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/client" keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" resourcesClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" @@ -52,7 +51,7 @@ func resourceKubernetesCluster() *pluginsdk.Resource { Delete: resourceKubernetesClusterDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := managedclusters.ParseManagedClusterID(id) + _, err := commonids.ParseKubernetesClusterID(id) return err }), @@ -134,7 +133,7 @@ func resourceKubernetesCluster() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "authorized_ip_ranges": { @@ -1335,7 +1334,7 @@ func resourceKubernetesClusterCreate(d *pluginsdk.ResourceData, meta interface{} log.Printf("[INFO] preparing arguments for Managed Kubernetes Cluster create.") - id := managedclusters.NewManagedClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + id := commonids.NewKubernetesClusterID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) existing, err := client.Get(ctx, id) if err != nil { if !response.WasNotFound(existing.HttpResponse) { @@ -1610,7 +1609,7 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{} ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := managedclusters.ParseManagedClusterID(d.Id()) + id, err := commonids.ParseKubernetesClusterID(d.Id()) if err != nil { return err } @@ -2220,7 +2219,7 @@ func resourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{}) ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := managedclusters.ParseManagedClusterID(d.Id()) + id, err := commonids.ParseKubernetesClusterID(d.Id()) if err != nil { return err } @@ -2520,7 +2519,7 @@ func resourceKubernetesClusterDelete(d *pluginsdk.ResourceData, meta interface{} ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := managedclusters.ParseManagedClusterID(d.Id()) + id, err := commonids.ParseKubernetesClusterID(d.Id()) if err != nil { return err } diff --git a/internal/services/containers/kubernetes_cluster_resource_test.go b/internal/services/containers/kubernetes_cluster_resource_test.go index caa9cc944361..455749516656 100644 --- a/internal/services/containers/kubernetes_cluster_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_resource_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -199,7 +199,7 @@ func TestAccKubernetesCluster_edgeZone(t *testing.T) { } func (t KubernetesClusterResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := managedclusters.ParseManagedClusterID(state.ID) + id, err := commonids.ParseKubernetesClusterID(state.ID) if err != nil { return nil, err } diff --git a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go index 115d80f8379f..07188bd62727 100644 --- a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" @@ -50,7 +50,7 @@ func TestAccKubernetesCluster_updateVmSizeAfterFailureWithTempAndDefault(t *test data.CheckWithClientForResource(func(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) error { client := clients.Containers.AgentPoolsClient - id, err := managedclusters.ParseManagedClusterID(state.Attributes["id"]) + id, err := commonids.ParseKubernetesClusterID(state.Attributes["id"]) if err != nil { return err } @@ -103,7 +103,7 @@ func TestAccKubernetesCluster_updateVmSizeAfterFailureWithTempWithoutDefault(t * data.CheckWithClientForResource(func(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) error { client := clients.Containers.AgentPoolsClient - id, err := managedclusters.ParseManagedClusterID(state.Attributes["id"]) + id, err := commonids.ParseKubernetesClusterID(state.Attributes["id"]) if err != nil { return err } diff --git a/internal/services/containers/kubernetes_cluster_validate.go b/internal/services/containers/kubernetes_cluster_validate.go index 7a052e593340..61196edc5a52 100644 --- a/internal/services/containers/kubernetes_cluster_validate.go +++ b/internal/services/containers/kubernetes_cluster_validate.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" @@ -265,7 +266,7 @@ details can be found at https://aka.ms/version-skew-policy. func validateNodePoolSupportsVersion(ctx context.Context, client *client.Client, currentNodePoolVersion string, defaultNodePoolId agentpools.AgentPoolId, desiredNodePoolVersion string) error { // confirm the version being used is >= the version of the control plane - clusterId := agentpools.NewManagedClusterID(defaultNodePoolId.SubscriptionId, defaultNodePoolId.ResourceGroupName, defaultNodePoolId.ManagedClusterName) + clusterId := commonids.NewKubernetesClusterID(defaultNodePoolId.SubscriptionId, defaultNodePoolId.ResourceGroupName, defaultNodePoolId.ManagedClusterName) resp, err := client.AgentPoolsClient.GetAvailableAgentPoolVersions(ctx, clusterId) if err != nil { return fmt.Errorf("retrieving Available Agent Pool Versions for %s: %+v", defaultNodePoolId, err) @@ -295,7 +296,7 @@ func validateNodePoolSupportsVersion(ctx context.Context, client *client.Client, } if !versionExists { - clusterId := managedclusters.NewManagedClusterID(defaultNodePoolId.SubscriptionId, defaultNodePoolId.ResourceGroupName, defaultNodePoolId.ManagedClusterName) + clusterId := commonids.NewKubernetesClusterID(defaultNodePoolId.SubscriptionId, defaultNodePoolId.ResourceGroupName, defaultNodePoolId.ManagedClusterName) cluster, err := client.KubernetesClustersClient.Get(ctx, clusterId) if err != nil { if !response.WasStatusCode(cluster.HttpResponse, http.StatusUnauthorized) { diff --git a/internal/services/containers/kubernetes_flux_configuration_resource.go b/internal/services/containers/kubernetes_flux_configuration_resource.go index bb9ba99f67d6..3844a0ac8b0f 100644 --- a/internal/services/containers/kubernetes_flux_configuration_resource.go +++ b/internal/services/containers/kubernetes_flux_configuration_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/fluxconfiguration" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -134,7 +134,7 @@ func (r KubernetesFluxConfigurationResource) Arguments() map[string]*pluginsdk.S Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: managedclusters.ValidateManagedClusterID, + ValidateFunc: commonids.ValidateKubernetesClusterID, }, "kustomizations": { @@ -530,7 +530,7 @@ func (r KubernetesFluxConfigurationResource) Create() sdk.ResourceFunc { client := metadata.Client.Containers.KubernetesFluxConfigurationClient subscriptionId := metadata.Client.Account.SubscriptionId - clusterID, err := managedclusters.ParseManagedClusterID(model.ClusterID) + clusterID, err := commonids.ParseKubernetesClusterID(model.ClusterID) if err != nil { return err } @@ -699,7 +699,7 @@ func (r KubernetesFluxConfigurationResource) Read() sdk.ResourceFunc { state := KubernetesFluxConfigurationModel{ Name: id.FluxConfigurationName, - ClusterID: managedclusters.NewManagedClusterID(metadata.Client.Account.SubscriptionId, id.ResourceGroupName, id.ClusterName).ID(), + ClusterID: commonids.NewKubernetesClusterID(metadata.Client.Account.SubscriptionId, id.ResourceGroupName, id.ClusterName).ID(), } if model := resp.Model; model != nil { diff --git a/internal/services/containers/kubernetes_nodepool.go b/internal/services/containers/kubernetes_nodepool.go index 78c3022abcc4..777b9f1bc19f 100644 --- a/internal/services/containers/kubernetes_nodepool.go +++ b/internal/services/containers/kubernetes_nodepool.go @@ -7,6 +7,7 @@ import ( "strconv" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" @@ -215,7 +216,7 @@ func SchemaDefaultNodePool() *pluginsdk.Schema { "vnet_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "orchestrator_version": { Type: pluginsdk.TypeString, @@ -226,7 +227,7 @@ func SchemaDefaultNodePool() *pluginsdk.Schema { "pod_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "proximity_placement_group_id": { Type: pluginsdk.TypeString, diff --git a/internal/services/cosmos/cosmosdb_cassandra_cluster_resource.go b/internal/services/cosmos/cosmosdb_cassandra_cluster_resource.go index 403a58e34fe3..cb16dcd084c9 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_cluster_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_cluster_resource.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -18,7 +19,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/attestation/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -60,7 +60,7 @@ func resourceCassandraCluster() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "default_admin_password": { diff --git a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go index aa69537014ea..8a3973ad56a7 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -16,7 +17,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -63,7 +63,7 @@ func resourceCassandraDatacenter() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "backup_storage_customer_key_uri": { diff --git a/internal/services/databasemigration/database_migration_service_resource.go b/internal/services/databasemigration/database_migration_service_resource.go index f915989afe2e..26f38b024751 100644 --- a/internal/services/databasemigration/database_migration_service_resource.go +++ b/internal/services/databasemigration/database_migration_service_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -14,7 +15,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databasemigration/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -56,7 +56,7 @@ func resourceDatabaseMigrationService() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "sku_name": { diff --git a/internal/services/databricks/databricks_virtual_network_peering_resource.go b/internal/services/databricks/databricks_virtual_network_peering_resource.go index fc8e92f3f791..d65ddbec48d4 100644 --- a/internal/services/databricks/databricks_virtual_network_peering_resource.go +++ b/internal/services/databricks/databricks_virtual_network_peering_resource.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2023-02-01/vnetpeering" "github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2023-02-01/workspaces" @@ -14,8 +15,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databricks/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -73,7 +72,7 @@ func resourceDatabricksVirtualNetworkPeering() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "address_space_prefixes": { @@ -164,7 +163,7 @@ func resourceDatabricksVirtualNetworkPeeringCreate(d *pluginsdk.ResourceData, me // The RP always creates the same vNet ID for the Databricks internal vNet in the below format: // '/subscriptions/{subscription}/resourceGroups/{group1}/providers/Microsoft.Network/virtualNetworks/workers-vnet' DatabricksVirtualNetwork: &vnetpeering.VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork{ - Id: utils.String(networkParse.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroupName, "workers-vnet").ID()), + Id: utils.String(commonids.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroupName, "workers-vnet").ID()), }, RemoteAddressSpace: &vnetpeering.AddressSpace{ AddressPrefixes: remoteAddressSpace, diff --git a/internal/services/databricks/databricks_workspace_resource.go b/internal/services/databricks/databricks_workspace_resource.go index 586f1a200f98..5aff28f54cc0 100644 --- a/internal/services/databricks/databricks_workspace_resource.go +++ b/internal/services/databricks/databricks_workspace_resource.go @@ -8,6 +8,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -22,7 +23,6 @@ import ( loadBalancerParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" loadBalancerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" machineLearningValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" resourcesParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/parse" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -230,7 +230,7 @@ func resourceDatabricksWorkspace() *pluginsdk.Resource { Type: pluginsdk.TypeString, ForceNew: true, Optional: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, AtLeastOneOf: workspaceCustomParametersString(), }, diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go index 0f50c85f1c24..3713669ffd7d 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -122,7 +123,7 @@ func resourceDataFactoryIntegrationRuntimeAzureSsis() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, @@ -154,7 +155,7 @@ func resourceDataFactoryIntegrationRuntimeAzureSsis() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ExactlyOneOf: []string{"vnet_integration.0.vnet_id", "vnet_integration.0.subnet_id"}, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "subnet_name": { Type: pluginsdk.TypeString, diff --git a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go index 0e8d1ff66ab2..130e61483315 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go @@ -6,13 +6,13 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -134,7 +134,7 @@ func resourceDataFactoryIntegrationRuntimeManaged() *pluginsdk.Resource { "vnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "subnet_name": { Type: pluginsdk.TypeString, diff --git a/internal/services/disks/disk_pool_resource.go b/internal/services/disks/disk_pool_resource.go index 7301d03a0d30..79309d00a935 100644 --- a/internal/services/disks/disk_pool_resource.go +++ b/internal/services/disks/disk_pool_resource.go @@ -7,6 +7,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -16,7 +17,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" disksValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/disks/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) @@ -63,7 +63,7 @@ func (DiskPoolResource) Arguments() map[string]*schema.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "tags": commonschema.Tags(), diff --git a/internal/services/domainservices/active_directory_domain_service_replica_set_resource.go b/internal/services/domainservices/active_directory_domain_service_replica_set_resource.go index 19774111b5ff..cdf618a83814 100644 --- a/internal/services/domainservices/active_directory_domain_service_replica_set_resource.go +++ b/internal/services/domainservices/active_directory_domain_service_replica_set_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices" @@ -14,7 +15,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/domainservices/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/domainservices/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -52,7 +52,7 @@ func resourceActiveDirectoryDomainServiceReplicaSet() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "domain_controller_ip_addresses": { diff --git a/internal/services/domainservices/active_directory_domain_service_resource.go b/internal/services/domainservices/active_directory_domain_service_resource.go index 0381102e269f..36d0f1bb2bbf 100644 --- a/internal/services/domainservices/active_directory_domain_service_resource.go +++ b/internal/services/domainservices/active_directory_domain_service_resource.go @@ -8,6 +8,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -18,7 +19,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/domainservices/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/domainservices/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -102,7 +102,7 @@ func resourceActiveDirectoryDomainService() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, diff --git a/internal/services/eventhub/eventhub_namespace_resource.go b/internal/services/eventhub/eventhub_namespace_resource.go index 5f08e9fa0b83..19688e5b5e0e 100644 --- a/internal/services/eventhub/eventhub_namespace_resource.go +++ b/internal/services/eventhub/eventhub_namespace_resource.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -24,8 +25,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -161,7 +160,7 @@ func resourceEventHubNamespace() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, DiffSuppressFunc: suppress.CaseDifference, }, @@ -702,7 +701,7 @@ func flattenEventHubNamespaceNetworkRuleset(ruleset networkrulesets.NamespacesGe // the API returns the subnet ID's resource group name in lowercase // https://github.com/Azure/azure-sdk-for-go/issues/5855 // for some reason the DiffSuppressFunc for `subnet_id` isn't working as intended, so we'll also flatten the id insensitively - subnetId, err := parse.SubnetIDInsensitively(*v) + subnetId, err := commonids.ParseSubnetIDInsensitively(*v) if err != nil { return nil, fmt.Errorf("parsing `subnet_id`: %+v", err) } diff --git a/internal/services/firewall/firewall_resource.go b/internal/services/firewall/firewall_resource.go index 798b5fad539c..ad40c4b1ceb8 100644 --- a/internal/services/firewall/firewall_resource.go +++ b/internal/services/firewall/firewall_resource.go @@ -6,6 +6,7 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" @@ -17,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall/azuresdkhacks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -478,13 +478,13 @@ func resourceFirewallDelete(d *pluginsdk.ResourceData, meta interface{}) error { continue } - parsedSubnetID, err2 := networkParse.SubnetID(*config.Subnet.ID) + parsedSubnetID, err2 := commonids.ParseSubnetID(*config.Subnet.ID) if err2 != nil { return err2 } - if !utils.SliceContainsValue(subnetNamesToLock, parsedSubnetID.Name) { - subnetNamesToLock = append(subnetNamesToLock, parsedSubnetID.Name) + if !utils.SliceContainsValue(subnetNamesToLock, parsedSubnetID.SubnetName) { + subnetNamesToLock = append(subnetNamesToLock, parsedSubnetID.SubnetName) } if !utils.SliceContainsValue(virtualNetworkNamesToLock, parsedSubnetID.VirtualNetworkName) { @@ -495,13 +495,13 @@ func resourceFirewallDelete(d *pluginsdk.ResourceData, meta interface{}) error { if mconfig := props.ManagementIPConfiguration; mconfig != nil { if mconfig.Subnet != nil && mconfig.Subnet.ID != nil { - parsedSubnetID, err2 := networkParse.SubnetID(*mconfig.Subnet.ID) + parsedSubnetID, err2 := commonids.ParseSubnetID(*mconfig.Subnet.ID) if err2 != nil { return err2 } - if !utils.SliceContainsValue(subnetNamesToLock, parsedSubnetID.Name) { - subnetNamesToLock = append(subnetNamesToLock, parsedSubnetID.Name) + if !utils.SliceContainsValue(subnetNamesToLock, parsedSubnetID.SubnetName) { + subnetNamesToLock = append(subnetNamesToLock, parsedSubnetID.SubnetName) } if !utils.SliceContainsValue(virtualNetworkNamesToLock, parsedSubnetID.VirtualNetworkName) { @@ -562,13 +562,13 @@ func expandFirewallIPConfigurations(configs []interface{}) (*[]network.AzureFire } if subnetId != "" { - subnetID, err := networkParse.SubnetID(subnetId) + subnetID, err := commonids.ParseSubnetID(subnetId) if err != nil { return nil, nil, nil, err } - if !utils.SliceContainsValue(subnetNamesToLock, subnetID.Name) { - subnetNamesToLock = append(subnetNamesToLock, subnetID.Name) + if !utils.SliceContainsValue(subnetNamesToLock, subnetID.SubnetName) { + subnetNamesToLock = append(subnetNamesToLock, subnetID.SubnetName) } if !utils.SliceContainsValue(virtualNetworkNamesToLock, subnetID.VirtualNetworkName) { diff --git a/internal/services/firewall/validate/firewall_management_subnet_name.go b/internal/services/firewall/validate/firewall_management_subnet_name.go index ad49c0e4fddd..307a917d991d 100644 --- a/internal/services/firewall/validate/firewall_management_subnet_name.go +++ b/internal/services/firewall/validate/firewall_management_subnet_name.go @@ -3,17 +3,17 @@ package validate import ( "fmt" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) func FirewallManagementSubnetName(v interface{}, k string) (warnings []string, errors []error) { - parsed, err := networkParse.SubnetID(v.(string)) + parsed, err := commonids.ParseSubnetID(v.(string)) if err != nil { errors = append(errors, fmt.Errorf("parsing %q: %+v", v.(string), err)) return warnings, errors } - if parsed.Name != "AzureFirewallManagementSubnet" { + if parsed.SubnetName != "AzureFirewallManagementSubnet" { errors = append(errors, fmt.Errorf("The name of the management subnet for %q must be exactly 'AzureFirewallManagementSubnet' to be used for the Azure Firewall resource", k)) } diff --git a/internal/services/firewall/validate/firewall_subnet_name.go b/internal/services/firewall/validate/firewall_subnet_name.go index 5a0e22a198a0..5127225a93de 100644 --- a/internal/services/firewall/validate/firewall_subnet_name.go +++ b/internal/services/firewall/validate/firewall_subnet_name.go @@ -3,17 +3,17 @@ package validate import ( "fmt" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) func FirewallSubnetName(v interface{}, k string) (warnings []string, errors []error) { - parsed, err := networkParse.SubnetID(v.(string)) + parsed, err := commonids.ParseSubnetID(v.(string)) if err != nil { errors = append(errors, fmt.Errorf("parsing %q: %+v", v.(string), err)) return warnings, errors } - if parsed.Name != "AzureFirewallSubnet" { + if parsed.SubnetName != "AzureFirewallSubnet" { errors = append(errors, fmt.Errorf("The name of the Subnet for %q must be exactly 'AzureFirewallSubnet' to be used for the Azure Firewall resource", k)) } diff --git a/internal/services/hdinsight/schema.go b/internal/services/hdinsight/schema.go index 5b602c9a58d8..3925d127fec6 100644 --- a/internal/services/hdinsight/schema.go +++ b/internal/services/hdinsight/schema.go @@ -14,7 +14,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/hdinsight/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVault "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -1062,14 +1061,14 @@ func SchemaHDInsightNodeDefinition(schemaLocation string, definition HDInsightNo Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "virtual_network_id": { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "script_actions": SchemaHDInsightsScriptActions(), diff --git a/internal/services/hpccache/hpc_cache_resource.go b/internal/services/hpccache/hpc_cache_resource.go index a08298910b4f..aa22d4444f94 100644 --- a/internal/services/hpccache/hpc_cache_resource.go +++ b/internal/services/hpccache/hpc_cache_resource.go @@ -22,7 +22,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/client" keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" resourcesClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -733,7 +732,7 @@ func resourceHPCCacheSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "sku_name": { diff --git a/internal/services/hpccache/hpc_cache_resource_test.go b/internal/services/hpccache/hpc_cache_resource_test.go index 22c0964601fb..3af01e6a0185 100644 --- a/internal/services/hpccache/hpc_cache_resource_test.go +++ b/internal/services/hpccache/hpc_cache_resource_test.go @@ -7,18 +7,18 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2023-01-01/caches" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) type HPCCacheResource struct{} type HPCCacheDirectoryADInfo struct { - SubnetID networkParse.SubnetId + SubnetID commonids.SubnetId PrimaryDNS string DomainName string @@ -233,7 +233,7 @@ func TestAccHPCCache_directoryAD(t *testing.T) { } } - subnetId, err := networkParse.SubnetID(os.Getenv(adSubnetIDEnv)) + subnetId, err := commonids.ParseSubnetID(os.Getenv(adSubnetIDEnv)) if err != nil { t.Fatal(err) } @@ -610,7 +610,7 @@ resource "azurerm_hpc_cache" "test" { subnet_id = data.azurerm_subnet.test.id sku_name = "Standard_2G" } -`, info.SubnetID.ResourceGroup, info.SubnetID.ResourceGroup, info.SubnetID.VirtualNetworkName, info.SubnetID.Name, +`, info.SubnetID.ResourceGroupName, info.SubnetID.ResourceGroupName, info.SubnetID.VirtualNetworkName, info.SubnetID.SubnetName, data.RandomInteger) } @@ -646,7 +646,7 @@ resource "azurerm_hpc_cache" "test" { password = "%s" } } -`, info.SubnetID.ResourceGroup, info.SubnetID.ResourceGroup, info.SubnetID.VirtualNetworkName, info.SubnetID.Name, +`, info.SubnetID.ResourceGroupName, info.SubnetID.ResourceGroupName, info.SubnetID.VirtualNetworkName, info.SubnetID.SubnetName, data.RandomInteger, info.PrimaryDNS, info.DomainName, info.CacheNetBiosName, info.DomainNetBiosName, info.Username, info.Password) } diff --git a/internal/services/hsm/dedicated_hardware_security_module_resource.go b/internal/services/hsm/dedicated_hardware_security_module_resource.go index 6b29493c5759..1776c6f161ca 100644 --- a/internal/services/hsm/dedicated_hardware_security_module_resource.go +++ b/internal/services/hsm/dedicated_hardware_security_module_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -15,7 +16,6 @@ import ( azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/hsm/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -88,7 +88,7 @@ func resourceDedicatedHardwareSecurityModule() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, @@ -114,7 +114,7 @@ func resourceDedicatedHardwareSecurityModule() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, diff --git a/internal/services/keyvault/key_vault_resource.go b/internal/services/keyvault/key_vault_resource.go index 509087bf174e..aa3a2d28bbb8 100644 --- a/internal/services/keyvault/key_vault_resource.go +++ b/internal/services/keyvault/key_vault_resource.go @@ -22,7 +22,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/set" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -341,7 +340,7 @@ func resourceKeyVaultCreate(d *pluginsdk.ResourceData, meta interface{}) error { // also lock on the Virtual Network ID's since modifications in the networking stack are exclusive virtualNetworkNames := make([]string, 0) for _, v := range subnetIds { - id, err := networkParse.SubnetIDInsensitively(v) + id, err := commonids.ParseSubnetIDInsensitively(v) if err != nil { return err } @@ -485,7 +484,7 @@ func resourceKeyVaultUpdate(d *pluginsdk.ResourceData, meta interface{}) error { // also lock on the Virtual Network ID's since modifications in the networking stack are exclusive virtualNetworkNames := make([]string, 0) for _, v := range subnetIds { - id, err := networkParse.SubnetIDInsensitively(v) + id, err := commonids.ParseSubnetIDInsensitively(v) if err != nil { return err } @@ -756,7 +755,7 @@ func resourceKeyVaultDelete(d *pluginsdk.ResourceData, meta interface{}) error { if acls := model.Properties.NetworkAcls; acls != nil { if rules := acls.VirtualNetworkRules; rules != nil { for _, v := range *rules { - subnetId, err := networkParse.SubnetIDInsensitively(v.Id) + subnetId, err := commonids.ParseSubnetIDInsensitively(v.Id) if err != nil { return err } @@ -911,7 +910,7 @@ func flattenKeyVaultNetworkAcls(input *vaults.NetworkRuleSet) []interface{} { if input.VirtualNetworkRules != nil { for _, v := range *input.VirtualNetworkRules { subnetIdRaw := v.Id - subnetId, err := networkParse.SubnetIDInsensitively(subnetIdRaw) + subnetId, err := commonids.ParseSubnetIDInsensitively(subnetIdRaw) if err == nil { subnetIdRaw = subnetId.ID() } diff --git a/internal/services/kusto/kusto_cluster_resource.go b/internal/services/kusto/kusto_cluster_resource.go index 5657005830cc..b91507038455 100644 --- a/internal/services/kusto/kusto_cluster_resource.go +++ b/internal/services/kusto/kusto_cluster_resource.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -148,7 +149,7 @@ func resourceKustoCluster() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "engine_public_ip_id": { Type: pluginsdk.TypeString, diff --git a/internal/services/labservice/lab_service_lab_resource.go b/internal/services/labservice/lab_service_lab_resource.go index ff7f5c55ef22..1642ba1b3335 100644 --- a/internal/services/labservice/lab_service_lab_resource.go +++ b/internal/services/labservice/lab_service_lab_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/lab" @@ -14,7 +15,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" computeValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/labservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -396,7 +396,7 @@ func (r LabServiceLabResource) Arguments() map[string]*pluginsdk.Schema { "subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "load_balancer_id": { diff --git a/internal/services/labservice/lab_service_plan_resource.go b/internal/services/labservice/lab_service_plan_resource.go index 394c092baee2..e28131e73c32 100644 --- a/internal/services/labservice/lab_service_plan_resource.go +++ b/internal/services/labservice/lab_service_plan_resource.go @@ -6,6 +6,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleries" @@ -13,7 +14,6 @@ import ( azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/labservice/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -179,7 +179,7 @@ func (r LabServicePlanResource) Arguments() map[string]*pluginsdk.Schema { "default_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "shared_gallery_id": { diff --git a/internal/services/loadbalancer/backend_address_pool_address_resource.go b/internal/services/loadbalancer/backend_address_pool_address_resource.go index 8815dc6bd21d..e95113276ffd 100644 --- a/internal/services/loadbalancer/backend_address_pool_address_resource.go +++ b/internal/services/loadbalancer/backend_address_pool_address_resource.go @@ -5,11 +5,11 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -82,7 +82,7 @@ func (r BackendAddressPoolAddressResource) Arguments() map[string]*pluginsdk.Sch Optional: true, RequiredWith: []string{"ip_address"}, ConflictsWith: []string{"backend_address_ip_configuration_id"}, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, Description: "For regional load balancer, user needs to specify `virtual_network_id` and `ip_address`", }, diff --git a/internal/services/loadbalancer/backend_address_pool_resource.go b/internal/services/loadbalancer/backend_address_pool_resource.go index 9039bfcf68a7..4b0d81c0037d 100644 --- a/internal/services/loadbalancer/backend_address_pool_resource.go +++ b/internal/services/loadbalancer/backend_address_pool_resource.go @@ -5,12 +5,12 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -105,7 +105,7 @@ func resourceArmLoadBalancerBackendAddressPool() *pluginsdk.Resource { "virtual_network_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "backend_ip_configurations": { diff --git a/internal/services/loadbalancer/loadbalancer_resource.go b/internal/services/loadbalancer/loadbalancer_resource.go index 222f4c640ec1..14e45d25dd53 100644 --- a/internal/services/loadbalancer/loadbalancer_resource.go +++ b/internal/services/loadbalancer/loadbalancer_resource.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -433,7 +434,7 @@ func resourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, Computed: true, // TODO: why is this computed? - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_ip_address": { diff --git a/internal/services/logic/integration_service_environment.go b/internal/services/logic/integration_service_environment.go index ad74006530de..40d4b562b020 100644 --- a/internal/services/logic/integration_service_environment.go +++ b/internal/services/logic/integration_service_environment.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -18,8 +19,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -97,7 +96,7 @@ func resourceIntegrationServiceEnvironment() *pluginsdk.Resource { ForceNew: true, // The network configuration subnets cannot be updated after integration service environment is created. Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, MinItems: 4, MaxItems: 4, @@ -445,17 +444,17 @@ func linkExists(ctx context.Context, client *clients.Client, iseID string, subne } func serviceAssociationLinkExists(ctx context.Context, client *network.ServiceAssociationLinksClient, iseID string, subnetID string) (bool, error) { - id, err := networkParse.SubnetID(subnetID) + id, err := commonids.ParseSubnetID(subnetID) if err != nil { return false, err } - resp, err := client.List(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name) + resp, err := client.List(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return false, nil } - return false, fmt.Errorf("retrieving Service Association Links from Virtual Network %q, subnet %q (Resource Group %q): %+v", id.VirtualNetworkName, id.Name, id.ResourceGroup, err) + return false, fmt.Errorf("retrieving Service Association Links from Virtual Network %q, subnet %q (Resource Group %q): %+v", id.VirtualNetworkName, id.SubscriptionId, id.ResourceGroupName, err) } if resp.Value != nil { @@ -473,17 +472,17 @@ func serviceAssociationLinkExists(ctx context.Context, client *network.ServiceAs } func resourceNavigationLinkExists(ctx context.Context, client *network.ResourceNavigationLinksClient, subnetID string) (bool, error) { - id, err := networkParse.SubnetID(subnetID) + id, err := commonids.ParseSubnetID(subnetID) if err != nil { return false, err } - resp, err := client.List(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name) + resp, err := client.List(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return false, nil } - return false, fmt.Errorf("retrieving Resource Navigation Links from Virtual Network %q, subnet %q (Resource Group %q): %+v", id.VirtualNetworkName, id.Name, id.ResourceGroup, err) + return false, fmt.Errorf("retrieving Resource Navigation Links from Virtual Network %q, subnet %q (Resource Group %q): %+v", id.VirtualNetworkName, id.SubnetName, id.ResourceGroupName, err) } if resp.Value != nil { diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index 020e55a79d31..97bb1f4e28f3 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -8,6 +8,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -15,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -224,7 +224,7 @@ func resourceLogicAppStandard() *pluginsdk.Resource { "virtual_network_subnet_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, } diff --git a/internal/services/machinelearning/machine_learning_compute_instance_resource.go b/internal/services/machinelearning/machine_learning_compute_instance_resource.go index 979ac8bb7695..c88b1b95f783 100644 --- a/internal/services/machinelearning/machine_learning_compute_instance_resource.go +++ b/internal/services/machinelearning/machine_learning_compute_instance_resource.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -20,7 +21,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -145,7 +145,7 @@ func resourceComputeInstance() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "node_public_ip_enabled": { diff --git a/internal/services/machinelearning/machine_learning_inference_cluster_resource.go b/internal/services/machinelearning/machine_learning_inference_cluster_resource.go index 6f46384a86a8..427d3263af69 100644 --- a/internal/services/machinelearning/machine_learning_inference_cluster_resource.go +++ b/internal/services/machinelearning/machine_learning_inference_cluster_resource.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" @@ -164,7 +165,7 @@ func resourceAksInferenceClusterCreate(d *pluginsdk.ResourceData, meta interface } // Get AKS Compute Properties - aksID, err := managedclusters.ParseManagedClusterID(d.Get("kubernetes_cluster_id").(string)) + aksID, err := commonids.ParseKubernetesClusterID(d.Get("kubernetes_cluster_id").(string)) if err != nil { return err } @@ -236,7 +237,7 @@ func resourceAksInferenceClusterRead(d *pluginsdk.ResourceData, meta interface{} aksComputeProperties := computeResource.Model.Properties.(machinelearningcomputes.AKS) // Retrieve AKS Cluster ID - aksId, err := managedclusters.ParseManagedClusterIDInsensitively(*aksComputeProperties.ResourceId) + aksId, err := commonids.ParseKubernetesClusterIDInsensitively(*aksComputeProperties.ResourceId) if err != nil { return err } diff --git a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go index b0d5ef1f0810..119ed70f9034 100644 --- a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go +++ b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go @@ -7,6 +7,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -56,7 +57,7 @@ func resourceMariaDbVirtualNetworkRule() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, } diff --git a/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go b/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go index 002889773366..a5310b93d9b2 100644 --- a/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go +++ b/internal/services/mobilenetwork/mobile_network_packet_core_control_plane_resource.go @@ -9,10 +9,10 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices" "github.com/hashicorp/go-azure-sdk/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplane" "github.com/hashicorp/go-azure-sdk/resource-manager/mobilenetwork/2022-11-01/site" @@ -184,7 +184,7 @@ func (r PacketCoreControlPlaneResource) Arguments() map[string]*pluginsdk.Schema "arc_kubernetes_cluster_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: managedclusters.ValidateManagedClusterID, + ValidateFunc: commonids.ValidateKubernetesClusterID, AtLeastOneOf: []string{ "platform.0.edge_device_id", "platform.0.stack_hci_cluster_id", diff --git a/internal/services/mssql/mssql_virtual_network_rule_resource.go b/internal/services/mssql/mssql_virtual_network_rule_resource.go index 135102956867..2aa1214e3518 100644 --- a/internal/services/mssql/mssql_virtual_network_rule_resource.go +++ b/internal/services/mssql/mssql_virtual_network_rule_resource.go @@ -6,12 +6,11 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -54,7 +53,7 @@ func resourceMsSqlVirtualNetworkRule() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "ignore_missing_vnet_service_endpoint": { @@ -78,7 +77,7 @@ func resourceMsSqlVirtualNetworkRuleCreateUpdate(d *pluginsdk.ResourceData, meta id := parse.NewVirtualNetworkRuleID(serverId.SubscriptionId, serverId.ResourceGroup, serverId.Name, d.Get("name").(string)) - subnetId, err := networkParse.SubnetID(d.Get("subnet_id").(string)) + subnetId, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return fmt.Errorf("parsing subnet ID %q: %+v", d.Get("subnet_id"), err) } @@ -151,7 +150,7 @@ func resourceMsSqlVirtualNetworkRuleRead(d *pluginsdk.ResourceData, meta interfa subnetId := "" if sid := props.VirtualNetworkSubnetID; sid != nil { - id, err := networkParse.SubnetIDInsensitively(*props.VirtualNetworkSubnetID) + id, err := commonids.ParseSubnetIDInsensitively(*props.VirtualNetworkSubnetID) if err != nil { return fmt.Errorf("parsing subnet ID returned by API %q: %+v", *sid, err) } diff --git a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go index ef96c4edbb27..f258f68166e5 100644 --- a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go +++ b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go @@ -17,7 +17,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssqlmanagedinstance/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/sql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -128,7 +127,7 @@ func (r MsSqlManagedInstanceResource) Arguments() map[string]*pluginsdk.Schema { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "vcores": { diff --git a/internal/services/mysql/mysql_flexible_server_resource.go b/internal/services/mysql/mysql_flexible_server_resource.go index eeb323d3d0ab..7ebe0f722169 100644 --- a/internal/services/mysql/mysql_flexible_server_resource.go +++ b/internal/services/mysql/mysql_flexible_server_resource.go @@ -21,7 +21,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mysql/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -140,7 +139,7 @@ func resourceMysqlFlexibleServer() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "geo_redundant_backup_enabled": { diff --git a/internal/services/mysql/mysql_virtual_network_rule_resource.go b/internal/services/mysql/mysql_virtual_network_rule_resource.go index 9d6bd75af845..db12a633a010 100644 --- a/internal/services/mysql/mysql_virtual_network_rule_resource.go +++ b/internal/services/mysql/mysql_virtual_network_rule_resource.go @@ -7,6 +7,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -57,7 +58,7 @@ func resourceMySQLVirtualNetworkRule() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, } diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 4cb32811c96c..f75df5a223f8 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -19,7 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -94,7 +94,7 @@ func resourceNetAppVolume() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "create_from_snapshot_resource_id": { diff --git a/internal/services/network/application_gateway_resource.go b/internal/services/network/application_gateway_resource.go index 416621fd6597..0c8df92ac548 100644 --- a/internal/services/network/application_gateway_resource.go +++ b/internal/services/network/application_gateway_resource.go @@ -8,6 +8,7 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -402,7 +403,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "id": { @@ -598,7 +599,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_ip_address": { diff --git a/internal/services/network/network_connection_monitor_resource.go b/internal/services/network/network_connection_monitor_resource.go index 935ea7a5b9ab..7d458346599e 100644 --- a/internal/services/network/network_connection_monitor_resource.go +++ b/internal/services/network/network_connection_monitor_resource.go @@ -5,6 +5,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -169,8 +170,8 @@ func resourceNetworkConnectionMonitorSchema() map[string]*pluginsdk.Schema { ValidateFunc: validation.Any( computeValidate.VirtualMachineID, workspaces.ValidateWorkspaceID, - networkValidate.SubnetID, - networkValidate.VirtualNetworkID, + commonids.ValidateSubnetID, + commonids.ValidateVirtualNetworkID, ), }, diff --git a/internal/services/network/network_ddos_protection_plan_resource.go b/internal/services/network/network_ddos_protection_plan_resource.go index d17a60ecc271..b6830e2b9c83 100644 --- a/internal/services/network/network_ddos_protection_plan_resource.go +++ b/internal/services/network/network_ddos_protection_plan_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -205,13 +206,13 @@ func expandNetworkDDoSProtectionPlanVnetNames(d *pluginsdk.ResourceData) (*[]str vnetNames := make([]string, 0) for _, vnetID := range vnetIDs { - vnetResourceID, err := parse.VirtualNetworkID(vnetID.(string)) + vnetResourceID, err := commonids.ParseVirtualNetworkID(vnetID.(string)) if err != nil { return nil, err } - if !utils.SliceContainsValue(vnetNames, vnetResourceID.Name) { - vnetNames = append(vnetNames, vnetResourceID.Name) + if !utils.SliceContainsValue(vnetNames, vnetResourceID.VirtualNetworkName) { + vnetNames = append(vnetNames, vnetResourceID.VirtualNetworkName) } } @@ -239,13 +240,13 @@ func extractVnetNames(d *pluginsdk.ResourceData) (*[]string, error) { vnetNames := make([]string, 0) for _, vnetID := range vnetIDs { - vnetResourceID, err := parse.VirtualNetworkID(vnetID.(string)) + vnetResourceID, err := commonids.ParseVirtualNetworkID(vnetID.(string)) if err != nil { return nil, err } - if !utils.SliceContainsValue(vnetNames, vnetResourceID.Name) { - vnetNames = append(vnetNames, vnetResourceID.Name) + if !utils.SliceContainsValue(vnetNames, vnetResourceID.VirtualNetworkName) { + vnetNames = append(vnetNames, vnetResourceID.VirtualNetworkName) } } diff --git a/internal/services/network/network_interface_locking.go b/internal/services/network/network_interface_locking.go index 320d4d40a6d4..30e81b920fe0 100644 --- a/internal/services/network/network_interface_locking.go +++ b/internal/services/network/network_interface_locking.go @@ -1,8 +1,8 @@ package network import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" "github.com/tombuildsstuff/kermit/sdk/network/2022-07-01/network" ) @@ -38,13 +38,13 @@ func determineResourcesToLockFromIPConfiguration(input *[]network.InterfaceIPCon continue } - id, err := parse.SubnetID(*config.Subnet.ID) + id, err := commonids.ParseSubnetID(*config.Subnet.ID) if err != nil { return nil, err } virtualNetworkName := id.VirtualNetworkName - subnetName := id.Name + subnetName := id.SubnetName if !utils.SliceContainsValue(virtualNetworkNamesToLock, virtualNetworkName) { virtualNetworkNamesToLock = append(virtualNetworkNamesToLock, virtualNetworkName) diff --git a/internal/services/network/network_interface_resource.go b/internal/services/network/network_interface_resource.go index 07ecb06d4d6f..52bad5e15b77 100644 --- a/internal/services/network/network_interface_resource.go +++ b/internal/services/network/network_interface_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -70,7 +71,7 @@ func resourceNetworkInterface() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_ip_address": { diff --git a/internal/services/network/network_manager_static_member_resource.go b/internal/services/network/network_manager_static_member_resource.go index 439dc540db0e..372ceef1a3ea 100644 --- a/internal/services/network/network_manager_static_member_resource.go +++ b/internal/services/network/network_manager_static_member_resource.go @@ -6,9 +6,9 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/staticmembers" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -56,7 +56,7 @@ func (r ManagerStaticMemberResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, } } diff --git a/internal/services/network/network_profile_resource.go b/internal/services/network/network_profile_resource.go index 99263dd47228..737b50d64bb6 100644 --- a/internal/services/network/network_profile_resource.go +++ b/internal/services/network/network_profile_resource.go @@ -5,13 +5,13 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -76,7 +76,7 @@ func resourceNetworkProfile() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, }, @@ -297,13 +297,13 @@ func expandNetworkProfileVirtualNetworkSubnetNames(d *pluginsdk.ResourceData) (* ipData := ipConfig.(map[string]interface{}) subnetID := ipData["subnet_id"].(string) - subnetResourceID, err := parse.SubnetID(subnetID) + subnetResourceID, err := commonids.ParseSubnetID(subnetID) if err != nil { return nil, nil, err } - if !utils.SliceContainsValue(subnetNames, subnetResourceID.Name) { - subnetNames = append(subnetNames, subnetResourceID.Name) + if !utils.SliceContainsValue(subnetNames, subnetResourceID.SubnetName) { + subnetNames = append(subnetNames, subnetResourceID.SubnetName) } if !utils.SliceContainsValue(vnetNames, subnetResourceID.VirtualNetworkName) { diff --git a/internal/services/network/parse/subnet.go b/internal/services/network/parse/subnet.go deleted file mode 100644 index b287c1d07da5..000000000000 --- a/internal/services/network/parse/subnet.go +++ /dev/null @@ -1,131 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type SubnetId struct { - SubscriptionId string - ResourceGroup string - VirtualNetworkName string - Name string -} - -func NewSubnetID(subscriptionId, resourceGroup, virtualNetworkName, name string) SubnetId { - return SubnetId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - VirtualNetworkName: virtualNetworkName, - Name: name, - } -} - -func (id SubnetId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Virtual Network Name %q", id.VirtualNetworkName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Subnet", segmentsStr) -} - -func (id SubnetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/subnets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName, id.Name) -} - -// SubnetID parses a Subnet ID into an SubnetId struct -func SubnetID(input string) (*SubnetId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an Subnet ID: %+v", input, err) - } - - resourceId := SubnetId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.VirtualNetworkName, err = id.PopSegment("virtualNetworks"); err != nil { - return nil, err - } - if resourceId.Name, err = id.PopSegment("subnets"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} - -// SubnetIDInsensitively parses an Subnet ID into an SubnetId struct, insensitively -// This should only be used to parse an ID for rewriting, the SubnetID -// method should be used instead for validation etc. -// -// Whilst this may seem strange, this enables Terraform have consistent casing -// which works around issues in Core, whilst handling broken API responses. -func SubnetIDInsensitively(input string) (*SubnetId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := SubnetId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - // find the correct casing for the 'virtualNetworks' segment - virtualNetworksKey := "virtualNetworks" - for key := range id.Path { - if strings.EqualFold(key, virtualNetworksKey) { - virtualNetworksKey = key - break - } - } - if resourceId.VirtualNetworkName, err = id.PopSegment(virtualNetworksKey); err != nil { - return nil, err - } - - // find the correct casing for the 'subnets' segment - subnetsKey := "subnets" - for key := range id.Path { - if strings.EqualFold(key, subnetsKey) { - subnetsKey = key - break - } - } - if resourceId.Name, err = id.PopSegment(subnetsKey); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/network/parse/subnet_test.go b/internal/services/network/parse/subnet_test.go deleted file mode 100644 index 5d5776ff3bcb..000000000000 --- a/internal/services/network/parse/subnet_test.go +++ /dev/null @@ -1,264 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = SubnetId{} - -func TestSubnetIDFormatter(t *testing.T) { - actual := NewSubnetID("12345678-1234-9876-4563-123456789012", "resGroup1", "network1", "subnet1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestSubnetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SubnetId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Error: true, - }, - - { - // missing value for VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - Expected: &SubnetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - VirtualNetworkName: "network1", - Name: "subnet1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKS/NETWORK1/SUBNETS/SUBNET1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := SubnetID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} - -func TestSubnetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SubnetId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Error: true, - }, - - { - // missing value for VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - Expected: &SubnetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - VirtualNetworkName: "network1", - Name: "subnet1", - }, - }, - - { - // lower-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualnetworks/network1/subnets/subnet1", - Expected: &SubnetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - VirtualNetworkName: "network1", - Name: "subnet1", - }, - }, - - { - // upper-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/VIRTUALNETWORKS/network1/SUBNETS/subnet1", - Expected: &SubnetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - VirtualNetworkName: "network1", - Name: "subnet1", - }, - }, - - { - // mixed-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/ViRtUaLnEtWoRkS/network1/SuBnEtS/subnet1", - Expected: &SubnetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - VirtualNetworkName: "network1", - Name: "subnet1", - }, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := SubnetIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} diff --git a/internal/services/network/parse/virtual_network.go b/internal/services/network/parse/virtual_network.go deleted file mode 100644 index d7ba8b213145..000000000000 --- a/internal/services/network/parse/virtual_network.go +++ /dev/null @@ -1,113 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type VirtualNetworkId struct { - SubscriptionId string - ResourceGroup string - Name string -} - -func NewVirtualNetworkID(subscriptionId, resourceGroup, name string) VirtualNetworkId { - return VirtualNetworkId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - Name: name, - } -} - -func (id VirtualNetworkId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Virtual Network", segmentsStr) -} - -func (id VirtualNetworkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.Name) -} - -// VirtualNetworkID parses a VirtualNetwork ID into an VirtualNetworkId struct -func VirtualNetworkID(input string) (*VirtualNetworkId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an VirtualNetwork ID: %+v", input, err) - } - - resourceId := VirtualNetworkId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.Name, err = id.PopSegment("virtualNetworks"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} - -// VirtualNetworkIDInsensitively parses an VirtualNetwork ID into an VirtualNetworkId struct, insensitively -// This should only be used to parse an ID for rewriting, the VirtualNetworkID -// method should be used instead for validation etc. -// -// Whilst this may seem strange, this enables Terraform have consistent casing -// which works around issues in Core, whilst handling broken API responses. -func VirtualNetworkIDInsensitively(input string) (*VirtualNetworkId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := VirtualNetworkId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - // find the correct casing for the 'virtualNetworks' segment - virtualNetworksKey := "virtualNetworks" - for key := range id.Path { - if strings.EqualFold(key, virtualNetworksKey) { - virtualNetworksKey = key - break - } - } - if resourceId.Name, err = id.PopSegment(virtualNetworksKey); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/network/parse/virtual_network_test.go b/internal/services/network/parse/virtual_network_test.go deleted file mode 100644 index b9b115f76186..000000000000 --- a/internal/services/network/parse/virtual_network_test.go +++ /dev/null @@ -1,229 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = VirtualNetworkId{} - -func TestVirtualNetworkIDFormatter(t *testing.T) { - actual := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "resGroup1", "network1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestVirtualNetworkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1", - Expected: &VirtualNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "network1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKS/NETWORK1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := VirtualNetworkID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} - -func TestVirtualNetworkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1", - Expected: &VirtualNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "network1", - }, - }, - - { - // lower-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualnetworks/network1", - Expected: &VirtualNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "network1", - }, - }, - - { - // upper-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/VIRTUALNETWORKS/network1", - Expected: &VirtualNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "network1", - }, - }, - - { - // mixed-cased segment names - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/ViRtUaLnEtWoRkS/network1", - Expected: &VirtualNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "network1", - }, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := VirtualNetworkIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} diff --git a/internal/services/network/private_link_service_resource.go b/internal/services/network/private_link_service_resource.go index fe322afaf44f..3bf374126279 100644 --- a/internal/services/network/private_link_service_resource.go +++ b/internal/services/network/private_link_service_resource.go @@ -6,6 +6,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -119,7 +120,7 @@ func resourcePrivateLinkService() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "primary": { Type: pluginsdk.TypeBool, diff --git a/internal/services/network/resourceids.go b/internal/services/network/resourceids.go index d0f949bfaa61..cb2ec9424a9b 100644 --- a/internal/services/network/resourceids.go +++ b/internal/services/network/resourceids.go @@ -13,8 +13,6 @@ package network //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=PublicIpPrefix -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefix1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Route -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/routeTables/routeTable1/routes/route1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=RouteTable -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/routeTables/routeTable1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Subnet -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1 -rewrite=true -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=VirtualNetwork -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1 -rewrite=true //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=VirtualNetworkDnsServers -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/dnsServers/default -rewrite=true //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=VirtualNetworkPeering -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/vnetPeering1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=NetworkGatewayConnection -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/connections/connection1 diff --git a/internal/services/network/route_server_resource.go b/internal/services/network/route_server_resource.go index c924e5f90b52..16e501d4ece3 100644 --- a/internal/services/network/route_server_resource.go +++ b/internal/services/network/route_server_resource.go @@ -8,6 +8,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -72,7 +73,7 @@ func resourceRouteServer() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "branch_to_branch_traffic_enabled": { diff --git a/internal/services/network/subnet_data_source.go b/internal/services/network/subnet_data_source.go index 41dfe63549d3..2c58de297872 100644 --- a/internal/services/network/subnet_data_source.go +++ b/internal/services/network/subnet_data_source.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -98,8 +98,8 @@ func dataSourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewSubnetID(subscriptionId, d.Get("resource_group_name").(string), d.Get("virtual_network_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + id := commonids.NewSubnetID(subscriptionId, d.Get("resource_group_name").(string), d.Get("virtual_network_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("%s was not found", id) @@ -108,9 +108,9 @@ func dataSourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { } d.SetId(id.ID()) - d.Set("name", id.Name) + d.Set("name", id.SubnetName) d.Set("virtual_network_name", id.VirtualNetworkName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) if props := resp.SubnetPropertiesFormat; props != nil { d.Set("address_prefix", props.AddressPrefix) diff --git a/internal/services/network/subnet_nat_gateway_association_resource.go b/internal/services/network/subnet_nat_gateway_association_resource.go index 2c0dd41469e1..a109b9935fd8 100644 --- a/internal/services/network/subnet_nat_gateway_association_resource.go +++ b/internal/services/network/subnet_nat_gateway_association_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -30,7 +31,7 @@ func resourceSubnetNatGatewayAssociation() *pluginsdk.Resource { }, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.SubnetID(id) + _, err := commonids.ParseSubnetID(id) return err }), @@ -39,7 +40,7 @@ func resourceSubnetNatGatewayAssociation() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "nat_gateway_id": { @@ -60,7 +61,7 @@ func resourceSubnetNatGatewayAssociationCreate(d *pluginsdk.ResourceData, meta i log.Printf("[INFO] preparing arguments for Subnet <-> NAT Gateway Association creation.") natGatewayId := d.Get("nat_gateway_id").(string) - parsedSubnetId, err := parse.SubnetID(d.Get("subnet_id").(string)) + parsedSubnetId, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return err } @@ -74,10 +75,10 @@ func resourceSubnetNatGatewayAssociationCreate(d *pluginsdk.ResourceData, meta i defer locks.UnlockByName(parsedGatewayId.Name, natGatewayResourceName) locks.ByName(parsedSubnetId.VirtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(parsedSubnetId.VirtualNetworkName, VirtualNetworkResourceName) - locks.ByName(parsedSubnetId.Name, SubnetResourceName) - defer locks.UnlockByName(parsedSubnetId.Name, SubnetResourceName) + locks.ByName(parsedSubnetId.SubnetName, SubnetResourceName) + defer locks.UnlockByName(parsedSubnetId.SubnetName, SubnetResourceName) - subnet, err := client.Get(ctx, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName, parsedSubnetId.Name, "") + subnet, err := client.Get(ctx, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName, parsedSubnetId.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { return fmt.Errorf("%s was not found!", *parsedSubnetId) @@ -97,7 +98,7 @@ func resourceSubnetNatGatewayAssociationCreate(d *pluginsdk.ResourceData, meta i } } - future, err := client.CreateOrUpdate(ctx, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName, parsedSubnetId.Name, subnet) + future, err := client.CreateOrUpdate(ctx, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName, parsedSubnetId.SubnetName, subnet) if err != nil { return fmt.Errorf("updating NAT Gateway Association for %s: %+v", *parsedSubnetId, err) } @@ -119,7 +120,7 @@ func resourceSubnetNatGatewayAssociationCreate(d *pluginsdk.ResourceData, meta i return fmt.Errorf("waiting for provisioning state of subnet for NAT Gateway Association for %s: %+v", *parsedSubnetId, err) } - vnetId := parse.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(network.ProvisioningStateUpdating)}, Target: []string{string(network.ProvisioningStateSucceeded)}, @@ -141,12 +142,12 @@ func resourceSubnetNatGatewayAssociationRead(d *pluginsdk.ResourceData, meta int ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - subnet, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + subnet, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -178,12 +179,12 @@ func resourceSubnetNatGatewayAssociationDelete(d *pluginsdk.ResourceData, meta i ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - subnet, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + subnet, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -211,7 +212,7 @@ func resourceSubnetNatGatewayAssociationDelete(d *pluginsdk.ResourceData, meta i defer locks.UnlockByName(id.VirtualNetworkName, VirtualNetworkResourceName) // ensure we get the latest state - subnet, err = client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + subnet, err = client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -222,7 +223,7 @@ func resourceSubnetNatGatewayAssociationDelete(d *pluginsdk.ResourceData, meta i subnet.SubnetPropertiesFormat.NatGateway = nil // remove the nat gateway from subnet - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, subnet) + future, err := client.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, subnet) if err != nil { return fmt.Errorf("removing %s: %+v", *id, err) } diff --git a/internal/services/network/subnet_nat_gateway_association_resource_test.go b/internal/services/network/subnet_nat_gateway_association_resource_test.go index 980472b0e0ca..cae86fff7f95 100644 --- a/internal/services/network/subnet_nat_gateway_association_resource_test.go +++ b/internal/services/network/subnet_nat_gateway_association_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -92,13 +92,13 @@ func TestAccAzureRMSubnetNatGatewayAssociation_updateSubnet(t *testing.T) { } func (t SubnetNatGatewayAssociationResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return nil, err } - resourceGroup := id.ResourceGroup + resourceGroup := id.ResourceGroupName virtualNetworkName := id.VirtualNetworkName - subnetName := id.Name + subnetName := id.SubnetName resp, err := clients.Network.SubnetsClient.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { @@ -114,14 +114,14 @@ func (t SubnetNatGatewayAssociationResource) Exists(ctx context.Context, clients } func (SubnetNatGatewayAssociationResource) destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - parsedSubnetId, err := parse.SubnetID(state.Attributes["subnet_id"]) + parsedSubnetId, err := commonids.ParseSubnetID(state.Attributes["subnet_id"]) if err != nil { return err } - resourceGroup := parsedSubnetId.ResourceGroup + resourceGroup := parsedSubnetId.ResourceGroupName virtualNetworkName := parsedSubnetId.VirtualNetworkName - subnetName := parsedSubnetId.Name + subnetName := parsedSubnetId.SubnetName subnet, err := client.Network.SubnetsClient.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { diff --git a/internal/services/network/subnet_network_security_group_association_resource.go b/internal/services/network/subnet_network_security_group_association_resource.go index d1ecb5bedf53..da194f53eb8d 100644 --- a/internal/services/network/subnet_network_security_group_association_resource.go +++ b/internal/services/network/subnet_network_security_group_association_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -30,7 +31,7 @@ func resourceSubnetNetworkSecurityGroupAssociation() *pluginsdk.Resource { }, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.SubnetID(id) + _, err := commonids.ParseSubnetID(id) return err }), @@ -39,7 +40,7 @@ func resourceSubnetNetworkSecurityGroupAssociation() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "network_security_group_id": { @@ -63,7 +64,7 @@ func resourceSubnetNetworkSecurityGroupAssociationCreate(d *pluginsdk.ResourceDa subnetId := d.Get("subnet_id").(string) networkSecurityGroupId := d.Get("network_security_group_id").(string) - parsedSubnetId, err := parse.SubnetID(subnetId) + parsedSubnetId, err := commonids.ParseSubnetID(subnetId) if err != nil { return err } @@ -79,10 +80,10 @@ func resourceSubnetNetworkSecurityGroupAssociationCreate(d *pluginsdk.ResourceDa locks.ByName(parsedSubnetId.VirtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(parsedSubnetId.VirtualNetworkName, VirtualNetworkResourceName) - locks.ByName(parsedSubnetId.Name, SubnetResourceName) - defer locks.UnlockByName(parsedSubnetId.Name, SubnetResourceName) + locks.ByName(parsedSubnetId.SubnetName, SubnetResourceName) + defer locks.UnlockByName(parsedSubnetId.SubnetName, SubnetResourceName) - subnet, err := client.Get(ctx, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName, parsedSubnetId.Name, "") + subnet, err := client.Get(ctx, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName, parsedSubnetId.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { return fmt.Errorf("%s was not found", *parsedSubnetId) @@ -104,7 +105,7 @@ func resourceSubnetNetworkSecurityGroupAssociationCreate(d *pluginsdk.ResourceDa } } - future, err := client.CreateOrUpdate(ctx, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName, parsedSubnetId.Name, subnet) + future, err := client.CreateOrUpdate(ctx, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName, parsedSubnetId.SubnetName, subnet) if err != nil { return fmt.Errorf("updating Network Security Group Association for %s: %+v", *parsedSubnetId, err) } @@ -126,7 +127,7 @@ func resourceSubnetNetworkSecurityGroupAssociationCreate(d *pluginsdk.ResourceDa return fmt.Errorf("waiting for provisioning state of subnet for Network Security Group Association for %s: %+v", *parsedSubnetId, err) } - vnetId := parse.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(network.ProvisioningStateUpdating)}, Target: []string{string(network.ProvisioningStateSucceeded)}, @@ -148,12 +149,12 @@ func resourceSubnetNetworkSecurityGroupAssociationRead(d *pluginsdk.ResourceData ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -186,13 +187,13 @@ func resourceSubnetNetworkSecurityGroupAssociationDelete(d *pluginsdk.ResourceDa ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } // retrieve the subnet - read, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + read, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(read.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -224,11 +225,11 @@ func resourceSubnetNetworkSecurityGroupAssociationDelete(d *pluginsdk.ResourceDa locks.ByName(id.VirtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(id.VirtualNetworkName, VirtualNetworkResourceName) - locks.ByName(id.Name, SubnetResourceName) - defer locks.UnlockByName(id.Name, SubnetResourceName) + locks.ByName(id.SubnetName, SubnetResourceName) + defer locks.UnlockByName(id.SubnetName, SubnetResourceName) // then re-retrieve it to ensure we've got the latest state - read, err = client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + read, err = client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(read.Response) { log.Printf("[DEBUG] %s could not be found - removing from state!", *id) @@ -240,7 +241,7 @@ func resourceSubnetNetworkSecurityGroupAssociationDelete(d *pluginsdk.ResourceDa read.SubnetPropertiesFormat.NetworkSecurityGroup = nil - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, read) + future, err := client.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, read) if err != nil { return fmt.Errorf("removing Network Security Group Association from %s: %+v", *id, err) } diff --git a/internal/services/network/subnet_network_security_group_association_resource_test.go b/internal/services/network/subnet_network_security_group_association_resource_test.go index 2c3488a8aac3..528bdceb7abb 100644 --- a/internal/services/network/subnet_network_security_group_association_resource_test.go +++ b/internal/services/network/subnet_network_security_group_association_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -92,12 +92,12 @@ func TestAccSubnetNetworkSecurityGroupAssociation_deleted(t *testing.T) { } func (SubnetNetworkSecurityGroupAssociationResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return nil, err } - resp, err := clients.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := clients.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { return nil, fmt.Errorf("reading %s: %+v", *id, err) } @@ -112,26 +112,26 @@ func (SubnetNetworkSecurityGroupAssociationResource) Exists(ctx context.Context, func (SubnetNetworkSecurityGroupAssociationResource) destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { subnetId := state.Attributes["subnet_id"] - id, err := parse.SubnetID(subnetId) + id, err := commonids.ParseSubnetID(subnetId) if err != nil { return err } - read, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + read, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if !utils.ResponseWasNotFound(read.Response) { - return fmt.Errorf("retrieving Subnet %q (Network %q / Resource Group %q): %+v", id.Name, id.VirtualNetworkName, id.ResourceGroup, err) + return fmt.Errorf("retrieving %s: %+v", id, err) } } read.SubnetPropertiesFormat.NetworkSecurityGroup = nil - future, err := client.Network.SubnetsClient.CreateOrUpdate(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, read) + future, err := client.Network.SubnetsClient.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, read) if err != nil { - return fmt.Errorf("updating Subnet %q (Network %q / Resource Group %q): %+v", id.Name, id.VirtualNetworkName, id.ResourceGroup, err) + return fmt.Errorf("updating %s: %+v", id, err) } if err = future.WaitForCompletionRef(ctx, client.Network.SubnetsClient.Client); err != nil { - return fmt.Errorf("waiting for completion of Subnet %q (Network %q / Resource Group %q): %+v", id.Name, id.VirtualNetworkName, id.ResourceGroup, err) + return fmt.Errorf("waiting for completion of %s: %+v", id, err) } return nil diff --git a/internal/services/network/subnet_resource.go b/internal/services/network/subnet_resource.go index b8f5e2a5234e..b86ebba4e17d 100644 --- a/internal/services/network/subnet_resource.go +++ b/internal/services/network/subnet_resource.go @@ -8,12 +8,12 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -97,7 +97,7 @@ func resourceSubnet() *pluginsdk.Resource { Update: resourceSubnetUpdate, Delete: resourceSubnetDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.SubnetID(id) + _, err := commonids.ParseSubnetID(id) return err }), @@ -269,8 +269,8 @@ func resourceSubnetCreate(d *pluginsdk.ResourceData, meta interface{}) error { log.Printf("[INFO] preparing arguments for Azure ARM Subnet creation.") - id := parse.NewSubnetID(subscriptionId, d.Get("resource_group_name").(string), d.Get("virtual_network_name").(string), d.Get("name").(string)) - existing, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + id := commonids.NewSubnetID(subscriptionId, d.Get("resource_group_name").(string), d.Get("virtual_network_name").(string), d.Get("name").(string)) + existing, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if !utils.ResponseWasNotFound(existing.Response) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) @@ -376,11 +376,11 @@ func resourceSubnetCreate(d *pluginsdk.ResourceData, meta interface{}) error { properties.Delegations = expandSubnetDelegation(delegationsRaw) subnet := network.Subnet{ - Name: utils.String(id.Name), + Name: utils.String(id.SubnetName), SubnetPropertiesFormat: &properties, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, subnet) + future, err := client.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, subnet) if err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -402,7 +402,7 @@ func resourceSubnetCreate(d *pluginsdk.ResourceData, meta interface{}) error { return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err) } - vnetId := parse.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(network.ProvisioningStateUpdating)}, Target: []string{string(network.ProvisioningStateSucceeded)}, @@ -424,7 +424,7 @@ func resourceSubnetUpdate(d *pluginsdk.ResourceData, meta interface{}) error { ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } @@ -432,10 +432,10 @@ func resourceSubnetUpdate(d *pluginsdk.ResourceData, meta interface{}) error { locks.ByName(id.VirtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(id.VirtualNetworkName, VirtualNetworkResourceName) - locks.ByName(id.Name, SubnetResourceName) - defer locks.UnlockByName(id.Name, SubnetResourceName) + locks.ByName(id.SubnetName, SubnetResourceName) + defer locks.UnlockByName(id.SubnetName, SubnetResourceName) - existing, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + existing, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { return fmt.Errorf("retrieving %s: %+v", *id, err) } @@ -527,11 +527,11 @@ func resourceSubnetUpdate(d *pluginsdk.ResourceData, meta interface{}) error { } subnet := network.Subnet{ - Name: utils.String(id.Name), + Name: utils.String(id.SubnetName), SubnetPropertiesFormat: &props, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, subnet) + future, err := client.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, subnet) if err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -553,7 +553,7 @@ func resourceSubnetUpdate(d *pluginsdk.ResourceData, meta interface{}) error { return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err) } - vnetId := parse.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(network.ProvisioningStateUpdating)}, Target: []string{string(network.ProvisioningStateSucceeded)}, @@ -574,12 +574,12 @@ func resourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") @@ -588,9 +588,9 @@ func resourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { return fmt.Errorf("retrieving %s: %+v", *id, err) } - d.Set("name", id.Name) + d.Set("name", id.SubnetName) d.Set("virtual_network_name", id.VirtualNetworkName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) if props := resp.SubnetPropertiesFormat; props != nil { if props.AddressPrefixes == nil { @@ -635,7 +635,7 @@ func resourceSubnetDelete(d *pluginsdk.ResourceData, meta interface{}) error { ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } @@ -643,10 +643,10 @@ func resourceSubnetDelete(d *pluginsdk.ResourceData, meta interface{}) error { locks.ByName(id.VirtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(id.VirtualNetworkName, VirtualNetworkResourceName) - locks.ByName(id.Name, SubnetResourceName) - defer locks.UnlockByName(id.Name, SubnetResourceName) + locks.ByName(id.SubnetName, SubnetResourceName) + defer locks.UnlockByName(id.SubnetName, SubnetResourceName) - future, err := client.Delete(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name) + future, err := client.Delete(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName) if err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } @@ -823,9 +823,9 @@ func flattenSubnetServiceEndpointPolicies(input *[]network.ServiceEndpointPolicy return output } -func SubnetProvisioningStateRefreshFunc(ctx context.Context, client *network.SubnetsClient, id parse.SubnetId) pluginsdk.StateRefreshFunc { +func SubnetProvisioningStateRefreshFunc(ctx context.Context, client *network.SubnetsClient, id commonids.SubnetId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + res, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { return nil, "", fmt.Errorf("polling for %s: %+v", id.String(), err) } diff --git a/internal/services/network/subnet_resource_test.go b/internal/services/network/subnet_resource_test.go index 9a8d64ef64c2..f49956778202 100644 --- a/internal/services/network/subnet_resource_test.go +++ b/internal/services/network/subnet_resource_test.go @@ -5,11 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -549,12 +549,12 @@ func TestAccSubnet_updateServiceDelegation(t *testing.T) { } func (t SubnetResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return nil, err } - resp, err := clients.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := clients.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { return nil, fmt.Errorf("reading Subnet (%s): %+v", id, err) } @@ -563,12 +563,12 @@ func (t SubnetResource) Exists(ctx context.Context, clients *clients.Client, sta } func (SubnetResource) Destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return nil, err } - future, err := client.Network.SubnetsClient.Delete(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name) + future, err := client.Network.SubnetsClient.Delete(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName) if err != nil { return nil, fmt.Errorf("deleting Subnet %q: %+v", id, err) } @@ -581,40 +581,40 @@ func (SubnetResource) Destroy(ctx context.Context, client *clients.Client, state } func (SubnetResource) hasNoNatGateway(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return err } - subnet, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + subnet, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) { - return fmt.Errorf("Bad: Subnet %q (Virtual Network %q / Resource Group: %q) does not exist", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("%s does not exist", id) } return fmt.Errorf("Bad: Get on subnetClient: %+v", err) } props := subnet.SubnetPropertiesFormat if props == nil { - return fmt.Errorf("Properties was nil for Subnet %q (Virtual Network %q / Resource Group: %q)", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("properties was nil for %s", id) } if props.NatGateway != nil && ((props.NatGateway.ID == nil) || (props.NatGateway.ID != nil && *props.NatGateway.ID == "")) { - return fmt.Errorf("No Route Table should exist for Subnet %q (Virtual Network %q / Resource Group: %q) but got %q", id.Name, id.VirtualNetworkName, id.ResourceGroup, *props.RouteTable.ID) + return fmt.Errorf("no Route Table should exist for %s but got %q", id, *props.RouteTable.ID) } return nil } func (SubnetResource) hasNoNetworkSecurityGroup(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return err } - resp, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Bad: Subnet %q (Virtual Network %q / Resource Group: %q) does not exist", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("%s does not exist", id) } return fmt.Errorf("Bad: Get on subnetClient: %+v", err) @@ -622,26 +622,26 @@ func (SubnetResource) hasNoNetworkSecurityGroup(ctx context.Context, client *cli props := resp.SubnetPropertiesFormat if props == nil { - return fmt.Errorf("Properties was nil for Subnet %q (Virtual Network %q / Resource Group: %q)", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("properties was nil for %s", id) } if props.NetworkSecurityGroup != nil && ((props.NetworkSecurityGroup.ID == nil) || (props.NetworkSecurityGroup.ID != nil && *props.NetworkSecurityGroup.ID == "")) { - return fmt.Errorf("No Network Security Group should exist for Subnet %q (Virtual Network %q / Resource Group: %q) but got %q", id.Name, id.VirtualNetworkName, id.ResourceGroup, *props.NetworkSecurityGroup.ID) + return fmt.Errorf("no Network Security Group should exist for %s but got %q", id, *props.NetworkSecurityGroup.ID) } return nil } func (SubnetResource) hasNoRouteTable(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return err } - resp, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, id.Name, "") + resp, err := client.Network.SubnetsClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Bad: Subnet %q (Virtual Network %q / Resource Group: %q) does not exist", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("%s does not exist", id) } return fmt.Errorf("Bad: Get on subnetClient: %+v", err) @@ -649,11 +649,11 @@ func (SubnetResource) hasNoRouteTable(ctx context.Context, client *clients.Clien props := resp.SubnetPropertiesFormat if props == nil { - return fmt.Errorf("Properties was nil for Subnet %q (Virtual Network %q / Resource Group: %q)", id.Name, id.VirtualNetworkName, id.ResourceGroup) + return fmt.Errorf("properties was nil for %s", id) } if props.RouteTable != nil && ((props.RouteTable.ID == nil) || (props.RouteTable.ID != nil && *props.RouteTable.ID == "")) { - return fmt.Errorf("No Route Table should exist for Subnet %q (Virtual Network %q / Resource Group: %q) but got %q", id.Name, id.VirtualNetworkName, id.ResourceGroup, *props.RouteTable.ID) + return fmt.Errorf("no Route Table should exist for %s but got %q", id, *props.RouteTable.ID) } return nil diff --git a/internal/services/network/subnet_route_table_association_resource.go b/internal/services/network/subnet_route_table_association_resource.go index 81299adb581a..7f82dd606bba 100644 --- a/internal/services/network/subnet_route_table_association_resource.go +++ b/internal/services/network/subnet_route_table_association_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -30,7 +31,7 @@ func resourceSubnetRouteTableAssociation() *pluginsdk.Resource { }, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.SubnetID(id) + _, err := commonids.ParseSubnetID(id) return err }), @@ -39,7 +40,7 @@ func resourceSubnetRouteTableAssociation() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "route_table_id": { @@ -63,7 +64,7 @@ func resourceSubnetRouteTableAssociationCreate(d *pluginsdk.ResourceData, meta i subnetId := d.Get("subnet_id").(string) routeTableId := d.Get("route_table_id").(string) - parsedSubnetId, err := parse.SubnetID(subnetId) + parsedSubnetId, err := commonids.ParseSubnetID(subnetId) if err != nil { return err } @@ -76,9 +77,9 @@ func resourceSubnetRouteTableAssociationCreate(d *pluginsdk.ResourceData, meta i locks.ByName(parsedRouteTableId.Name, routeTableResourceName) defer locks.UnlockByName(parsedRouteTableId.Name, routeTableResourceName) - subnetName := parsedSubnetId.Name + subnetName := parsedSubnetId.SubnetName virtualNetworkName := parsedSubnetId.VirtualNetworkName - resourceGroup := parsedSubnetId.ResourceGroup + resourceGroup := parsedSubnetId.ResourceGroupName locks.ByName(virtualNetworkName, VirtualNetworkResourceName) defer locks.UnlockByName(virtualNetworkName, VirtualNetworkResourceName) @@ -127,7 +128,7 @@ func resourceSubnetRouteTableAssociationCreate(d *pluginsdk.ResourceData, meta i return fmt.Errorf("waiting for provisioning state of subnet for Route Table Association for Subnet %q (Virtual Network %q / Resource Group %q): %+v", subnetName, virtualNetworkName, resourceGroup, err) } - vnetId := parse.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroup, parsedSubnetId.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(parsedSubnetId.SubscriptionId, parsedSubnetId.ResourceGroupName, parsedSubnetId.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(network.ProvisioningStateUpdating)}, Target: []string{string(network.ProvisioningStateSucceeded)}, @@ -149,13 +150,13 @@ func resourceSubnetRouteTableAssociationRead(d *pluginsdk.ResourceData, meta int ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - resourceGroup := id.ResourceGroup + resourceGroup := id.ResourceGroupName virtualNetworkName := id.VirtualNetworkName - subnetName := id.Name + subnetName := id.SubnetName resp, err := client.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { @@ -190,13 +191,13 @@ func resourceSubnetRouteTableAssociationDelete(d *pluginsdk.ResourceData, meta i ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.SubnetID(d.Id()) + id, err := commonids.ParseSubnetID(d.Id()) if err != nil { return err } - resourceGroup := id.ResourceGroup + resourceGroup := id.ResourceGroupName virtualNetworkName := id.VirtualNetworkName - subnetName := id.Name + subnetName := id.SubnetName // retrieve the subnet read, err := client.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") diff --git a/internal/services/network/subnet_route_table_association_resource_test.go b/internal/services/network/subnet_route_table_association_resource_test.go index bcd9489b77c5..7a90d85c42b8 100644 --- a/internal/services/network/subnet_route_table_association_resource_test.go +++ b/internal/services/network/subnet_route_table_association_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -92,13 +92,13 @@ func TestAccSubnetRouteTableAssociation_deleted(t *testing.T) { } func (SubnetRouteTableAssociationResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.SubnetID(state.ID) + id, err := commonids.ParseSubnetID(state.ID) if err != nil { return nil, err } - resourceGroup := id.ResourceGroup + resourceGroup := id.ResourceGroupName virtualNetworkName := id.VirtualNetworkName - subnetName := id.Name + subnetName := id.SubnetName resp, err := clients.Network.SubnetsClient.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { @@ -114,14 +114,14 @@ func (SubnetRouteTableAssociationResource) Exists(ctx context.Context, clients * } func (SubnetRouteTableAssociationResource) destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - parsedId, err := parse.SubnetID(state.Attributes["subnet_id"]) + parsedId, err := commonids.ParseSubnetID(state.Attributes["subnet_id"]) if err != nil { return err } - resourceGroup := parsedId.ResourceGroup + resourceGroup := parsedId.ResourceGroupName virtualNetworkName := parsedId.VirtualNetworkName - subnetName := parsedId.Name + subnetName := parsedId.SubnetName read, err := client.Network.SubnetsClient.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { diff --git a/internal/services/network/validate/bastion_subnet_name.go b/internal/services/network/validate/bastion_subnet_name.go index 55ef8928774e..3fb86c354c84 100644 --- a/internal/services/network/validate/bastion_subnet_name.go +++ b/internal/services/network/validate/bastion_subnet_name.go @@ -3,17 +3,17 @@ package validate import ( "fmt" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) func BastionSubnetName(v interface{}, k string) (warnings []string, errors []error) { - parsed, err := networkParse.SubnetID(v.(string)) + parsed, err := commonids.ParseSubnetID(v.(string)) if err != nil { errors = append(errors, fmt.Errorf("parsing %q: %+v", v.(string), err)) return warnings, errors } - if parsed.Name != "AzureBastionSubnet" { + if parsed.SubnetName != "AzureBastionSubnet" { errors = append(errors, fmt.Errorf("The name of the Subnet for %q must be exactly 'AzureBastionSubnet' to be used for the Azure Bastion Host resource", k)) } diff --git a/internal/services/network/validate/gateway_subnet.go b/internal/services/network/validate/gateway_subnet.go index cc3018c7497b..a9db66077d2f 100644 --- a/internal/services/network/validate/gateway_subnet.go +++ b/internal/services/network/validate/gateway_subnet.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) func IsGatewaySubnet(i interface{}, k string) (warnings []string, errors []error) { @@ -14,13 +14,13 @@ func IsGatewaySubnet(i interface{}, k string) (warnings []string, errors []error return } - id, err := parse.SubnetIDInsensitively(value) + id, err := commonids.ParseSubnetIDInsensitively(value) if err != nil { errors = append(errors, err) return } - if !strings.EqualFold(id.Name, "GatewaySubnet") { + if !strings.EqualFold(id.SubnetName, "GatewaySubnet") { errors = append(errors, fmt.Errorf("expected %s to reference a gateway subnet with name GatewaySubnet", k)) } diff --git a/internal/services/network/validate/subnet_id.go b/internal/services/network/validate/subnet_id.go deleted file mode 100644 index 8bc7c3364a8e..000000000000 --- a/internal/services/network/validate/subnet_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" -) - -func SubnetID(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 := parse.SubnetID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/network/validate/subnet_id_test.go b/internal/services/network/validate/subnet_id_test.go deleted file mode 100644 index f7f377a7d95a..000000000000 --- a/internal/services/network/validate/subnet_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestSubnetID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Valid: false, - }, - - { - // missing value for VirtualNetworkName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKS/NETWORK1/SUBNETS/SUBNET1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := SubnetID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/network/validate/virtual_network_id.go b/internal/services/network/validate/virtual_network_id.go deleted file mode 100644 index ab032972e0d3..000000000000 --- a/internal/services/network/validate/virtual_network_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" -) - -func VirtualNetworkID(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 := parse.VirtualNetworkID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/network/validate/virtual_network_id_test.go b/internal/services/network/validate/virtual_network_id_test.go deleted file mode 100644 index 527f404c9702..000000000000 --- a/internal/services/network/validate/virtual_network_id_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestVirtualNetworkID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Network/virtualNetworks/network1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKS/NETWORK1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := VirtualNetworkID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/network/virtual_hub_connection_resource.go b/internal/services/network/virtual_hub_connection_resource.go index 1f1c1a967310..4ce6fb41afbf 100644 --- a/internal/services/network/virtual_hub_connection_resource.go +++ b/internal/services/network/virtual_hub_connection_resource.go @@ -6,6 +6,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -61,7 +62,7 @@ func resourceVirtualHubConnectionSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "internet_security_enabled": { @@ -169,13 +170,13 @@ func resourceVirtualHubConnectionCreateOrUpdate(d *pluginsdk.ResourceData, meta locks.ByName(virtualHubId.Name, virtualHubResourceName) defer locks.UnlockByName(virtualHubId.Name, virtualHubResourceName) - remoteVirtualNetworkId, err := parse.VirtualNetworkID(d.Get("remote_virtual_network_id").(string)) + remoteVirtualNetworkId, err := commonids.ParseVirtualNetworkID(d.Get("remote_virtual_network_id").(string)) if err != nil { return err } - locks.ByName(remoteVirtualNetworkId.Name, VirtualNetworkResourceName) - defer locks.UnlockByName(remoteVirtualNetworkId.Name, VirtualNetworkResourceName) + locks.ByName(remoteVirtualNetworkId.VirtualNetworkName, VirtualNetworkResourceName) + defer locks.UnlockByName(remoteVirtualNetworkId.VirtualNetworkName, VirtualNetworkResourceName) if d.IsNewResource() { existing, err := client.Get(ctx, id.ResourceGroup, id.VirtualHubName, id.Name) diff --git a/internal/services/network/virtual_hub_ip_resource.go b/internal/services/network/virtual_hub_ip_resource.go index 46be8f8a73ac..9f76f9c547d1 100644 --- a/internal/services/network/virtual_hub_ip_resource.go +++ b/internal/services/network/virtual_hub_ip_resource.go @@ -5,6 +5,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -55,7 +56,7 @@ func resourceVirtualHubIP() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_ip_address": { diff --git a/internal/services/network/virtual_network_data_source.go b/internal/services/network/virtual_network_data_source.go index f517e805b208..13aa4b884700 100644 --- a/internal/services/network/virtual_network_data_source.go +++ b/internal/services/network/virtual_network_data_source.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -90,8 +90,8 @@ func dataSourceVnetRead(d *pluginsdk.ResourceData, meta interface{}) error { ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewVirtualNetworkID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + id := commonids.NewVirtualNetworkID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Error: %s was not found", id) diff --git a/internal/services/network/virtual_network_dns_servers_resource.go b/internal/services/network/virtual_network_dns_servers_resource.go index a47414a81c87..826adf27de92 100644 --- a/internal/services/network/virtual_network_dns_servers_resource.go +++ b/internal/services/network/virtual_network_dns_servers_resource.go @@ -5,10 +5,10 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -40,7 +40,7 @@ func resourceVirtualNetworkDnsServers() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "dns_servers": { @@ -60,13 +60,13 @@ func resourceVirtualNetworkDnsServersCreateUpdate(d *pluginsdk.ResourceData, met ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - vnetId, err := parse.VirtualNetworkID(d.Get("virtual_network_id").(string)) + vnetId, err := commonids.ParseVirtualNetworkID(d.Get("virtual_network_id").(string)) if err != nil { return err } // This is a virtual resource so the last segment is hardcoded - id := parse.NewVirtualNetworkDnsServersID(vnetId.SubscriptionId, vnetId.ResourceGroup, vnetId.Name, "default") + id := parse.NewVirtualNetworkDnsServersID(vnetId.SubscriptionId, vnetId.ResourceGroupName, vnetId.VirtualNetworkName, "default") vnet, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, "") if err != nil { @@ -133,7 +133,7 @@ func resourceVirtualNetworkDnsServersRead(d *pluginsdk.ResourceData, meta interf return fmt.Errorf("retrieving %s: %+v", *id, err) } - vnetId := parse.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) d.Set("virtual_network_id", vnetId.ID()) if props := resp.VirtualNetworkPropertiesFormat; props != nil { @@ -155,7 +155,7 @@ func resourceVirtualNetworkDnsServersDelete(d *pluginsdk.ResourceData, meta inte return err } - vnetId := parse.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(id.SubscriptionId, id.ResourceGroup, id.VirtualNetworkName) vnet, err := client.Get(ctx, id.ResourceGroup, id.VirtualNetworkName, "") if err != nil { diff --git a/internal/services/network/virtual_network_peering_resource.go b/internal/services/network/virtual_network_peering_resource.go index abdf1aaca5fc..08a286579f08 100644 --- a/internal/services/network/virtual_network_peering_resource.go +++ b/internal/services/network/virtual_network_peering_resource.go @@ -7,12 +7,12 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -58,7 +58,7 @@ func resourceVirtualNetworkPeering() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "allow_virtual_network_access": { @@ -247,7 +247,7 @@ func resourceVirtualNetworkPeeringRead(d *pluginsdk.ResourceData, meta interface remoteVirtualNetworkId := "" if network := peer.RemoteVirtualNetwork; network != nil { - parsed, err := parse.VirtualNetworkIDInsensitively(*network.ID) + parsed, err := commonids.ParseVirtualNetworkIDInsensitively(*network.ID) if err != nil { return fmt.Errorf("parsing %q as a Virtual Network ID: %+v", *network.ID, err) } diff --git a/internal/services/network/virtual_network_resource.go b/internal/services/network/virtual_network_resource.go index 5cc6c71f8517..f1577df14541 100644 --- a/internal/services/network/virtual_network_resource.go +++ b/internal/services/network/virtual_network_resource.go @@ -8,6 +8,7 @@ import ( "net/http" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -33,7 +34,7 @@ func resourceVirtualNetwork() *pluginsdk.Resource { Update: resourceVirtualNetworkCreateUpdate, Delete: resourceVirtualNetworkDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.VirtualNetworkID(id) + _, err := commonids.ParseVirtualNetworkID(id) return err }), @@ -164,9 +165,9 @@ func resourceVirtualNetworkCreateUpdate(d *pluginsdk.ResourceData, meta interfac ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewVirtualNetworkID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + id := commonids.NewVirtualNetworkID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + existing, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, "") if err != nil { if !utils.ResponseWasNotFound(existing.Response) { return fmt.Errorf("checking for presence of existing %s: %s", id, err) @@ -187,7 +188,7 @@ func resourceVirtualNetworkCreateUpdate(d *pluginsdk.ResourceData, meta interfac } vnet := network.VirtualNetwork{ - Name: utils.String(id.Name), + Name: utils.String(id.VirtualNetworkName), ExtendedLocation: expandEdgeZone(d.Get("edge_zone").(string)), Location: utils.String(location), VirtualNetworkPropertiesFormat: vnetProperties, @@ -216,7 +217,7 @@ func resourceVirtualNetworkCreateUpdate(d *pluginsdk.ResourceData, meta interfac locks.MultipleByName(&networkSecurityGroupNames, networkSecurityGroupResourceName) defer locks.UnlockMultipleByName(&networkSecurityGroupNames, networkSecurityGroupResourceName) - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.Name, vnet) + future, err := client.CreateOrUpdate(ctx, id.ResourceGroupName, id.VirtualNetworkName, vnet) if err != nil { return fmt.Errorf("creating/updating %s: %+v", id, err) } @@ -246,12 +247,12 @@ func resourceVirtualNetworkRead(d *pluginsdk.ResourceData, meta interface{}) err ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.VirtualNetworkID(d.Id()) + id, err := commonids.ParseVirtualNetworkID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + resp, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, "") if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") @@ -260,8 +261,8 @@ func resourceVirtualNetworkRead(d *pluginsdk.ResourceData, meta interface{}) err return fmt.Errorf("retrieving %s: %+v", *id, err) } - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("name", id.VirtualNetworkName) + d.Set("resource_group_name", id.ResourceGroupName) d.Set("location", location.NormalizeNilable(resp.Location)) d.Set("edge_zone", flattenEdgeZone(resp.ExtendedLocation)) @@ -305,7 +306,7 @@ func resourceVirtualNetworkDelete(d *pluginsdk.ResourceData, meta interface{}) e ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.VirtualNetworkID(d.Id()) + id, err := commonids.ParseVirtualNetworkID(d.Id()) if err != nil { return err } @@ -318,7 +319,7 @@ func resourceVirtualNetworkDelete(d *pluginsdk.ResourceData, meta interface{}) e locks.MultipleByName(&nsgNames, VirtualNetworkResourceName) defer locks.UnlockMultipleByName(&nsgNames, VirtualNetworkResourceName) - future, err := client.Delete(ctx, id.ResourceGroup, id.Name) + future, err := client.Delete(ctx, id.ResourceGroupName, id.VirtualNetworkName) if err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } @@ -534,9 +535,9 @@ func expandAzureRmVirtualNetworkVirtualNetworkSecurityGroupNames(d *pluginsdk.Re return nsgNames, nil } -func VirtualNetworkProvisioningStateRefreshFunc(ctx context.Context, client *network.VirtualNetworksClient, id parse.VirtualNetworkId) pluginsdk.StateRefreshFunc { +func VirtualNetworkProvisioningStateRefreshFunc(ctx context.Context, client *network.VirtualNetworksClient, id commonids.VirtualNetworkId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + res, err := client.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, "") if err != nil { return nil, "", fmt.Errorf("polling for %s: %+v", id.String(), err) } diff --git a/internal/services/network/virtual_network_resource_test.go b/internal/services/network/virtual_network_resource_test.go index 4490e5e36209..163a957fc78f 100644 --- a/internal/services/network/virtual_network_resource_test.go +++ b/internal/services/network/virtual_network_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -272,12 +272,12 @@ func TestVirtualNetworkResource_tagCount(t *testing.T) { } func (t VirtualNetworkResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.VirtualNetworkID(state.ID) + id, err := commonids.ParseVirtualNetworkID(state.ID) if err != nil { return nil, err } - resp, err := clients.Network.VnetClient.Get(ctx, id.ResourceGroup, id.Name, "") + resp, err := clients.Network.VnetClient.Get(ctx, id.ResourceGroupName, id.VirtualNetworkName, "") if err != nil { return nil, fmt.Errorf("reading %s: %+v", *id, err) } @@ -286,12 +286,12 @@ func (t VirtualNetworkResource) Exists(ctx context.Context, clients *clients.Cli } func (r VirtualNetworkResource) Destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.VirtualNetworkID(state.ID) + id, err := commonids.ParseVirtualNetworkID(state.ID) if err != nil { return nil, err } - future, err := client.Network.VnetClient.Delete(ctx, id.ResourceGroup, id.Name) + future, err := client.Network.VnetClient.Delete(ctx, id.ResourceGroupName, id.VirtualNetworkName) if err != nil { return nil, fmt.Errorf("deleting on Virtual Network: %+v", err) } diff --git a/internal/services/orbital/contact_profile_resource.go b/internal/services/orbital/contact_profile_resource.go index ee33abc98fdb..830650ef1f49 100644 --- a/internal/services/orbital/contact_profile_resource.go +++ b/internal/services/orbital/contact_profile_resource.go @@ -6,11 +6,11 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/contactprofile" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -53,7 +53,7 @@ func (r ContactProfileResource) Arguments() map[string]*schema.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "minimum_variable_contact_duration": { diff --git a/internal/services/postgres/postgresql_flexible_server_resource.go b/internal/services/postgres/postgresql_flexible_server_resource.go index 22560c7046c7..9c14fa567a36 100644 --- a/internal/services/postgres/postgresql_flexible_server_resource.go +++ b/internal/services/postgres/postgresql_flexible_server_resource.go @@ -21,7 +21,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/postgres/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -150,7 +149,7 @@ func resourcePostgresqlFlexibleServer() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_dns_zone_id": { diff --git a/internal/services/postgres/postgresql_virtual_network_rule_resource.go b/internal/services/postgres/postgresql_virtual_network_rule_resource.go index 30e2308eec10..b406df76bb05 100644 --- a/internal/services/postgres/postgresql_virtual_network_rule_resource.go +++ b/internal/services/postgres/postgresql_virtual_network_rule_resource.go @@ -7,6 +7,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/virtualnetworkrules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -57,7 +58,7 @@ func resourcePostgreSQLVirtualNetworkRule() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "ignore_missing_vnet_service_endpoint": { diff --git a/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go b/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go index 95e8bc25f526..6cf95061569f 100644 --- a/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go +++ b/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go @@ -6,13 +6,13 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/privatedns/2018-09-01/virtualnetworklinks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -63,7 +63,7 @@ func resourcePrivateDnsZoneVirtualNetworkLink() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "registration_enabled": { diff --git a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go index e7ad4d3d1c6e..06c2a73c78f1 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go @@ -7,12 +7,12 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/inboundendpoints" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -71,7 +71,7 @@ func (r PrivateDNSResolverInboundEndpointResource) Arguments() map[string]*plugi "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_ip_address": { diff --git a/internal/services/privatednsresolver/private_dns_resolver_outbound_endpoint_resource.go b/internal/services/privatednsresolver/private_dns_resolver_outbound_endpoint_resource.go index 6dfd764cffb3..0f16cb70b634 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_outbound_endpoint_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_outbound_endpoint_resource.go @@ -7,12 +7,12 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/outboundendpoints" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -61,7 +61,7 @@ func (r PrivateDNSResolverOutboundEndpointResource) Arguments() map[string]*plug Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "location": commonschema.Location(), diff --git a/internal/services/privatednsresolver/private_dns_resolver_resource.go b/internal/services/privatednsresolver/private_dns_resolver_resource.go index e4c94eb4ee28..6942575e7e31 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_resource.go @@ -6,11 +6,11 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -56,7 +56,7 @@ func (r PrivateDNSResolverDnsResolverResource) Arguments() map[string]*pluginsdk Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "tags": commonschema.Tags(), diff --git a/internal/services/privatednsresolver/private_dns_resolver_virtual_network_link_resource.go b/internal/services/privatednsresolver/private_dns_resolver_virtual_network_link_resource.go index c7482102052a..31c3089252ad 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_virtual_network_link_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_virtual_network_link_resource.go @@ -6,10 +6,10 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets" "github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/virtualnetworklinks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) @@ -57,7 +57,7 @@ func (r PrivateDNSResolverVirtualNetworkLinkResource) Arguments() map[string]*pl Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.VirtualNetworkID, + ValidateFunc: commonids.ValidateVirtualNetworkID, }, "metadata": { diff --git a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go index c5199db73c9b..4024c805a5f9 100644 --- a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go +++ b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go @@ -5,12 +5,12 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationnetworkmappings" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -96,12 +96,12 @@ func resourceSiteRecoveryNetworkMappingCreate(d *pluginsdk.ResourceData, meta in defer cancel() // get network name from id - parsedSourceNetworkId, err := networkParse.VirtualNetworkID(sourceNetworkId) + parsedSourceNetworkId, err := commonids.ParseVirtualNetworkID(sourceNetworkId) if err != nil { return fmt.Errorf("[ERROR] Unable to parse source_network_id '%s' (network mapping %s): %+v", sourceNetworkId, name, err) } - id := replicationnetworkmappings.NewReplicationNetworkMappingID(subscriptionId, resGroup, vaultName, fabricName, parsedSourceNetworkId.Name, name) + id := replicationnetworkmappings.NewReplicationNetworkMappingID(subscriptionId, resGroup, vaultName, fabricName, parsedSourceNetworkId.VirtualNetworkName, name) if d.IsNewResource() { existing, err := client.Get(ctx, id) diff --git a/internal/services/redis/redis_cache_data_source.go b/internal/services/redis/redis_cache_data_source.go index f25aadcf5e44..d77cad4c46dc 100644 --- a/internal/services/redis/redis_cache_data_source.go +++ b/internal/services/redis/redis_cache_data_source.go @@ -5,6 +5,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" @@ -12,7 +13,6 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/redis/2022-06-01/patchschedules" "github.com/hashicorp/go-azure-sdk/resource-manager/redis/2022-06-01/redis" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" ) @@ -288,7 +288,7 @@ func dataSourceRedisCacheRead(d *pluginsdk.ResourceData, meta interface{}) error d.Set("private_static_ip_address", props.StaticIP) subnetId := "" if props.SubnetId != nil { - parsed, err := networkParse.SubnetIDInsensitively(*props.SubnetId) + parsed, err := commonids.ParseSubnetIDInsensitively(*props.SubnetId) if err != nil { return err } diff --git a/internal/services/redis/redis_cache_resource.go b/internal/services/redis/redis_cache_resource.go index 3fb52ea19598..a40cc6873f87 100644 --- a/internal/services/redis/redis_cache_resource.go +++ b/internal/services/redis/redis_cache_resource.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -23,8 +24,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/redis/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/redis/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -126,7 +125,7 @@ func resourceRedisCache() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "private_static_ip_address": { @@ -433,7 +432,7 @@ func resourceRedisCacheCreate(d *pluginsdk.ResourceData, meta interface{}) error } if v, ok := d.GetOk("subnet_id"); ok { - parsed, parseErr := networkParse.SubnetID(v.(string)) + parsed, parseErr := commonids.ParseSubnetID(v.(string)) if parseErr != nil { return err } @@ -441,8 +440,8 @@ func resourceRedisCacheCreate(d *pluginsdk.ResourceData, meta interface{}) error locks.ByName(parsed.VirtualNetworkName, network.VirtualNetworkResourceName) defer locks.UnlockByName(parsed.VirtualNetworkName, network.VirtualNetworkResourceName) - locks.ByName(parsed.Name, network.SubnetResourceName) - defer locks.UnlockByName(parsed.Name, network.SubnetResourceName) + locks.ByName(parsed.SubnetName, network.SubnetResourceName) + defer locks.UnlockByName(parsed.SubnetName, network.SubnetResourceName) parameters.Properties.SubnetId = utils.String(v.(string)) } @@ -689,7 +688,7 @@ func resourceRedisCacheRead(d *pluginsdk.ResourceData, meta interface{}) error { subnetId := "" if props.SubnetId != nil { - parsed, err := networkParse.SubnetIDInsensitively(*props.SubnetId) + parsed, err := commonids.ParseSubnetIDInsensitively(*props.SubnetId) if err != nil { return err } @@ -748,7 +747,7 @@ func resourceRedisCacheDelete(d *pluginsdk.ResourceData, meta interface{}) error return fmt.Errorf("retrieving %s: `model` was nil", *id) } if subnetID := read.Model.Properties.SubnetId; subnetID != nil { - parsed, parseErr := networkParse.SubnetIDInsensitively(*subnetID) + parsed, parseErr := commonids.ParseSubnetIDInsensitively(*subnetID) if parseErr != nil { return err } @@ -756,8 +755,8 @@ func resourceRedisCacheDelete(d *pluginsdk.ResourceData, meta interface{}) error locks.ByName(parsed.VirtualNetworkName, network.VirtualNetworkResourceName) defer locks.UnlockByName(parsed.VirtualNetworkName, network.VirtualNetworkResourceName) - locks.ByName(parsed.Name, network.SubnetResourceName) - defer locks.UnlockByName(parsed.Name, network.SubnetResourceName) + locks.ByName(parsed.SubnetName, network.SubnetResourceName) + defer locks.UnlockByName(parsed.SubnetName, network.SubnetResourceName) } if err := client.DeleteThenPoll(ctx, *id); err != nil { diff --git a/internal/services/servicebus/servicebus_namespace_network_rule_set_resource.go b/internal/services/servicebus/servicebus_namespace_network_rule_set_resource.go index 9858dfc7870a..f9b6615f3de9 100644 --- a/internal/services/servicebus/servicebus_namespace_network_rule_set_resource.go +++ b/internal/services/servicebus/servicebus_namespace_network_rule_set_resource.go @@ -7,10 +7,10 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2022-01-01-preview/namespaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - validateNetwork "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/servicebus/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/set" @@ -97,7 +97,7 @@ func resourceServicebusNamespaceNetworkRuleSetSchema() map[string]*pluginsdk.Sch "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: validateNetwork.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, // The subnet ID returned from the service will have `resourceGroup/{resourceGroupName}` all in lower cases... DiffSuppressFunc: suppress.CaseDifference, }, diff --git a/internal/services/springcloud/spring_cloud_service_resource.go b/internal/services/springcloud/spring_cloud_service_resource.go index 0968bf6c6f56..88aa7071194b 100644 --- a/internal/services/springcloud/spring_cloud_service_resource.go +++ b/internal/services/springcloud/spring_cloud_service_resource.go @@ -8,12 +8,12 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/springcloud/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/springcloud/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/springcloud/validate" @@ -151,14 +151,14 @@ func resourceSpringCloudService() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "service_runtime_subnet_id": { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "cidr_ranges": { diff --git a/internal/services/sql/sql_managed_instance_resource.go b/internal/services/sql/sql_managed_instance_resource.go index a324c81df68a..fb5fb22f3f17 100644 --- a/internal/services/sql/sql_managed_instance_resource.go +++ b/internal/services/sql/sql_managed_instance_resource.go @@ -9,6 +9,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -16,7 +17,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/sql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -117,7 +117,7 @@ func resourceArmSqlMiServer() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "collation": { diff --git a/internal/services/storage/storage_account_resource.go b/internal/services/storage/storage_account_resource.go index 5d837e8b2fad..7863942493ab 100644 --- a/internal/services/storage/storage_account_resource.go +++ b/internal/services/storage/storage_account_resource.go @@ -27,7 +27,6 @@ import ( keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - vnetParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" resource "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/migration" @@ -2269,7 +2268,7 @@ func resourceStorageAccountDelete(d *pluginsdk.ResourceData, meta interface{}) e continue } - id, err2 := vnetParse.SubnetID(*v.VirtualNetworkResourceID) + id, err2 := commonids.ParseSubnetID(*v.VirtualNetworkResourceID) if err2 != nil { return err2 } diff --git a/internal/services/synapse/synapse_workspace_resource.go b/internal/services/synapse/synapse_workspace_resource.go index 4964bffa65be..76fe9dad0c39 100644 --- a/internal/services/synapse/synapse_workspace_resource.go +++ b/internal/services/synapse/synapse_workspace_resource.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/synapse/mgmt/v2.0/synapse" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -18,7 +19,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/synapse/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/synapse/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" @@ -95,7 +95,7 @@ func resourceSynapseWorkspace() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "data_exfiltration_protection_enabled": { diff --git a/internal/services/web/app_service_environment_resource.go b/internal/services/web/app_service_environment_resource.go index 3dfe98d44c26..ac7cfecd15d3 100644 --- a/internal/services/web/app_service_environment_resource.go +++ b/internal/services/web/app_service_environment_resource.go @@ -9,13 +9,12 @@ import ( "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" helpersValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" @@ -69,7 +68,7 @@ func resourceAppServiceEnvironmentCreate(d *pluginsdk.ResourceData, meta interfa } subnetId := d.Get("subnet_id").(string) - subnet, err := networkParse.SubnetID(subnetId) + subnet, err := commonids.ParseSubnetID(subnetId) if err != nil { return err } @@ -79,15 +78,15 @@ func resourceAppServiceEnvironmentCreate(d *pluginsdk.ResourceData, meta interfa // compatibility, we still allow user to use the resource group of Subnet to be the one for // ASE implicitly. While allow user to explicitly specify the resource group, which takes higher // precedence. - resourceGroup := subnet.ResourceGroup + resourceGroup := subnet.ResourceGroupName if v, ok := d.GetOk("resource_group_name"); ok { resourceGroup = v.(string) } id := parse.NewAppServiceEnvironmentID(subscriptionId, resourceGroup, d.Get("name").(string)) - vnet, err := networksClient.Get(ctx, subnet.ResourceGroup, subnet.VirtualNetworkName, "") + vnet, err := networksClient.Get(ctx, subnet.ResourceGroupName, subnet.VirtualNetworkName, "") if err != nil { - return fmt.Errorf("retrieving Virtual Network %q (Resource Group %q): %+v", subnet.VirtualNetworkName, subnet.ResourceGroup, err) + return fmt.Errorf("retrieving Virtual Network %q (Resource Group %q): %+v", subnet.VirtualNetworkName, subnet.ResourceGroupName, err) } // the App Service Environment has to be in the same location as the Virtual Network @@ -95,7 +94,7 @@ func resourceAppServiceEnvironmentCreate(d *pluginsdk.ResourceData, meta interfa if loc := vnet.Location; loc != nil { location = azure.NormalizeLocation(*loc) } else { - return fmt.Errorf("determining Location from Virtual Network %q (Resource Group %q): `location` was nil", subnet.VirtualNetworkName, subnet.ResourceGroup) + return fmt.Errorf("determining Location from Virtual Network %q (Resource Group %q): `location` was nil", subnet.VirtualNetworkName, subnet.ResourceGroupName) } existing, err := client.Get(ctx, id.ResourceGroup, id.HostingEnvironmentName) @@ -121,7 +120,7 @@ func resourceAppServiceEnvironmentCreate(d *pluginsdk.ResourceData, meta interfa MultiSize: utils.String(convertFromIsolatedSKU(pricingTier)), VirtualNetwork: &web.VirtualNetworkProfile{ ID: utils.String(subnetId), - Subnet: utils.String(subnet.Name), + Subnet: utils.String(subnet.SubnetName), }, UserWhitelistedIPRanges: utils.ExpandStringSlice(userWhitelistedIPRangesRaw), }, @@ -425,7 +424,7 @@ func resourceAppServiceEnvironmentSchema() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "cluster_setting": { diff --git a/internal/services/web/app_service_environment_v3_resource.go b/internal/services/web/app_service_environment_v3_resource.go index 35944a92c691..69cdcd45519e 100644 --- a/internal/services/web/app_service_environment_v3_resource.go +++ b/internal/services/web/app_service_environment_v3_resource.go @@ -7,11 +7,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" @@ -78,7 +77,7 @@ func (r AppServiceEnvironmentV3Resource) Arguments() map[string]*pluginsdk.Schem Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "allow_new_private_endpoint_connections": { @@ -248,19 +247,19 @@ func (r AppServiceEnvironmentV3Resource) Create() sdk.ResourceFunc { return fmt.Errorf("decoding %+v", err) } - subnet, err := networkParse.SubnetID(model.SubnetId) + subnet, err := commonids.ParseSubnetID(model.SubnetId) if err != nil { return err } - vnet, err := networksClient.Get(ctx, subnet.ResourceGroup, subnet.VirtualNetworkName, "") + vnet, err := networksClient.Get(ctx, subnet.ResourceGroupName, subnet.VirtualNetworkName, "") if err != nil { - return fmt.Errorf("retrieving Virtual Network %q (Resource Group %q): %+v", subnet.VirtualNetworkName, subnet.ResourceGroup, err) + return fmt.Errorf("retrieving Virtual Network %q (Resource Group %q): %+v", subnet.VirtualNetworkName, subnet.ResourceGroupName, err) } vnetLoc := location.NormalizeNilable(vnet.Location) if vnetLoc == "" { - return fmt.Errorf("determining Location from Virtual Network %q (Resource Group %q): `location` was missing", subnet.VirtualNetworkName, subnet.ResourceGroup) + return fmt.Errorf("determining Location from Virtual Network %q (Resource Group %q): `location` was missing", subnet.VirtualNetworkName, subnet.ResourceGroupName) } id := parse.NewAppServiceEnvironmentID(subscriptionId, model.ResourceGroup, model.Name) diff --git a/internal/services/web/app_service_slot_virtual_network_swift_connection_resource.go b/internal/services/web/app_service_slot_virtual_network_swift_connection_resource.go index f5347bcda96f..43f6268eeb69 100644 --- a/internal/services/web/app_service_slot_virtual_network_swift_connection_resource.go +++ b/internal/services/web/app_service_slot_virtual_network_swift_connection_resource.go @@ -5,12 +5,11 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -48,7 +47,7 @@ func resourceAppServiceSlotVirtualNetworkSwiftConnection() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, "slot_name": { Type: pluginsdk.TypeString, @@ -71,14 +70,14 @@ func resourceAppServiceSlotVirtualNetworkSwiftConnectionCreateUpdate(d *pluginsd if err != nil { return fmt.Errorf("parsing app service ID %+v", err) } - subnetID, err := networkParse.SubnetID(d.Get("subnet_id").(string)) + subnetID, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return fmt.Errorf("parsing subnet ID %+v", err) } resourceGroup := appID.ResourceGroup name := appID.SiteName - subnetName := subnetID.Name + subnetName := subnetID.SubnetName virtualNetworkName := subnetID.VirtualNetworkName slotName := d.Get("slot_name").(string) @@ -139,7 +138,7 @@ func resourceAppServiceSlotVirtualNetworkSwiftConnectionCreateUpdate(d *pluginsd return fmt.Errorf("waiting for provisioning state of subnet for App Service Slot VNet association between %q (App Service %q / Resource Group %q) and Virtual Network %q: %s", slotName, name, resourceGroup, virtualNetworkName, err) } - vnetId := networkParse.NewVirtualNetworkID(subnetID.SubscriptionId, subnetID.ResourceGroup, subnetID.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(subnetID.SubscriptionId, subnetID.ResourceGroupName, subnetID.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(azureNetwork.ProvisioningStateUpdating)}, Target: []string{string(azureNetwork.ProvisioningStateSucceeded)}, @@ -220,11 +219,11 @@ func resourceAppServiceSlotVirtualNetworkSwiftConnectionDelete(d *pluginsdk.Reso return err } - subnetID, err := networkParse.SubnetID(d.Get("subnet_id").(string)) + subnetID, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return fmt.Errorf("parsing Subnet Resource ID %q", subnetID) } - subnetName := subnetID.Name + subnetName := subnetID.SubnetName virtualNetworkName := subnetID.VirtualNetworkName locks.ByName(virtualNetworkName, network.VirtualNetworkResourceName) diff --git a/internal/services/web/app_service_virtual_network_swift_connection_resource.go b/internal/services/web/app_service_virtual_network_swift_connection_resource.go index 5f1bd7a8725c..9dd9e9e90e5c 100644 --- a/internal/services/web/app_service_virtual_network_swift_connection_resource.go +++ b/internal/services/web/app_service_virtual_network_swift_connection_resource.go @@ -5,12 +5,11 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" - networkParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -48,7 +47,7 @@ func resourceAppServiceVirtualNetworkSwiftConnection() *pluginsdk.Resource { "subnet_id": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: networkValidate.SubnetID, + ValidateFunc: commonids.ValidateSubnetID, }, }, } @@ -66,14 +65,14 @@ func resourceAppServiceVirtualNetworkSwiftConnectionCreateUpdate(d *pluginsdk.Re return fmt.Errorf("parsing App Service Resource ID %q", appID) } - subnetID, err := networkParse.SubnetID(d.Get("subnet_id").(string)) + subnetID, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return fmt.Errorf("parsing Subnet Resource ID %q", subnetID) } resourceGroup := appID.ResourceGroup name := appID.SiteName - subnetName := subnetID.Name + subnetName := subnetID.SubnetName virtualNetworkName := subnetID.VirtualNetworkName if d.IsNewResource() { @@ -125,7 +124,7 @@ func resourceAppServiceVirtualNetworkSwiftConnectionCreateUpdate(d *pluginsdk.Re return fmt.Errorf("waiting for provisioning state of subnet for App Service VNet association between %q (Resource Group %q) and Virtual Network %q: %s", name, resourceGroup, virtualNetworkName, err) } - vnetId := networkParse.NewVirtualNetworkID(subnetID.SubscriptionId, subnetID.ResourceGroup, subnetID.VirtualNetworkName) + vnetId := commonids.NewVirtualNetworkID(subnetID.SubscriptionId, subnetID.ResourceGroupName, subnetID.VirtualNetworkName) vnetStateConf := &pluginsdk.StateChangeConf{ Pending: []string{string(azureNetwork.ProvisioningStateUpdating)}, Target: []string{string(azureNetwork.ProvisioningStateSucceeded)}, @@ -197,11 +196,11 @@ func resourceAppServiceVirtualNetworkSwiftConnectionDelete(d *pluginsdk.Resource return err } - subnetID, err := networkParse.SubnetID(d.Get("subnet_id").(string)) + subnetID, err := commonids.ParseSubnetID(d.Get("subnet_id").(string)) if err != nil { return fmt.Errorf("parsing Subnet Resource ID %q", subnetID) } - subnetName := subnetID.Name + subnetName := subnetID.SubnetName virtualNetworkName := subnetID.VirtualNetworkName locks.ByName(virtualNetworkName, network.VirtualNetworkResourceName) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/kubernetes_cluster.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_managedcluster.go rename to vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/kubernetes_cluster.go index 0288ce671dd1..0457e72fd694 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_managedcluster.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/kubernetes_cluster.go @@ -1,4 +1,7 @@ -package managedclusters +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids import ( "fmt" @@ -7,37 +10,34 @@ import ( "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 = ManagedClusterId{} +var _ resourceids.ResourceId = KubernetesClusterId{} -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { +// KubernetesClusterId is a struct representing the Resource ID for a Kubernetes Cluster +type KubernetesClusterId struct { SubscriptionId string ResourceGroupName string ManagedClusterName string } -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ +// NewKubernetesClusterID returns a new KubernetesClusterId struct +func NewKubernetesClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) KubernetesClusterId { + return KubernetesClusterId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, ManagedClusterName: managedClusterName, } } -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) +// ParseKubernetesClusterID parses 'input' into a KubernetesClusterId +func ParseKubernetesClusterID(input string) (*KubernetesClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(KubernetesClusterId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } var ok bool - id := ManagedClusterId{} + id := KubernetesClusterId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) @@ -54,17 +54,17 @@ func ParseManagedClusterID(input string) (*ManagedClusterId, error) { return &id, nil } -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId +// ParseKubernetesClusterIdInsensitively parses 'input' case-insensitively into a KubernetesClusterId // note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) +func ParseKubernetesClusterIDInsensitively(input string) (*KubernetesClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(KubernetesClusterId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } var ok bool - id := ManagedClusterId{} + id := KubernetesClusterId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) @@ -81,29 +81,29 @@ func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) return &id, nil } -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateKubernetesClusterID checks that 'input' can be parsed as a Kubernetes Cluster ID +func ValidateKubernetesClusterID(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 := ParseManagedClusterID(v); err != nil { + if _, err := ParseKubernetesClusterID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { +// ID returns the formatted Kubernetes Cluster ID +func (id KubernetesClusterId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) } -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Kubernetes Cluster ID +func (id KubernetesClusterId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -116,12 +116,12 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { } } -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { +// String returns a human-readable description of this Kubernetes Cluster ID +func (id KubernetesClusterId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Kubernetes Cluster Name: %q", id.ManagedClusterName), } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Kubernetes Cluster (%s)", strings.Join(components, "\n")) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/id_subnet.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/id_subnet.go deleted file mode 100644 index 73e3a25dcae1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/id_subnet.go +++ /dev/null @@ -1,140 +0,0 @@ -package containerinstance - -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 = SubnetId{} - -// SubnetId is a struct representing the Resource ID for a Subnet -type SubnetId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkName string - SubnetName string -} - -// NewSubnetID returns a new SubnetId struct -func NewSubnetID(subscriptionId string, resourceGroupName string, virtualNetworkName string, subnetName string) SubnetId { - return SubnetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkName: virtualNetworkName, - SubnetName: subnetName, - } -} - -// ParseSubnetID parses 'input' into a SubnetId -func ParseSubnetID(input string) (*SubnetId, error) { - parser := resourceids.NewParserFromResourceIdType(SubnetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SubnetId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - if id.SubnetName, ok = parsed.Parsed["subnetName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subnetName", *parsed) - } - - return &id, nil -} - -// ParseSubnetIDInsensitively parses 'input' case-insensitively into a SubnetId -// note: this method should only be used for API response data and not user input -func ParseSubnetIDInsensitively(input string) (*SubnetId, error) { - parser := resourceids.NewParserFromResourceIdType(SubnetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SubnetId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - if id.SubnetName, ok = parsed.Parsed["subnetName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subnetName", *parsed) - } - - return &id, nil -} - -// ValidateSubnetID checks that 'input' can be parsed as a Subnet ID -func ValidateSubnetID(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 := ParseSubnetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Subnet ID -func (id SubnetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/subnets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName, id.SubnetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Subnet ID -func (id SubnetId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), - resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), - resourceids.StaticSegment("staticSubnets", "subnets", "subnets"), - resourceids.UserSpecifiedSegment("subnetName", "subnetValue"), - } -} - -// String returns a human-readable description of this Subnet ID -func (id SubnetId) 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), - fmt.Sprintf("Subnet Name: %q", id.SubnetName), - } - return fmt.Sprintf("Subnet (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/method_subnetserviceassociationlinkdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/method_subnetserviceassociationlinkdelete_autorest.go index 0202870bc425..0a90357e821c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/method_subnetserviceassociationlinkdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance/method_subnetserviceassociationlinkdelete_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type SubnetServiceAssociationLinkDeleteOperationResponse struct { } // SubnetServiceAssociationLinkDelete ... -func (c ContainerInstanceClient) SubnetServiceAssociationLinkDelete(ctx context.Context, id SubnetId) (result SubnetServiceAssociationLinkDeleteOperationResponse, err error) { +func (c ContainerInstanceClient) SubnetServiceAssociationLinkDelete(ctx context.Context, id commonids.SubnetId) (result SubnetServiceAssociationLinkDeleteOperationResponse, err error) { req, err := c.preparerForSubnetServiceAssociationLinkDelete(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "containerinstance.ContainerInstanceClient", "SubnetServiceAssociationLinkDelete", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ContainerInstanceClient) SubnetServiceAssociationLinkDelete(ctx context. } // SubnetServiceAssociationLinkDeleteThenPoll performs SubnetServiceAssociationLinkDelete then polls until it's completed -func (c ContainerInstanceClient) SubnetServiceAssociationLinkDeleteThenPoll(ctx context.Context, id SubnetId) error { +func (c ContainerInstanceClient) SubnetServiceAssociationLinkDeleteThenPoll(ctx context.Context, id commonids.SubnetId) error { result, err := c.SubnetServiceAssociationLinkDelete(ctx, id) if err != nil { return fmt.Errorf("performing SubnetServiceAssociationLinkDelete: %+v", err) @@ -50,7 +51,7 @@ func (c ContainerInstanceClient) SubnetServiceAssociationLinkDeleteThenPoll(ctx } // preparerForSubnetServiceAssociationLinkDelete prepares the SubnetServiceAssociationLinkDelete request. -func (c ContainerInstanceClient) preparerForSubnetServiceAssociationLinkDelete(ctx context.Context, id SubnetId) (*http.Request, error) { +func (c ContainerInstanceClient) preparerForSubnetServiceAssociationLinkDelete(ctx context.Context, id commonids.SubnetId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md index 68dcc8d6d366..cf30f96688ba 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := agentpools.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.GetAvailableAgentPoolVersions(ctx, id) if err != nil { @@ -117,7 +117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := agentpools.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/id_managedcluster.go deleted file mode 100644 index 682444af5ec2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package agentpools - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go index 9cdff78ed4c6..73e49c546708 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type GetAvailableAgentPoolVersionsOperationResponse struct { } // GetAvailableAgentPoolVersions ... -func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id ManagedClusterId) (result GetAvailableAgentPoolVersionsOperationResponse, err error) { +func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id commonids.KubernetesClusterId) (result GetAvailableAgentPoolVersionsOperationResponse, err error) { req, err := c.preparerForGetAvailableAgentPoolVersions(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "agentpools.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id } // preparerForGetAvailableAgentPoolVersions prepares the GetAvailableAgentPoolVersions request. -func (c AgentPoolsClient) preparerForGetAvailableAgentPoolVersions(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c AgentPoolsClient) preparerForGetAvailableAgentPoolVersions(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list_autorest.go index 2dbc9943693c..85002f4ba417 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperation } // List ... -func (c AgentPoolsClient) List(ctx context.Context, id ManagedClusterId) (resp ListOperationResponse, err error) { +func (c AgentPoolsClient) List(ctx context.Context, id commonids.KubernetesClusterId) (resp ListOperationResponse, err error) { req, err := c.preparerForList(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "agentpools.AgentPoolsClient", "List", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c AgentPoolsClient) List(ctx context.Context, id ManagedClusterId) (resp L } // preparerForList prepares the List request. -func (c AgentPoolsClient) preparerForList(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c AgentPoolsClient) preparerForList(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c AgentPoolsClient) responderForList(resp *http.Response) (result ListOper } // ListComplete retrieves all of the results into a single object -func (c AgentPoolsClient) ListComplete(ctx context.Context, id ManagedClusterId) (ListCompleteResult, error) { +func (c AgentPoolsClient) ListComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListCompleteResult, error) { return c.ListCompleteMatchingPredicate(ctx, id, AgentPoolOperationPredicate{}) } // ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c AgentPoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate AgentPoolOperationPredicate) (resp ListCompleteResult, err error) { +func (c AgentPoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate AgentPoolOperationPredicate) (resp ListCompleteResult, err error) { items := make([]AgentPool, 0) page, err := c.List(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md index 478498355da1..8dc96bd0ab42 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := maintenanceconfigurations.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.ListByManagedCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByManagedClusterComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_managedcluster.go deleted file mode 100644 index ab6f2309edd0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package maintenanceconfigurations - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go index 5fa46cf3abbe..7463165baacd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListByManagedClusterOperationResponse) LoadMore(ctx context.Context) (re } // ListByManagedCluster ... -func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, id ManagedClusterId) (resp ListByManagedClusterOperationResponse, err error) { +func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, id commonids.KubernetesClusterId) (resp ListByManagedClusterOperationResponse, err error) { req, err := c.preparerForListByManagedCluster(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "maintenanceconfigurations.MaintenanceConfigurationsClient", "ListByManagedCluster", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Contex } // preparerForListByManagedCluster prepares the ListByManagedCluster request. -func (c MaintenanceConfigurationsClient) preparerForListByManagedCluster(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c MaintenanceConfigurationsClient) preparerForListByManagedCluster(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c MaintenanceConfigurationsClient) responderForListByManagedCluster(resp * } // ListByManagedClusterComplete retrieves all of the results into a single object -func (c MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, id ManagedClusterId) (ListByManagedClusterCompleteResult, error) { +func (c MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListByManagedClusterCompleteResult, error) { return c.ListByManagedClusterCompleteMatchingPredicate(ctx, id, MaintenanceConfigurationOperationPredicate{}) } // ListByManagedClusterCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c MaintenanceConfigurationsClient) ListByManagedClusterCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate MaintenanceConfigurationOperationPredicate) (resp ListByManagedClusterCompleteResult, err error) { +func (c MaintenanceConfigurationsClient) ListByManagedClusterCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate MaintenanceConfigurationOperationPredicate) (resp ListByManagedClusterCompleteResult, err error) { items := make([]MaintenanceConfiguration, 0) page, err := c.ListByManagedCluster(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md index 30e931da6f6d..0491d5a6b2cf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.AbortLatestOperation(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedCluster{ // ... @@ -57,7 +57,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -69,7 +69,7 @@ if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationO ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.Get(ctx, id) if err != nil { @@ -133,7 +133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.GetUpgradeProfile(ctx, id) if err != nil { @@ -183,7 +183,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterAdminCredentials(ctx, id, managedclusters.DefaultListClusterAdminCredentialsOperationOptions()) if err != nil { @@ -199,7 +199,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterMonitoringUserCredentials(ctx, id, managedclusters.DefaultListClusterMonitoringUserCredentialsOperationOptions()) if err != nil { @@ -215,7 +215,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterUserCredentials(ctx, id, managedclusters.DefaultListClusterUserCredentialsOperationOptions()) if err != nil { @@ -231,7 +231,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -248,7 +248,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedClusterAADProfile{ // ... @@ -265,7 +265,7 @@ if err := client.ResetAADProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedClusterServicePrincipalProfile{ // ... @@ -282,7 +282,7 @@ if err := client.ResetServicePrincipalProfileThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { // handle the error @@ -294,7 +294,7 @@ if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { // handle the error @@ -306,7 +306,7 @@ if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.RunCommandRequest{ // ... @@ -323,7 +323,7 @@ if err := client.RunCommandThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -335,7 +335,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -347,7 +347,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.TagsObject{ // ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation_autorest.go index f68d76fa2e01..02061733da9f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ type AbortLatestOperationOperationResponse struct { } // AbortLatestOperation ... -func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id ManagedClusterId) (result AbortLatestOperationOperationResponse, err error) { +func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id commonids.KubernetesClusterId) (result AbortLatestOperationOperationResponse, err error) { req, err := c.preparerForAbortLatestOperation(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "AbortLatestOperation", nil, "Failure preparing request") @@ -40,7 +41,7 @@ func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id Mana } // preparerForAbortLatestOperation prepares the AbortLatestOperation request. -func (c ManagedClustersClient) preparerForAbortLatestOperation(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForAbortLatestOperation(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate_autorest.go index 3bf60ea59122..4118b1d4aa36 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type CreateOrUpdateOperationResponse struct { } // CreateOrUpdate ... -func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (result CreateOrUpdateOperationResponse, err error) { +func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (result CreateOrUpdateOperationResponse, err error) { req, err := c.preparerForCreateOrUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id ManagedClu } // CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id ManagedClusterId, input ManagedCluster) error { +func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) error { result, err := c.CreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdate: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id Ma } // preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c ManagedClustersClient) preparerForCreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (*http.Request, error) { +func (c ManagedClustersClient) preparerForCreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete_autorest.go index 0255e77f2611..b6a15e70f3bd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -43,7 +44,7 @@ func (o DeleteOperationOptions) toQueryString() map[string]interface{} { } // Delete ... -func (c ManagedClustersClient) Delete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { +func (c ManagedClustersClient) Delete(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { req, err := c.preparerForDelete(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Delete", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c ManagedClustersClient) Delete(ctx context.Context, id ManagedClusterId, } // DeleteThenPoll performs Delete then polls until it's completed -func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) error { +func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) error { result, err := c.Delete(ctx, id, options) if err != nil { return fmt.Errorf("performing Delete: %+v", err) @@ -74,7 +75,7 @@ func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id ManagedClu } // preparerForDelete prepares the Delete request. -func (c ManagedClustersClient) preparerForDelete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForDelete(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get_autorest.go index c5e08ae898de..dd792998fed2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get_autorest.go @@ -6,6 +6,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ type GetOperationResponse struct { } // Get ... -func (c ManagedClustersClient) Get(ctx context.Context, id ManagedClusterId) (result GetOperationResponse, err error) { +func (c ManagedClustersClient) Get(ctx context.Context, id commonids.KubernetesClusterId) (result GetOperationResponse, err error) { req, err := c.preparerForGet(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Get", nil, "Failure preparing request") @@ -40,7 +41,7 @@ func (c ManagedClustersClient) Get(ctx context.Context, id ManagedClusterId) (re } // preparerForGet prepares the Get request. -func (c ManagedClustersClient) preparerForGet(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForGet(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile_autorest.go index cb70f49aa028..cd10c7215b92 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type GetUpgradeProfileOperationResponse struct { } // GetUpgradeProfile ... -func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id ManagedClusterId) (result GetUpgradeProfileOperationResponse, err error) { +func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id commonids.KubernetesClusterId) (result GetUpgradeProfileOperationResponse, err error) { req, err := c.preparerForGetUpgradeProfile(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id Managed } // preparerForGetUpgradeProfile prepares the GetUpgradeProfile request. -func (c ManagedClustersClient) preparerForGetUpgradeProfile(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForGetUpgradeProfile(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go index e14b90ceb4e2..f8024c5b3075 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,7 +43,7 @@ func (o ListClusterAdminCredentialsOperationOptions) toQueryString() map[string] } // ListClusterAdminCredentials ... -func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterAdminCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") @@ -65,7 +66,7 @@ func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, } // preparerForListClusterAdminCredentials prepares the ListClusterAdminCredentials request. -func (c ManagedClustersClient) preparerForListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterAdminCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterAdminCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go index 6065e73fd64c..a7f62d3aff19 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,7 +43,7 @@ func (o ListClusterMonitoringUserCredentialsOperationOptions) toQueryString() ma } // ListClusterMonitoringUserCredentials ... -func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterMonitoringUserCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") @@ -65,7 +66,7 @@ func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context. } // preparerForListClusterMonitoringUserCredentials prepares the ListClusterMonitoringUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterMonitoringUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials_autorest.go index 2cd263f9b47e..0c90a5488c66 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,7 +48,7 @@ func (o ListClusterUserCredentialsOperationOptions) toQueryString() map[string]i } // ListClusterUserCredentials ... -func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterUserCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") @@ -70,7 +71,7 @@ func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, i } // preparerForListClusterUserCredentials prepares the ListClusterUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterUserCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go index cdc548f003d0..c3db60df9284 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListOutboundNetworkDependenciesEndpointsOperationResponse) LoadMore(ctx } // ListOutboundNetworkDependenciesEndpoints ... -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id commonids.KubernetesClusterId) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { req, err := c.preparerForListOutboundNetworkDependenciesEndpoints(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx cont } // preparerForListOutboundNetworkDependenciesEndpoints prepares the ListOutboundNetworkDependenciesEndpoints request. -func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpoints(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c ManagedClustersClient) responderForListOutboundNetworkDependenciesEndpoi } // ListOutboundNetworkDependenciesEndpointsComplete retrieves all of the results into a single object -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id ManagedClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { return c.ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx, id, OutboundEnvironmentEndpointOperationPredicate{}) } // ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (resp ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (resp ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { items := make([]OutboundEnvironmentEndpoint, 0) page, err := c.ListOutboundNetworkDependenciesEndpoints(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile_autorest.go index 8c3bf221bffb..5c43129a602b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type ResetAADProfileOperationResponse struct { } // ResetAADProfile ... -func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { +func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { req, err := c.preparerForResetAADProfile(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id ManagedCl } // ResetAADProfileThenPoll performs ResetAADProfile then polls until it's completed -func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) error { +func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) error { result, err := c.ResetAADProfile(ctx, id, input) if err != nil { return fmt.Errorf("performing ResetAADProfile: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id M } // preparerForResetAADProfile prepares the ResetAADProfile request. -func (c ManagedClustersClient) preparerForResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (*http.Request, error) { +func (c ManagedClustersClient) preparerForResetAADProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go index 7830267d6163..874e24031409 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type ResetServicePrincipalProfileOperationResponse struct { } // ResetServicePrincipalProfile ... -func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { +func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { req, err := c.preparerForResetServicePrincipalProfile(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, } // ResetServicePrincipalProfileThenPoll performs ResetServicePrincipalProfile then polls until it's completed -func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) error { +func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) error { result, err := c.ResetServicePrincipalProfile(ctx, id, input) if err != nil { return fmt.Errorf("performing ResetServicePrincipalProfile: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context. } // preparerForResetServicePrincipalProfile prepares the ResetServicePrincipalProfile request. -func (c ManagedClustersClient) preparerForResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (*http.Request, error) { +func (c ManagedClustersClient) preparerForResetServicePrincipalProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates_autorest.go index 83b54e351193..3dbf6a18a04e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RotateClusterCertificatesOperationResponse struct { } // RotateClusterCertificates ... -func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id ManagedClusterId) (result RotateClusterCertificatesOperationResponse, err error) { +func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id commonids.KubernetesClusterId) (result RotateClusterCertificatesOperationResponse, err error) { req, err := c.preparerForRotateClusterCertificates(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id } // RotateClusterCertificatesThenPoll performs RotateClusterCertificates then polls until it's completed -func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.RotateClusterCertificates(ctx, id) if err != nil { return fmt.Errorf("performing RotateClusterCertificates: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Con } // preparerForRotateClusterCertificates prepares the RotateClusterCertificates request. -func (c ManagedClustersClient) preparerForRotateClusterCertificates(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRotateClusterCertificates(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go index f5bf5cc8da57..d0806cb35c67 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RotateServiceAccountSigningKeysOperationResponse struct { } // RotateServiceAccountSigningKeys ... -func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { +func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id commonids.KubernetesClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { req, err := c.preparerForRotateServiceAccountSigningKeys(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateServiceAccountSigningKeys", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Conte } // RotateServiceAccountSigningKeysThenPoll performs RotateServiceAccountSigningKeys then polls until it's completed -func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.RotateServiceAccountSigningKeys(ctx, id) if err != nil { return fmt.Errorf("performing RotateServiceAccountSigningKeys: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx conte } // preparerForRotateServiceAccountSigningKeys prepares the RotateServiceAccountSigningKeys request. -func (c ManagedClustersClient) preparerForRotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRotateServiceAccountSigningKeys(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand_autorest.go index 4f3eecf77593..91b831bec3f0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RunCommandOperationResponse struct { } // RunCommand ... -func (c ManagedClustersClient) RunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { +func (c ManagedClustersClient) RunCommand(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { req, err := c.preparerForRunCommand(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RunCommand", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RunCommand(ctx context.Context, id ManagedCluster } // RunCommandThenPoll performs RunCommand then polls until it's completed -func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id ManagedClusterId, input RunCommandRequest) error { +func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) error { result, err := c.RunCommand(ctx, id, input) if err != nil { return fmt.Errorf("performing RunCommand: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id Manage } // preparerForRunCommand prepares the RunCommand request. -func (c ManagedClustersClient) preparerForRunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRunCommand(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start_autorest.go index e58f11e31c8a..523cd6864891 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type StartOperationResponse struct { } // Start ... -func (c ManagedClustersClient) Start(ctx context.Context, id ManagedClusterId) (result StartOperationResponse, err error) { +func (c ManagedClustersClient) Start(ctx context.Context, id commonids.KubernetesClusterId) (result StartOperationResponse, err error) { req, err := c.preparerForStart(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Start", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) Start(ctx context.Context, id ManagedClusterId) ( } // StartThenPoll performs Start then polls until it's completed -func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.Start(ctx, id) if err != nil { return fmt.Errorf("performing Start: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id ManagedClus } // preparerForStart prepares the Start request. -func (c ManagedClustersClient) preparerForStart(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForStart(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop_autorest.go index 1324f9e0ad44..ecd7e737a40d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type StopOperationResponse struct { } // Stop ... -func (c ManagedClustersClient) Stop(ctx context.Context, id ManagedClusterId) (result StopOperationResponse, err error) { +func (c ManagedClustersClient) Stop(ctx context.Context, id commonids.KubernetesClusterId) (result StopOperationResponse, err error) { req, err := c.preparerForStop(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Stop", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) Stop(ctx context.Context, id ManagedClusterId) (r } // StopThenPoll performs Stop then polls until it's completed -func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.Stop(ctx, id) if err != nil { return fmt.Errorf("performing Stop: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id ManagedClust } // preparerForStop prepares the Stop request. -func (c ManagedClustersClient) preparerForStop(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForStop(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags_autorest.go index 8786b846f79d..36cc9862f222 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type UpdateTagsOperationResponse struct { } // UpdateTags ... -func (c ManagedClustersClient) UpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (result UpdateTagsOperationResponse, err error) { +func (c ManagedClustersClient) UpdateTags(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) (result UpdateTagsOperationResponse, err error) { req, err := c.preparerForUpdateTags(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) UpdateTags(ctx context.Context, id ManagedCluster } // UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id ManagedClusterId, input TagsObject) error { +func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) error { result, err := c.UpdateTags(ctx, id, input) if err != nil { return fmt.Errorf("performing UpdateTags: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id Manage } // preparerForUpdateTags prepares the UpdateTags request. -func (c ManagedClustersClient) preparerForUpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (*http.Request, error) { +func (c ManagedClustersClient) preparerForUpdateTags(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md index 678513d94465..58bfce5badfe 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := privateendpointconnections.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.List(ctx, id) if err != nil { diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_managedcluster.go deleted file mode 100644 index 94fc097aee53..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package privateendpointconnections - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list_autorest.go index 28ce56dd9b8e..e2eaeb5697bc 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type ListOperationResponse struct { } // List ... -func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id ManagedClusterId) (result ListOperationResponse, err error) { +func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id commonids.KubernetesClusterId) (result ListOperationResponse, err error) { req, err := c.preparerForList(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "privateendpointconnections.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id ManagedCl } // preparerForList prepares the List request. -func (c PrivateEndpointConnectionsClient) preparerForList(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c PrivateEndpointConnectionsClient) preparerForList(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md index e392202628cd..532fb1035eb7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := privatelinkresources.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.List(ctx, id) if err != nil { diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/id_managedcluster.go deleted file mode 100644 index 9c71b02af6a9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package privatelinkresources - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list_autorest.go index 9b5041a10541..978d829230a5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type ListOperationResponse struct { } // List ... -func (c PrivateLinkResourcesClient) List(ctx context.Context, id ManagedClusterId) (result ListOperationResponse, err error) { +func (c PrivateLinkResourcesClient) List(ctx context.Context, id commonids.KubernetesClusterId) (result ListOperationResponse, err error) { req, err := c.preparerForList(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "privatelinkresources.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c PrivateLinkResourcesClient) List(ctx context.Context, id ManagedClusterI } // preparerForList prepares the List request. -func (c PrivateLinkResourcesClient) preparerForList(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c PrivateLinkResourcesClient) preparerForList(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md index 48acd1582dff..eddece44036b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resolveprivatelinkserviceid.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := resolveprivatelinkserviceid.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := resolveprivatelinkserviceid.PrivateLinkResource{ // ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/id_managedcluster.go deleted file mode 100644 index f9d1521ebc36..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package resolveprivatelinkserviceid - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post_autorest.go index ac9cf9681f76..8f98c5958a5d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type POSTOperationResponse struct { } // POST ... -func (c ResolvePrivateLinkServiceIdClient) POST(ctx context.Context, id ManagedClusterId, input PrivateLinkResource) (result POSTOperationResponse, err error) { +func (c ResolvePrivateLinkServiceIdClient) POST(ctx context.Context, id commonids.KubernetesClusterId, input PrivateLinkResource) (result POSTOperationResponse, err error) { req, err := c.preparerForPOST(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "resolveprivatelinkserviceid.ResolvePrivateLinkServiceIdClient", "POST", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c ResolvePrivateLinkServiceIdClient) POST(ctx context.Context, id ManagedC } // preparerForPOST prepares the POST request. -func (c ResolvePrivateLinkServiceIdClient) preparerForPOST(ctx context.Context, id ManagedClusterId, input PrivateLinkResource) (*http.Request, error) { +func (c ResolvePrivateLinkServiceIdClient) preparerForPOST(ctx context.Context, id commonids.KubernetesClusterId, input PrivateLinkResource) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md index 2936af00ebb4..1f8f588d44c9 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := trustedaccess.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := trustedaccess.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.RoleBindingsList(ctx, id)` can be used to do batched pagination items, err := client.RoleBindingsListComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_managedcluster.go deleted file mode 100644 index a31c5734960c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package trustedaccess - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist_autorest.go index 58f3c8bf173c..0358b505cbc7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r RoleBindingsListOperationResponse) LoadMore(ctx context.Context) (resp R } // RoleBindingsList ... -func (c TrustedAccessClient) RoleBindingsList(ctx context.Context, id ManagedClusterId) (resp RoleBindingsListOperationResponse, err error) { +func (c TrustedAccessClient) RoleBindingsList(ctx context.Context, id commonids.KubernetesClusterId) (resp RoleBindingsListOperationResponse, err error) { req, err := c.preparerForRoleBindingsList(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "trustedaccess.TrustedAccessClient", "RoleBindingsList", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c TrustedAccessClient) RoleBindingsList(ctx context.Context, id ManagedClu } // preparerForRoleBindingsList prepares the RoleBindingsList request. -func (c TrustedAccessClient) preparerForRoleBindingsList(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c TrustedAccessClient) preparerForRoleBindingsList(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c TrustedAccessClient) responderForRoleBindingsList(resp *http.Response) ( } // RoleBindingsListComplete retrieves all of the results into a single object -func (c TrustedAccessClient) RoleBindingsListComplete(ctx context.Context, id ManagedClusterId) (RoleBindingsListCompleteResult, error) { +func (c TrustedAccessClient) RoleBindingsListComplete(ctx context.Context, id commonids.KubernetesClusterId) (RoleBindingsListCompleteResult, error) { return c.RoleBindingsListCompleteMatchingPredicate(ctx, id, TrustedAccessRoleBindingOperationPredicate{}) } // RoleBindingsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c TrustedAccessClient) RoleBindingsListCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate TrustedAccessRoleBindingOperationPredicate) (resp RoleBindingsListCompleteResult, err error) { +func (c TrustedAccessClient) RoleBindingsListCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate TrustedAccessRoleBindingOperationPredicate) (resp RoleBindingsListCompleteResult, err error) { items := make([]TrustedAccessRoleBinding, 0) page, err := c.RoleBindingsList(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/README.md deleted file mode 100644 index e9e9e9171d88..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/README.md +++ /dev/null @@ -1,356 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters` Documentation - -The `managedclusters` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-02-02-preview`). - -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/containerservice/2023-02-02-preview/managedclusters" -``` - - -### Client Initialization - -```go -client := managedclusters.NewManagedClustersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ManagedClustersClient.AbortLatestOperation` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.ManagedCluster{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Delete` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Get` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.GetAccessProfile` - -```go -ctx := context.TODO() -id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "accessProfileValue") - -read, err := client.GetAccessProfile(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.GetCommandResult` - -```go -ctx := context.TODO() -id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue") - -read, err := client.GetCommandResult(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.GetOSOptions` - -```go -ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.GetOSOptions(ctx, id, managedclusters.DefaultGetOSOptionsOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.GetUpgradeProfile` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -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: `ManagedClustersClient.List` - -```go -ctx := context.TODO() -id := managedclusters.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ManagedClustersClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := managedclusters.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: `ManagedClustersClient.ListClusterAdminCredentials` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -read, err := client.ListClusterAdminCredentials(ctx, id, managedclusters.DefaultListClusterAdminCredentialsOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.ListClusterMonitoringUserCredentials` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -read, err := client.ListClusterMonitoringUserCredentials(ctx, id, managedclusters.DefaultListClusterMonitoringUserCredentialsOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.ListClusterUserCredentials` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -read, err := client.ListClusterUserCredentials(ctx, id, managedclusters.DefaultListClusterUserCredentialsOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -// alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination -items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ManagedClustersClient.ResetAADProfile` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.ManagedClusterAADProfile{ - // ... -} - - -if err := client.ResetAADProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.ResetServicePrincipalProfile` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.ManagedClusterServicePrincipalProfile{ - // ... -} - - -if err := client.ResetServicePrincipalProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.RotateClusterCertificates` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.RotateServiceAccountSigningKeys` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.RunCommand` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.RunCommandRequest{ - // ... -} - - -if err := client.RunCommandThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Start` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Stop` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.UpdateTags` - -```go -ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/client.go deleted file mode 100644 index df94ecc4199e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedclusters - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClustersClient struct { - Client autorest.Client - baseUri string -} - -func NewManagedClustersClientWithBaseURI(endpoint string) ManagedClustersClient { - return ManagedClustersClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/constants.go deleted file mode 100644 index e215480c4375..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/constants.go +++ /dev/null @@ -1,1223 +0,0 @@ -package managedclusters - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AgentPoolMode string - -const ( - AgentPoolModeSystem AgentPoolMode = "System" - AgentPoolModeUser AgentPoolMode = "User" -) - -func PossibleValuesForAgentPoolMode() []string { - return []string{ - string(AgentPoolModeSystem), - string(AgentPoolModeUser), - } -} - -func parseAgentPoolMode(input string) (*AgentPoolMode, error) { - vals := map[string]AgentPoolMode{ - "system": AgentPoolModeSystem, - "user": AgentPoolModeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AgentPoolMode(input) - return &out, nil -} - -type AgentPoolType string - -const ( - AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet" - AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" -) - -func PossibleValuesForAgentPoolType() []string { - return []string{ - string(AgentPoolTypeAvailabilitySet), - string(AgentPoolTypeVirtualMachineScaleSets), - } -} - -func parseAgentPoolType(input string) (*AgentPoolType, error) { - vals := map[string]AgentPoolType{ - "availabilityset": AgentPoolTypeAvailabilitySet, - "virtualmachinescalesets": AgentPoolTypeVirtualMachineScaleSets, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AgentPoolType(input) - return &out, nil -} - -type BackendPoolType string - -const ( - BackendPoolTypeNodeIP BackendPoolType = "NodeIP" - BackendPoolTypeNodeIPConfiguration BackendPoolType = "NodeIPConfiguration" -) - -func PossibleValuesForBackendPoolType() []string { - return []string{ - string(BackendPoolTypeNodeIP), - string(BackendPoolTypeNodeIPConfiguration), - } -} - -func parseBackendPoolType(input string) (*BackendPoolType, error) { - vals := map[string]BackendPoolType{ - "nodeip": BackendPoolTypeNodeIP, - "nodeipconfiguration": BackendPoolTypeNodeIPConfiguration, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackendPoolType(input) - return &out, nil -} - -type Code string - -const ( - CodeRunning Code = "Running" - CodeStopped Code = "Stopped" -) - -func PossibleValuesForCode() []string { - return []string{ - string(CodeRunning), - string(CodeStopped), - } -} - -func parseCode(input string) (*Code, error) { - vals := map[string]Code{ - "running": CodeRunning, - "stopped": CodeStopped, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Code(input) - return &out, nil -} - -type ControlPlaneUpgradeOverride string - -const ( - ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations ControlPlaneUpgradeOverride = "IgnoreKubernetesDeprecations" -) - -func PossibleValuesForControlPlaneUpgradeOverride() []string { - return []string{ - string(ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations), - } -} - -func parseControlPlaneUpgradeOverride(input string) (*ControlPlaneUpgradeOverride, error) { - vals := map[string]ControlPlaneUpgradeOverride{ - "ignorekubernetesdeprecations": ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ControlPlaneUpgradeOverride(input) - return &out, nil -} - -type ControlledValues string - -const ( - ControlledValuesRequestsAndLimits ControlledValues = "RequestsAndLimits" - ControlledValuesRequestsOnly ControlledValues = "RequestsOnly" -) - -func PossibleValuesForControlledValues() []string { - return []string{ - string(ControlledValuesRequestsAndLimits), - string(ControlledValuesRequestsOnly), - } -} - -func parseControlledValues(input string) (*ControlledValues, error) { - vals := map[string]ControlledValues{ - "requestsandlimits": ControlledValuesRequestsAndLimits, - "requestsonly": ControlledValuesRequestsOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ControlledValues(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 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 Format string - -const ( - FormatAzure Format = "azure" - FormatExec Format = "exec" -) - -func PossibleValuesForFormat() []string { - return []string{ - string(FormatAzure), - string(FormatExec), - } -} - -func parseFormat(input string) (*Format, error) { - vals := map[string]Format{ - "azure": FormatAzure, - "exec": FormatExec, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Format(input) - return &out, nil -} - -type GPUInstanceProfile string - -const ( - GPUInstanceProfileMIGFourg GPUInstanceProfile = "MIG4g" - GPUInstanceProfileMIGOneg GPUInstanceProfile = "MIG1g" - GPUInstanceProfileMIGSeveng GPUInstanceProfile = "MIG7g" - GPUInstanceProfileMIGThreeg GPUInstanceProfile = "MIG3g" - GPUInstanceProfileMIGTwog GPUInstanceProfile = "MIG2g" -) - -func PossibleValuesForGPUInstanceProfile() []string { - return []string{ - string(GPUInstanceProfileMIGFourg), - string(GPUInstanceProfileMIGOneg), - string(GPUInstanceProfileMIGSeveng), - string(GPUInstanceProfileMIGThreeg), - string(GPUInstanceProfileMIGTwog), - } -} - -func parseGPUInstanceProfile(input string) (*GPUInstanceProfile, error) { - vals := map[string]GPUInstanceProfile{ - "mig4g": GPUInstanceProfileMIGFourg, - "mig1g": GPUInstanceProfileMIGOneg, - "mig7g": GPUInstanceProfileMIGSeveng, - "mig3g": GPUInstanceProfileMIGThreeg, - "mig2g": GPUInstanceProfileMIGTwog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GPUInstanceProfile(input) - return &out, nil -} - -type IPFamily string - -const ( - IPFamilyIPvFour IPFamily = "IPv4" - IPFamilyIPvSix IPFamily = "IPv6" -) - -func PossibleValuesForIPFamily() []string { - return []string{ - string(IPFamilyIPvFour), - string(IPFamilyIPvSix), - } -} - -func parseIPFamily(input string) (*IPFamily, error) { - vals := map[string]IPFamily{ - "ipv4": IPFamilyIPvFour, - "ipv6": IPFamilyIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPFamily(input) - return &out, nil -} - -type IPvsScheduler string - -const ( - IPvsSchedulerLeastConnection IPvsScheduler = "LeastConnection" - IPvsSchedulerRoundRobin IPvsScheduler = "RoundRobin" -) - -func PossibleValuesForIPvsScheduler() []string { - return []string{ - string(IPvsSchedulerLeastConnection), - string(IPvsSchedulerRoundRobin), - } -} - -func parseIPvsScheduler(input string) (*IPvsScheduler, error) { - vals := map[string]IPvsScheduler{ - "leastconnection": IPvsSchedulerLeastConnection, - "roundrobin": IPvsSchedulerRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPvsScheduler(input) - return &out, nil -} - -type IstioIngressGatewayMode string - -const ( - IstioIngressGatewayModeExternal IstioIngressGatewayMode = "External" - IstioIngressGatewayModeInternal IstioIngressGatewayMode = "Internal" -) - -func PossibleValuesForIstioIngressGatewayMode() []string { - return []string{ - string(IstioIngressGatewayModeExternal), - string(IstioIngressGatewayModeInternal), - } -} - -func parseIstioIngressGatewayMode(input string) (*IstioIngressGatewayMode, error) { - vals := map[string]IstioIngressGatewayMode{ - "external": IstioIngressGatewayModeExternal, - "internal": IstioIngressGatewayModeInternal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IstioIngressGatewayMode(input) - return &out, nil -} - -type KeyVaultNetworkAccessTypes string - -const ( - KeyVaultNetworkAccessTypesPrivate KeyVaultNetworkAccessTypes = "Private" - KeyVaultNetworkAccessTypesPublic KeyVaultNetworkAccessTypes = "Public" -) - -func PossibleValuesForKeyVaultNetworkAccessTypes() []string { - return []string{ - string(KeyVaultNetworkAccessTypesPrivate), - string(KeyVaultNetworkAccessTypesPublic), - } -} - -func parseKeyVaultNetworkAccessTypes(input string) (*KeyVaultNetworkAccessTypes, error) { - vals := map[string]KeyVaultNetworkAccessTypes{ - "private": KeyVaultNetworkAccessTypesPrivate, - "public": KeyVaultNetworkAccessTypesPublic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KeyVaultNetworkAccessTypes(input) - return &out, nil -} - -type KubeletDiskType string - -const ( - KubeletDiskTypeOS KubeletDiskType = "OS" - KubeletDiskTypeTemporary KubeletDiskType = "Temporary" -) - -func PossibleValuesForKubeletDiskType() []string { - return []string{ - string(KubeletDiskTypeOS), - string(KubeletDiskTypeTemporary), - } -} - -func parseKubeletDiskType(input string) (*KubeletDiskType, error) { - vals := map[string]KubeletDiskType{ - "os": KubeletDiskTypeOS, - "temporary": KubeletDiskTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KubeletDiskType(input) - return &out, nil -} - -type Level string - -const ( - LevelEnforcement Level = "Enforcement" - LevelOff Level = "Off" - LevelWarning Level = "Warning" -) - -func PossibleValuesForLevel() []string { - return []string{ - string(LevelEnforcement), - string(LevelOff), - string(LevelWarning), - } -} - -func parseLevel(input string) (*Level, error) { - vals := map[string]Level{ - "enforcement": LevelEnforcement, - "off": LevelOff, - "warning": LevelWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Level(input) - return &out, nil -} - -type LicenseType string - -const ( - LicenseTypeNone LicenseType = "None" - LicenseTypeWindowsServer LicenseType = "Windows_Server" -) - -func PossibleValuesForLicenseType() []string { - return []string{ - string(LicenseTypeNone), - string(LicenseTypeWindowsServer), - } -} - -func parseLicenseType(input string) (*LicenseType, error) { - vals := map[string]LicenseType{ - "none": LicenseTypeNone, - "windows_server": LicenseTypeWindowsServer, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LicenseType(input) - return &out, nil -} - -type LoadBalancerSku string - -const ( - LoadBalancerSkuBasic LoadBalancerSku = "basic" - LoadBalancerSkuStandard LoadBalancerSku = "standard" -) - -func PossibleValuesForLoadBalancerSku() []string { - return []string{ - string(LoadBalancerSkuBasic), - string(LoadBalancerSkuStandard), - } -} - -func parseLoadBalancerSku(input string) (*LoadBalancerSku, error) { - vals := map[string]LoadBalancerSku{ - "basic": LoadBalancerSkuBasic, - "standard": LoadBalancerSkuStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSku(input) - return &out, nil -} - -type ManagedClusterPodIdentityProvisioningState string - -const ( - ManagedClusterPodIdentityProvisioningStateAssigned ManagedClusterPodIdentityProvisioningState = "Assigned" - ManagedClusterPodIdentityProvisioningStateCanceled ManagedClusterPodIdentityProvisioningState = "Canceled" - ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting" - ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed" - ManagedClusterPodIdentityProvisioningStateSucceeded ManagedClusterPodIdentityProvisioningState = "Succeeded" - ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating" -) - -func PossibleValuesForManagedClusterPodIdentityProvisioningState() []string { - return []string{ - string(ManagedClusterPodIdentityProvisioningStateAssigned), - string(ManagedClusterPodIdentityProvisioningStateCanceled), - string(ManagedClusterPodIdentityProvisioningStateDeleting), - string(ManagedClusterPodIdentityProvisioningStateFailed), - string(ManagedClusterPodIdentityProvisioningStateSucceeded), - string(ManagedClusterPodIdentityProvisioningStateUpdating), - } -} - -func parseManagedClusterPodIdentityProvisioningState(input string) (*ManagedClusterPodIdentityProvisioningState, error) { - vals := map[string]ManagedClusterPodIdentityProvisioningState{ - "assigned": ManagedClusterPodIdentityProvisioningStateAssigned, - "canceled": ManagedClusterPodIdentityProvisioningStateCanceled, - "deleting": ManagedClusterPodIdentityProvisioningStateDeleting, - "failed": ManagedClusterPodIdentityProvisioningStateFailed, - "succeeded": ManagedClusterPodIdentityProvisioningStateSucceeded, - "updating": ManagedClusterPodIdentityProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedClusterPodIdentityProvisioningState(input) - return &out, nil -} - -type ManagedClusterSKUName string - -const ( - ManagedClusterSKUNameBase ManagedClusterSKUName = "Base" -) - -func PossibleValuesForManagedClusterSKUName() []string { - return []string{ - string(ManagedClusterSKUNameBase), - } -} - -func parseManagedClusterSKUName(input string) (*ManagedClusterSKUName, error) { - vals := map[string]ManagedClusterSKUName{ - "base": ManagedClusterSKUNameBase, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedClusterSKUName(input) - return &out, nil -} - -type ManagedClusterSKUTier string - -const ( - ManagedClusterSKUTierFree ManagedClusterSKUTier = "Free" - ManagedClusterSKUTierStandard ManagedClusterSKUTier = "Standard" -) - -func PossibleValuesForManagedClusterSKUTier() []string { - return []string{ - string(ManagedClusterSKUTierFree), - string(ManagedClusterSKUTierStandard), - } -} - -func parseManagedClusterSKUTier(input string) (*ManagedClusterSKUTier, error) { - vals := map[string]ManagedClusterSKUTier{ - "free": ManagedClusterSKUTierFree, - "standard": ManagedClusterSKUTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedClusterSKUTier(input) - return &out, nil -} - -type Mode string - -const ( - ModeIPTABLES Mode = "IPTABLES" - ModeIPVS Mode = "IPVS" -) - -func PossibleValuesForMode() []string { - return []string{ - string(ModeIPTABLES), - string(ModeIPVS), - } -} - -func parseMode(input string) (*Mode, error) { - vals := map[string]Mode{ - "iptables": ModeIPTABLES, - "ipvs": ModeIPVS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Mode(input) - return &out, nil -} - -type NetworkDataplane string - -const ( - NetworkDataplaneAzure NetworkDataplane = "azure" - NetworkDataplaneCilium NetworkDataplane = "cilium" -) - -func PossibleValuesForNetworkDataplane() []string { - return []string{ - string(NetworkDataplaneAzure), - string(NetworkDataplaneCilium), - } -} - -func parseNetworkDataplane(input string) (*NetworkDataplane, error) { - vals := map[string]NetworkDataplane{ - "azure": NetworkDataplaneAzure, - "cilium": NetworkDataplaneCilium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkDataplane(input) - return &out, nil -} - -type NetworkMode string - -const ( - NetworkModeBridge NetworkMode = "bridge" - NetworkModeTransparent NetworkMode = "transparent" -) - -func PossibleValuesForNetworkMode() []string { - return []string{ - string(NetworkModeBridge), - string(NetworkModeTransparent), - } -} - -func parseNetworkMode(input string) (*NetworkMode, error) { - vals := map[string]NetworkMode{ - "bridge": NetworkModeBridge, - "transparent": NetworkModeTransparent, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkMode(input) - return &out, nil -} - -type NetworkPlugin string - -const ( - NetworkPluginAzure NetworkPlugin = "azure" - NetworkPluginKubenet NetworkPlugin = "kubenet" - NetworkPluginNone NetworkPlugin = "none" -) - -func PossibleValuesForNetworkPlugin() []string { - return []string{ - string(NetworkPluginAzure), - string(NetworkPluginKubenet), - string(NetworkPluginNone), - } -} - -func parseNetworkPlugin(input string) (*NetworkPlugin, error) { - vals := map[string]NetworkPlugin{ - "azure": NetworkPluginAzure, - "kubenet": NetworkPluginKubenet, - "none": NetworkPluginNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkPlugin(input) - return &out, nil -} - -type NetworkPluginMode string - -const ( - NetworkPluginModeOverlay NetworkPluginMode = "Overlay" -) - -func PossibleValuesForNetworkPluginMode() []string { - return []string{ - string(NetworkPluginModeOverlay), - } -} - -func parseNetworkPluginMode(input string) (*NetworkPluginMode, error) { - vals := map[string]NetworkPluginMode{ - "overlay": NetworkPluginModeOverlay, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkPluginMode(input) - return &out, nil -} - -type NetworkPolicy string - -const ( - NetworkPolicyAzure NetworkPolicy = "azure" - NetworkPolicyCalico NetworkPolicy = "calico" - NetworkPolicyCilium NetworkPolicy = "cilium" -) - -func PossibleValuesForNetworkPolicy() []string { - return []string{ - string(NetworkPolicyAzure), - string(NetworkPolicyCalico), - string(NetworkPolicyCilium), - } -} - -func parseNetworkPolicy(input string) (*NetworkPolicy, error) { - vals := map[string]NetworkPolicy{ - "azure": NetworkPolicyAzure, - "calico": NetworkPolicyCalico, - "cilium": NetworkPolicyCilium, - } - 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 NodeOSUpgradeChannel string - -const ( - NodeOSUpgradeChannelNodeImage NodeOSUpgradeChannel = "NodeImage" - NodeOSUpgradeChannelNone NodeOSUpgradeChannel = "None" - NodeOSUpgradeChannelSecurityPatch NodeOSUpgradeChannel = "SecurityPatch" - NodeOSUpgradeChannelUnmanaged NodeOSUpgradeChannel = "Unmanaged" -) - -func PossibleValuesForNodeOSUpgradeChannel() []string { - return []string{ - string(NodeOSUpgradeChannelNodeImage), - string(NodeOSUpgradeChannelNone), - string(NodeOSUpgradeChannelSecurityPatch), - string(NodeOSUpgradeChannelUnmanaged), - } -} - -func parseNodeOSUpgradeChannel(input string) (*NodeOSUpgradeChannel, error) { - vals := map[string]NodeOSUpgradeChannel{ - "nodeimage": NodeOSUpgradeChannelNodeImage, - "none": NodeOSUpgradeChannelNone, - "securitypatch": NodeOSUpgradeChannelSecurityPatch, - "unmanaged": NodeOSUpgradeChannelUnmanaged, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NodeOSUpgradeChannel(input) - return &out, nil -} - -type OSDiskType string - -const ( - OSDiskTypeEphemeral OSDiskType = "Ephemeral" - OSDiskTypeManaged OSDiskType = "Managed" -) - -func PossibleValuesForOSDiskType() []string { - return []string{ - string(OSDiskTypeEphemeral), - string(OSDiskTypeManaged), - } -} - -func parseOSDiskType(input string) (*OSDiskType, error) { - vals := map[string]OSDiskType{ - "ephemeral": OSDiskTypeEphemeral, - "managed": OSDiskTypeManaged, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OSDiskType(input) - return &out, nil -} - -type OSSKU string - -const ( - OSSKUCBLMariner OSSKU = "CBLMariner" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUCBLMariner), - string(OSSKUMariner), - string(OSSKUUbuntu), - string(OSSKUWindowsTwoZeroOneNine), - string(OSSKUWindowsTwoZeroTwoTwo), - } -} - -func parseOSSKU(input string) (*OSSKU, error) { - vals := map[string]OSSKU{ - "cblmariner": OSSKUCBLMariner, - "mariner": OSSKUMariner, - "ubuntu": OSSKUUbuntu, - "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 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 OutboundType string - -const ( - OutboundTypeLoadBalancer OutboundType = "loadBalancer" - OutboundTypeManagedNATGateway OutboundType = "managedNATGateway" - OutboundTypeUserAssignedNATGateway OutboundType = "userAssignedNATGateway" - OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting" -) - -func PossibleValuesForOutboundType() []string { - return []string{ - string(OutboundTypeLoadBalancer), - string(OutboundTypeManagedNATGateway), - string(OutboundTypeUserAssignedNATGateway), - string(OutboundTypeUserDefinedRouting), - } -} - -func parseOutboundType(input string) (*OutboundType, error) { - vals := map[string]OutboundType{ - "loadbalancer": OutboundTypeLoadBalancer, - "managednatgateway": OutboundTypeManagedNATGateway, - "userassignednatgateway": OutboundTypeUserAssignedNATGateway, - "userdefinedrouting": OutboundTypeUserDefinedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OutboundType(input) - return &out, nil -} - -type Protocol string - -const ( - ProtocolTCP Protocol = "TCP" - ProtocolUDP Protocol = "UDP" -) - -func PossibleValuesForProtocol() []string { - return []string{ - string(ProtocolTCP), - string(ProtocolUDP), - } -} - -func parseProtocol(input string) (*Protocol, error) { - vals := map[string]Protocol{ - "tcp": ProtocolTCP, - "udp": ProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Protocol(input) - return &out, nil -} - -type PublicNetworkAccess string - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" - PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" -) - -func PossibleValuesForPublicNetworkAccess() []string { - return []string{ - string(PublicNetworkAccessDisabled), - string(PublicNetworkAccessEnabled), - string(PublicNetworkAccessSecuredByPerimeter), - } -} - -func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { - vals := map[string]PublicNetworkAccess{ - "disabled": PublicNetworkAccessDisabled, - "enabled": PublicNetworkAccessEnabled, - "securedbyperimeter": PublicNetworkAccessSecuredByPerimeter, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicNetworkAccess(input) - return &out, nil -} - -type RestrictionLevel string - -const ( - RestrictionLevelReadOnly RestrictionLevel = "ReadOnly" - RestrictionLevelUnrestricted RestrictionLevel = "Unrestricted" -) - -func PossibleValuesForRestrictionLevel() []string { - return []string{ - string(RestrictionLevelReadOnly), - string(RestrictionLevelUnrestricted), - } -} - -func parseRestrictionLevel(input string) (*RestrictionLevel, error) { - vals := map[string]RestrictionLevel{ - "readonly": RestrictionLevelReadOnly, - "unrestricted": RestrictionLevelUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RestrictionLevel(input) - return &out, nil -} - -type ScaleDownMode string - -const ( - ScaleDownModeDeallocate ScaleDownMode = "Deallocate" - ScaleDownModeDelete ScaleDownMode = "Delete" -) - -func PossibleValuesForScaleDownMode() []string { - return []string{ - string(ScaleDownModeDeallocate), - string(ScaleDownModeDelete), - } -} - -func parseScaleDownMode(input string) (*ScaleDownMode, error) { - vals := map[string]ScaleDownMode{ - "deallocate": ScaleDownModeDeallocate, - "delete": ScaleDownModeDelete, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScaleDownMode(input) - return &out, nil -} - -type ScaleSetEvictionPolicy string - -const ( - ScaleSetEvictionPolicyDeallocate ScaleSetEvictionPolicy = "Deallocate" - ScaleSetEvictionPolicyDelete ScaleSetEvictionPolicy = "Delete" -) - -func PossibleValuesForScaleSetEvictionPolicy() []string { - return []string{ - string(ScaleSetEvictionPolicyDeallocate), - string(ScaleSetEvictionPolicyDelete), - } -} - -func parseScaleSetEvictionPolicy(input string) (*ScaleSetEvictionPolicy, error) { - vals := map[string]ScaleSetEvictionPolicy{ - "deallocate": ScaleSetEvictionPolicyDeallocate, - "delete": ScaleSetEvictionPolicyDelete, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScaleSetEvictionPolicy(input) - return &out, nil -} - -type ScaleSetPriority string - -const ( - ScaleSetPriorityRegular ScaleSetPriority = "Regular" - ScaleSetPrioritySpot ScaleSetPriority = "Spot" -) - -func PossibleValuesForScaleSetPriority() []string { - return []string{ - string(ScaleSetPriorityRegular), - string(ScaleSetPrioritySpot), - } -} - -func parseScaleSetPriority(input string) (*ScaleSetPriority, error) { - vals := map[string]ScaleSetPriority{ - "regular": ScaleSetPriorityRegular, - "spot": ScaleSetPrioritySpot, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScaleSetPriority(input) - return &out, nil -} - -type ServiceMeshMode string - -const ( - ServiceMeshModeDisabled ServiceMeshMode = "Disabled" - ServiceMeshModeIstio ServiceMeshMode = "Istio" -) - -func PossibleValuesForServiceMeshMode() []string { - return []string{ - string(ServiceMeshModeDisabled), - string(ServiceMeshModeIstio), - } -} - -func parseServiceMeshMode(input string) (*ServiceMeshMode, error) { - vals := map[string]ServiceMeshMode{ - "disabled": ServiceMeshModeDisabled, - "istio": ServiceMeshModeIstio, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceMeshMode(input) - return &out, nil -} - -type UpdateMode string - -const ( - UpdateModeAuto UpdateMode = "Auto" - UpdateModeInitial UpdateMode = "Initial" - UpdateModeOff UpdateMode = "Off" - UpdateModeRecreate UpdateMode = "Recreate" -) - -func PossibleValuesForUpdateMode() []string { - return []string{ - string(UpdateModeAuto), - string(UpdateModeInitial), - string(UpdateModeOff), - string(UpdateModeRecreate), - } -} - -func parseUpdateMode(input string) (*UpdateMode, error) { - vals := map[string]UpdateMode{ - "auto": UpdateModeAuto, - "initial": UpdateModeInitial, - "off": UpdateModeOff, - "recreate": UpdateModeRecreate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateMode(input) - return &out, nil -} - -type UpgradeChannel string - -const ( - UpgradeChannelNodeNegativeimage UpgradeChannel = "node-image" - UpgradeChannelNone UpgradeChannel = "none" - UpgradeChannelPatch UpgradeChannel = "patch" - UpgradeChannelRapid UpgradeChannel = "rapid" - UpgradeChannelStable UpgradeChannel = "stable" -) - -func PossibleValuesForUpgradeChannel() []string { - return []string{ - string(UpgradeChannelNodeNegativeimage), - string(UpgradeChannelNone), - string(UpgradeChannelPatch), - string(UpgradeChannelRapid), - string(UpgradeChannelStable), - } -} - -func parseUpgradeChannel(input string) (*UpgradeChannel, error) { - vals := map[string]UpgradeChannel{ - "node-image": UpgradeChannelNodeNegativeimage, - "none": UpgradeChannelNone, - "patch": UpgradeChannelPatch, - "rapid": UpgradeChannelRapid, - "stable": UpgradeChannelStable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpgradeChannel(input) - return &out, nil -} - -type WorkloadRuntime string - -const ( - WorkloadRuntimeKataMshvVMIsolation WorkloadRuntime = "KataMshvVmIsolation" - WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" - WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" -) - -func PossibleValuesForWorkloadRuntime() []string { - return []string{ - string(WorkloadRuntimeKataMshvVMIsolation), - string(WorkloadRuntimeOCIContainer), - string(WorkloadRuntimeWasmWasi), - } -} - -func parseWorkloadRuntime(input string) (*WorkloadRuntime, error) { - vals := map[string]WorkloadRuntime{ - "katamshvvmisolation": WorkloadRuntimeKataMshvVMIsolation, - "ocicontainer": WorkloadRuntimeOCIContainer, - "wasmwasi": WorkloadRuntimeWasmWasi, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WorkloadRuntime(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_accessprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_accessprofile.go deleted file mode 100644 index 5da6342fca3f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_accessprofile.go +++ /dev/null @@ -1,140 +0,0 @@ -package managedclusters - -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 = AccessProfileId{} - -// AccessProfileId is a struct representing the Resource ID for a Access Profile -type AccessProfileId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string - AccessProfileName string -} - -// NewAccessProfileID returns a new AccessProfileId struct -func NewAccessProfileID(subscriptionId string, resourceGroupName string, managedClusterName string, accessProfileName string) AccessProfileId { - return AccessProfileId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - AccessProfileName: accessProfileName, - } -} - -// ParseAccessProfileID parses 'input' into a AccessProfileId -func ParseAccessProfileID(input string) (*AccessProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(AccessProfileId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AccessProfileId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - if id.AccessProfileName, ok = parsed.Parsed["accessProfileName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "accessProfileName", *parsed) - } - - return &id, nil -} - -// ParseAccessProfileIDInsensitively parses 'input' case-insensitively into a AccessProfileId -// note: this method should only be used for API response data and not user input -func ParseAccessProfileIDInsensitively(input string) (*AccessProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(AccessProfileId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AccessProfileId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - if id.AccessProfileName, ok = parsed.Parsed["accessProfileName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "accessProfileName", *parsed) - } - - return &id, nil -} - -// ValidateAccessProfileID checks that 'input' can be parsed as a Access Profile ID -func ValidateAccessProfileID(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 := ParseAccessProfileID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Access Profile ID -func (id AccessProfileId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/accessProfiles/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.AccessProfileName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Access Profile ID -func (id AccessProfileId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileValue"), - } -} - -// String returns a human-readable description of this Access Profile ID -func (id AccessProfileId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - fmt.Sprintf("Access Profile Name: %q", id.AccessProfileName), - } - return fmt.Sprintf("Access Profile (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_commandresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_commandresult.go deleted file mode 100644 index 16be91bbdfdf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_commandresult.go +++ /dev/null @@ -1,140 +0,0 @@ -package managedclusters - -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 = CommandResultId{} - -// CommandResultId is a struct representing the Resource ID for a Command Result -type CommandResultId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string - CommandId string -} - -// NewCommandResultID returns a new CommandResultId struct -func NewCommandResultID(subscriptionId string, resourceGroupName string, managedClusterName string, commandId string) CommandResultId { - return CommandResultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - CommandId: commandId, - } -} - -// ParseCommandResultID parses 'input' into a CommandResultId -func ParseCommandResultID(input string) (*CommandResultId, error) { - parser := resourceids.NewParserFromResourceIdType(CommandResultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CommandResultId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - if id.CommandId, ok = parsed.Parsed["commandId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "commandId", *parsed) - } - - return &id, nil -} - -// ParseCommandResultIDInsensitively parses 'input' case-insensitively into a CommandResultId -// note: this method should only be used for API response data and not user input -func ParseCommandResultIDInsensitively(input string) (*CommandResultId, error) { - parser := resourceids.NewParserFromResourceIdType(CommandResultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CommandResultId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - if id.CommandId, ok = parsed.Parsed["commandId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "commandId", *parsed) - } - - return &id, nil -} - -// ValidateCommandResultID checks that 'input' can be parsed as a Command Result ID -func ValidateCommandResultID(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 := ParseCommandResultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Command Result ID -func (id CommandResultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/commandResults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.CommandId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Command Result ID -func (id CommandResultId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), - resourceids.UserSpecifiedSegment("commandId", "commandIdValue"), - } -} - -// String returns a human-readable description of this Command Result ID -func (id CommandResultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - fmt.Sprintf("Command: %q", id.CommandId), - } - return fmt.Sprintf("Command Result (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_location.go deleted file mode 100644 index e9153531da7c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_location.go +++ /dev/null @@ -1,114 +0,0 @@ -package managedclusters - -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 = LocationId{} - -// LocationId is a struct representing the Resource ID for a Location -type LocationId struct { - SubscriptionId string - LocationName string -} - -// NewLocationID returns a new LocationId struct -func NewLocationID(subscriptionId string, locationName string) LocationId { - return LocationId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - } -} - -// ParseLocationID parses 'input' into a LocationId -func ParseLocationID(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(LocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := LocationId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.LocationName, ok = parsed.Parsed["locationName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "locationName", *parsed) - } - - return &id, nil -} - -// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId -// note: this method should only be used for API response data and not user input -func ParseLocationIDInsensitively(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(LocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := LocationId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.LocationName, ok = parsed.Parsed["locationName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "locationName", *parsed) - } - - return &id, nil -} - -// ValidateLocationID checks that 'input' can be parsed as a Location ID -func ValidateLocationID(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 := ParseLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Location ID -func (id LocationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.ContainerService/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Location ID -func (id LocationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Location ID -func (id LocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_managedcluster.go deleted file mode 100644 index 0288ce671dd1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package managedclusters - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_abortlatestoperation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_abortlatestoperation_autorest.go deleted file mode 100644 index e9aa2dc1e0f6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_abortlatestoperation_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AbortLatestOperationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AbortLatestOperation ... -func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id ManagedClusterId) (result AbortLatestOperationOperationResponse, err error) { - req, err := c.preparerForAbortLatestOperation(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "AbortLatestOperation", nil, "Failure preparing request") - return - } - - result, err = c.senderForAbortLatestOperation(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "AbortLatestOperation", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AbortLatestOperationThenPoll performs AbortLatestOperation then polls until it's completed -func (c ManagedClustersClient) AbortLatestOperationThenPoll(ctx context.Context, id ManagedClusterId) error { - result, err := c.AbortLatestOperation(ctx, id) - if err != nil { - return fmt.Errorf("performing AbortLatestOperation: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AbortLatestOperation: %+v", err) - } - - return nil -} - -// preparerForAbortLatestOperation prepares the AbortLatestOperation request. -func (c ManagedClustersClient) preparerForAbortLatestOperation(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/abort", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAbortLatestOperation sends the AbortLatestOperation request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForAbortLatestOperation(ctx context.Context, req *http.Request) (future AbortLatestOperationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_createorupdate_autorest.go deleted file mode 100644 index 3bf60ea59122..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_createorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// 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 polling.LongRunningPoller - HttpResponse *http.Response -} - -// CreateOrUpdate ... -func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (result CreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id ManagedClusterId, input ManagedCluster) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c ManagedClustersClient) preparerForCreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_delete_autorest.go deleted file mode 100644 index 0255e77f2611..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_delete_autorest.go +++ /dev/null @@ -1,107 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// 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 polling.LongRunningPoller - HttpResponse *http.Response -} - -type DeleteOperationOptions struct { - IgnorePodDisruptionBudget *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o DeleteOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.IgnorePodDisruptionBudget != nil { - out["ignore-pod-disruption-budget"] = *o.IgnorePodDisruptionBudget - } - - return out -} - -// Delete ... -func (c ManagedClustersClient) Delete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) error { - result, err := c.Delete(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c ManagedClustersClient) preparerForDelete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_get_autorest.go deleted file mode 100644 index c5e08ae898de..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_get_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package managedclusters - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - Model *ManagedCluster -} - -// Get ... -func (c ManagedClustersClient) Get(ctx context.Context, id ManagedClusterId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c ManagedClustersClient) preparerForGet(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getaccessprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getaccessprofile_autorest.go deleted file mode 100644 index 82b7df70d16e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getaccessprofile_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetAccessProfileOperationResponse struct { - HttpResponse *http.Response - Model *ManagedClusterAccessProfile -} - -// GetAccessProfile ... -func (c ManagedClustersClient) GetAccessProfile(ctx context.Context, id AccessProfileId) (result GetAccessProfileOperationResponse, err error) { - req, err := c.preparerForGetAccessProfile(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetAccessProfile", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetAccessProfile(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetAccessProfile", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetAccessProfile prepares the GetAccessProfile request. -func (c ManagedClustersClient) preparerForGetAccessProfile(ctx context.Context, id AccessProfileId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/listCredential", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetAccessProfile handles the response to the GetAccessProfile request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForGetAccessProfile(resp *http.Response) (result GetAccessProfileOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getcommandresult_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getcommandresult_autorest.go deleted file mode 100644 index b5d9f095c1eb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getcommandresult_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package managedclusters - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetCommandResultOperationResponse struct { - HttpResponse *http.Response - Model *RunCommandResult -} - -// GetCommandResult ... -func (c ManagedClustersClient) GetCommandResult(ctx context.Context, id CommandResultId) (result GetCommandResultOperationResponse, err error) { - req, err := c.preparerForGetCommandResult(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetCommandResult", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetCommandResult", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetCommandResult(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetCommandResult", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetCommandResult prepares the GetCommandResult request. -func (c ManagedClustersClient) preparerForGetCommandResult(ctx context.Context, id CommandResultId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetCommandResult handles the response to the GetCommandResult request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForGetCommandResult(resp *http.Response) (result GetCommandResultOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getosoptions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getosoptions_autorest.go deleted file mode 100644 index 59f01e6d53f8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getosoptions_autorest.go +++ /dev/null @@ -1,98 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOSOptionsOperationResponse struct { - HttpResponse *http.Response - Model *OSOptionProfile -} - -type GetOSOptionsOperationOptions struct { - ResourceType *string -} - -func DefaultGetOSOptionsOperationOptions() GetOSOptionsOperationOptions { - return GetOSOptionsOperationOptions{} -} - -func (o GetOSOptionsOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o GetOSOptionsOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.ResourceType != nil { - out["resource-type"] = *o.ResourceType - } - - return out -} - -// GetOSOptions ... -func (c ManagedClustersClient) GetOSOptions(ctx context.Context, id LocationId, options GetOSOptionsOperationOptions) (result GetOSOptionsOperationResponse, err error) { - req, err := c.preparerForGetOSOptions(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetOSOptions", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetOSOptions", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetOSOptions(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetOSOptions", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetOSOptions prepares the GetOSOptions request. -func (c ManagedClustersClient) preparerForGetOSOptions(ctx context.Context, id LocationId, options GetOSOptionsOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/osOptions/default", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetOSOptions handles the response to the GetOSOptions request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForGetOSOptions(resp *http.Response) (result GetOSOptionsOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getupgradeprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getupgradeprofile_autorest.go deleted file mode 100644 index cb70f49aa028..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_getupgradeprofile_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *ManagedClusterUpgradeProfile -} - -// GetUpgradeProfile ... -func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id ManagedClusterId) (result GetUpgradeProfileOperationResponse, err error) { - req, err := c.preparerForGetUpgradeProfile(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetUpgradeProfile", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetUpgradeProfile(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetUpgradeProfile", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetUpgradeProfile prepares the GetUpgradeProfile request. -func (c ManagedClustersClient) preparerForGetUpgradeProfile(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/upgradeProfiles/default", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetUpgradeProfile handles the response to the GetUpgradeProfile request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForGetUpgradeProfile(resp *http.Response) (result GetUpgradeProfileOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_list_autorest.go deleted file mode 100644 index 871409d1963c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_list_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - Model *[]ManagedCluster - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []ManagedCluster -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// List ... -func (c ManagedClustersClient) List(ctx context.Context, id commonids.SubscriptionId) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForList prepares the List request. -func (c ManagedClustersClient) preparerForList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusters", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c ManagedClustersClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []ManagedCluster `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c ManagedClustersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ManagedClusterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedClustersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ManagedClusterOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]ManagedCluster, 0) - - page, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listbyresourcegroup_autorest.go deleted file mode 100644 index bc961d43758e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listbyresourcegroup_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// 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 - Model *[]ManagedCluster - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) -} - -type ListByResourceGroupCompleteResult struct { - Items []ManagedCluster -} - -func (r ListByResourceGroupOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// ListByResourceGroup ... -func (c ManagedClustersClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp ListByResourceGroupOperationResponse, err error) { - req, err := c.preparerForListByResourceGroup(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListByResourceGroup(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListByResourceGroup prepares the ListByResourceGroup request. -func (c ManagedClustersClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusters", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. -func (c ManagedClustersClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { - type page struct { - Values []ManagedCluster `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { - req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListByResourceGroup(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListByResourceGroupComplete retrieves all of the results into a single object -func (c ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ManagedClusterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ManagedClusterOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { - items := make([]ManagedCluster, 0) - - page, err := c.ListByResourceGroup(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListByResourceGroupCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go deleted file mode 100644 index e14b90ceb4e2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go +++ /dev/null @@ -1,98 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListClusterAdminCredentialsOperationResponse struct { - HttpResponse *http.Response - Model *CredentialResults -} - -type ListClusterAdminCredentialsOperationOptions struct { - ServerFqdn *string -} - -func DefaultListClusterAdminCredentialsOperationOptions() ListClusterAdminCredentialsOperationOptions { - return ListClusterAdminCredentialsOperationOptions{} -} - -func (o ListClusterAdminCredentialsOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListClusterAdminCredentialsOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.ServerFqdn != nil { - out["server-fqdn"] = *o.ServerFqdn - } - - return out -} - -// ListClusterAdminCredentials ... -func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { - req, err := c.preparerForListClusterAdminCredentials(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterAdminCredentials", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListClusterAdminCredentials(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterAdminCredentials", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForListClusterAdminCredentials prepares the ListClusterAdminCredentials request. -func (c ManagedClustersClient) preparerForListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/listClusterAdminCredential", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListClusterAdminCredentials handles the response to the ListClusterAdminCredentials request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForListClusterAdminCredentials(resp *http.Response) (result ListClusterAdminCredentialsOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go deleted file mode 100644 index 6065e73fd64c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go +++ /dev/null @@ -1,98 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListClusterMonitoringUserCredentialsOperationResponse struct { - HttpResponse *http.Response - Model *CredentialResults -} - -type ListClusterMonitoringUserCredentialsOperationOptions struct { - ServerFqdn *string -} - -func DefaultListClusterMonitoringUserCredentialsOperationOptions() ListClusterMonitoringUserCredentialsOperationOptions { - return ListClusterMonitoringUserCredentialsOperationOptions{} -} - -func (o ListClusterMonitoringUserCredentialsOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListClusterMonitoringUserCredentialsOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.ServerFqdn != nil { - out["server-fqdn"] = *o.ServerFqdn - } - - return out -} - -// ListClusterMonitoringUserCredentials ... -func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { - req, err := c.preparerForListClusterMonitoringUserCredentials(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterMonitoringUserCredentials", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListClusterMonitoringUserCredentials(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterMonitoringUserCredentials", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForListClusterMonitoringUserCredentials prepares the ListClusterMonitoringUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/listClusterMonitoringUserCredential", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListClusterMonitoringUserCredentials handles the response to the ListClusterMonitoringUserCredentials request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForListClusterMonitoringUserCredentials(resp *http.Response) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusterusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusterusercredentials_autorest.go deleted file mode 100644 index 2cd263f9b47e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listclusterusercredentials_autorest.go +++ /dev/null @@ -1,103 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListClusterUserCredentialsOperationResponse struct { - HttpResponse *http.Response - Model *CredentialResults -} - -type ListClusterUserCredentialsOperationOptions struct { - Format *Format - ServerFqdn *string -} - -func DefaultListClusterUserCredentialsOperationOptions() ListClusterUserCredentialsOperationOptions { - return ListClusterUserCredentialsOperationOptions{} -} - -func (o ListClusterUserCredentialsOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListClusterUserCredentialsOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Format != nil { - out["format"] = *o.Format - } - - if o.ServerFqdn != nil { - out["server-fqdn"] = *o.ServerFqdn - } - - return out -} - -// ListClusterUserCredentials ... -func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { - req, err := c.preparerForListClusterUserCredentials(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterUserCredentials", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListClusterUserCredentials(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterUserCredentials", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForListClusterUserCredentials prepares the ListClusterUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/listClusterUserCredential", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListClusterUserCredentials handles the response to the ListClusterUserCredentials request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForListClusterUserCredentials(resp *http.Response) (result ListClusterUserCredentialsOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go deleted file mode 100644 index cdc548f003d0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOutboundNetworkDependenciesEndpointsOperationResponse struct { - HttpResponse *http.Response - Model *[]OutboundEnvironmentEndpoint - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOutboundNetworkDependenciesEndpointsOperationResponse, error) -} - -type ListOutboundNetworkDependenciesEndpointsCompleteResult struct { - Items []OutboundEnvironmentEndpoint -} - -func (r ListOutboundNetworkDependenciesEndpointsOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOutboundNetworkDependenciesEndpointsOperationResponse) LoadMore(ctx context.Context) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// ListOutboundNetworkDependenciesEndpoints ... -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { - req, err := c.preparerForListOutboundNetworkDependenciesEndpoints(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListOutboundNetworkDependenciesEndpoints(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListOutboundNetworkDependenciesEndpoints prepares the ListOutboundNetworkDependenciesEndpoints request. -func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/outboundNetworkDependenciesEndpoints", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListOutboundNetworkDependenciesEndpointsWithNextLink prepares the ListOutboundNetworkDependenciesEndpoints request with the given nextLink token. -func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpointsWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListOutboundNetworkDependenciesEndpoints handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always -// closes the http.Response Body. -func (c ManagedClustersClient) responderForListOutboundNetworkDependenciesEndpoints(resp *http.Response) (result ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { - type page struct { - Values []OutboundEnvironmentEndpoint `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { - req, err := c.preparerForListOutboundNetworkDependenciesEndpointsWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListOutboundNetworkDependenciesEndpoints(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListOutboundNetworkDependenciesEndpointsComplete retrieves all of the results into a single object -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id ManagedClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { - return c.ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx, id, OutboundEnvironmentEndpointOperationPredicate{}) -} - -// ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (resp ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { - items := make([]OutboundEnvironmentEndpoint, 0) - - page, err := c.ListOutboundNetworkDependenciesEndpoints(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListOutboundNetworkDependenciesEndpointsCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetaadprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetaadprofile_autorest.go deleted file mode 100644 index 8c3bf221bffb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetaadprofile_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResetAADProfileOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// ResetAADProfile ... -func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { - req, err := c.preparerForResetAADProfile(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") - return - } - - result, err = c.senderForResetAADProfile(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetAADProfile", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// ResetAADProfileThenPoll performs ResetAADProfile then polls until it's completed -func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) error { - result, err := c.ResetAADProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ResetAADProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after ResetAADProfile: %+v", err) - } - - return nil -} - -// preparerForResetAADProfile prepares the ResetAADProfile request. -func (c ManagedClustersClient) preparerForResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/resetAADProfile", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForResetAADProfile sends the ResetAADProfile request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForResetAADProfile(ctx context.Context, req *http.Request) (future ResetAADProfileOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go deleted file mode 100644 index 7830267d6163..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResetServicePrincipalProfileOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// ResetServicePrincipalProfile ... -func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { - req, err := c.preparerForResetServicePrincipalProfile(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") - return - } - - result, err = c.senderForResetServicePrincipalProfile(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetServicePrincipalProfile", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// ResetServicePrincipalProfileThenPoll performs ResetServicePrincipalProfile then polls until it's completed -func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) error { - result, err := c.ResetServicePrincipalProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ResetServicePrincipalProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after ResetServicePrincipalProfile: %+v", err) - } - - return nil -} - -// preparerForResetServicePrincipalProfile prepares the ResetServicePrincipalProfile request. -func (c ManagedClustersClient) preparerForResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/resetServicePrincipalProfile", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForResetServicePrincipalProfile sends the ResetServicePrincipalProfile request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForResetServicePrincipalProfile(ctx context.Context, req *http.Request) (future ResetServicePrincipalProfileOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateclustercertificates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateclustercertificates_autorest.go deleted file mode 100644 index 83b54e351193..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateclustercertificates_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RotateClusterCertificatesOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// RotateClusterCertificates ... -func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id ManagedClusterId) (result RotateClusterCertificatesOperationResponse, err error) { - req, err := c.preparerForRotateClusterCertificates(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") - return - } - - result, err = c.senderForRotateClusterCertificates(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateClusterCertificates", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// RotateClusterCertificatesThenPoll performs RotateClusterCertificates then polls until it's completed -func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id ManagedClusterId) error { - result, err := c.RotateClusterCertificates(ctx, id) - if err != nil { - return fmt.Errorf("performing RotateClusterCertificates: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after RotateClusterCertificates: %+v", err) - } - - return nil -} - -// preparerForRotateClusterCertificates prepares the RotateClusterCertificates request. -func (c ManagedClustersClient) preparerForRotateClusterCertificates(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/rotateClusterCertificates", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForRotateClusterCertificates sends the RotateClusterCertificates request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForRotateClusterCertificates(ctx context.Context, req *http.Request) (future RotateClusterCertificatesOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go deleted file mode 100644 index f5bf5cc8da57..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RotateServiceAccountSigningKeysOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// RotateServiceAccountSigningKeys ... -func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { - req, err := c.preparerForRotateServiceAccountSigningKeys(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateServiceAccountSigningKeys", nil, "Failure preparing request") - return - } - - result, err = c.senderForRotateServiceAccountSigningKeys(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateServiceAccountSigningKeys", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// RotateServiceAccountSigningKeysThenPoll performs RotateServiceAccountSigningKeys then polls until it's completed -func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id ManagedClusterId) error { - result, err := c.RotateServiceAccountSigningKeys(ctx, id) - if err != nil { - return fmt.Errorf("performing RotateServiceAccountSigningKeys: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after RotateServiceAccountSigningKeys: %+v", err) - } - - return nil -} - -// preparerForRotateServiceAccountSigningKeys prepares the RotateServiceAccountSigningKeys request. -func (c ManagedClustersClient) preparerForRotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/rotateServiceAccountSigningKeys", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForRotateServiceAccountSigningKeys sends the RotateServiceAccountSigningKeys request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForRotateServiceAccountSigningKeys(ctx context.Context, req *http.Request) (future RotateServiceAccountSigningKeysOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_runcommand_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_runcommand_autorest.go deleted file mode 100644 index 4f3eecf77593..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_runcommand_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunCommandOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// RunCommand ... -func (c ManagedClustersClient) RunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { - req, err := c.preparerForRunCommand(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = c.senderForRunCommand(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RunCommand", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// RunCommandThenPoll performs RunCommand then polls until it's completed -func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id ManagedClusterId, input RunCommandRequest) error { - result, err := c.RunCommand(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RunCommand: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after RunCommand: %+v", err) - } - - return nil -} - -// preparerForRunCommand prepares the RunCommand request. -func (c ManagedClustersClient) preparerForRunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/runCommand", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForRunCommand sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForRunCommand(ctx context.Context, req *http.Request) (future RunCommandOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_start_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_start_autorest.go deleted file mode 100644 index e58f11e31c8a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_start_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StartOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Start ... -func (c ManagedClustersClient) Start(ctx context.Context, id ManagedClusterId) (result StartOperationResponse, err error) { - req, err := c.preparerForStart(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Start", nil, "Failure preparing request") - return - } - - result, err = c.senderForStart(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Start", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// StartThenPoll performs Start then polls until it's completed -func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id ManagedClusterId) error { - result, err := c.Start(ctx, id) - if err != nil { - return fmt.Errorf("performing Start: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Start: %+v", err) - } - - return nil -} - -// preparerForStart prepares the Start request. -func (c ManagedClustersClient) preparerForStart(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/start", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForStart sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForStart(ctx context.Context, req *http.Request) (future StartOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_stop_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_stop_autorest.go deleted file mode 100644 index 1324f9e0ad44..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_stop_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StopOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Stop ... -func (c ManagedClustersClient) Stop(ctx context.Context, id ManagedClusterId) (result StopOperationResponse, err error) { - req, err := c.preparerForStop(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = c.senderForStop(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Stop", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// StopThenPoll performs Stop then polls until it's completed -func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id ManagedClusterId) error { - result, err := c.Stop(ctx, id) - if err != nil { - return fmt.Errorf("performing Stop: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Stop: %+v", err) - } - - return nil -} - -// preparerForStop prepares the Stop request. -func (c ManagedClustersClient) preparerForStop(ctx context.Context, id ManagedClusterId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/stop", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForStop sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForStop(ctx context.Context, req *http.Request) (future StopOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_updatetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_updatetags_autorest.go deleted file mode 100644 index 8786b846f79d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/method_updatetags_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package managedclusters - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateTagsOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// UpdateTags ... -func (c ManagedClustersClient) UpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - req, err := c.preparerForUpdateTags(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdateTags(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "UpdateTags", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id ManagedClusterId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UpdateTags: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after UpdateTags: %+v", err) - } - - return nil -} - -// preparerForUpdateTags prepares the UpdateTags request. -func (c ManagedClustersClient) preparerForUpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdateTags sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedClustersClient) senderForUpdateTags(ctx context.Context, req *http.Request) (future UpdateTagsOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_accessprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_accessprofile.go deleted file mode 100644 index c13b64ab25d2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_accessprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessProfile struct { - KubeConfig *string `json:"kubeConfig,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolnetworkprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolnetworkprofile.go deleted file mode 100644 index 1a5b19f5db14..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AgentPoolNetworkProfile struct { - AllowedHostPorts *[]PortRange `json:"allowedHostPorts,omitempty"` - ApplicationSecurityGroups *[]string `json:"applicationSecurityGroups,omitempty"` - NodePublicIPTags *[]IPTag `json:"nodePublicIPTags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolupgradesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolupgradesettings.go deleted file mode 100644 index 461cb4361b0b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AgentPoolUpgradeSettings struct { - MaxSurge *string `json:"maxSurge,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolwindowsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolwindowsprofile.go deleted file mode 100644 index 5558f04ed005..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_agentpoolwindowsprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AgentPoolWindowsProfile struct { - DisableOutboundNat *bool `json:"disableOutboundNat,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_azurekeyvaultkms.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_azurekeyvaultkms.go deleted file mode 100644 index 57c4e7848f34..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_azurekeyvaultkms.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureKeyVaultKms struct { - Enabled *bool `json:"enabled,omitempty"` - KeyId *string `json:"keyId,omitempty"` - KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"` - KeyVaultResourceId *string `json:"keyVaultResourceId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_clusterupgradesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_clusterupgradesettings.go deleted file mode 100644 index 1510493ca17c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_clusterupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterUpgradeSettings struct { - OverrideSettings *UpgradeOverrideSettings `json:"overrideSettings,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_commandresultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_commandresultproperties.go deleted file mode 100644 index 745a87ae4ea0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_commandresultproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -package managedclusters - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CommandResultProperties struct { - ExitCode *int64 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Logs *string `json:"logs,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - Reason *string `json:"reason,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` -} - -func (o *CommandResultProperties) GetFinishedAtAsTime() (*time.Time, error) { - if o.FinishedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.FinishedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *CommandResultProperties) SetFinishedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.FinishedAt = &formatted -} - -func (o *CommandResultProperties) GetStartedAtAsTime() (*time.Time, error) { - if o.StartedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *CommandResultProperties) SetStartedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartedAt = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicelinuxprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicelinuxprofile.go deleted file mode 100644 index a3abf14adeb3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicelinuxprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceLinuxProfile struct { - AdminUsername string `json:"adminUsername"` - Ssh ContainerServiceSshConfiguration `json:"ssh"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofile.go deleted file mode 100644 index 50b41b739367..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofile.go +++ /dev/null @@ -1,24 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceNetworkProfile struct { - DnsServiceIP *string `json:"dnsServiceIP,omitempty"` - DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` - IPFamilies *[]IPFamily `json:"ipFamilies,omitempty"` - KubeProxyConfig *ContainerServiceNetworkProfileKubeProxyConfig `json:"kubeProxyConfig,omitempty"` - LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` - LoadBalancerSku *LoadBalancerSku `json:"loadBalancerSku,omitempty"` - NatGatewayProfile *ManagedClusterNATGatewayProfile `json:"natGatewayProfile,omitempty"` - NetworkDataplane *NetworkDataplane `json:"networkDataplane,omitempty"` - NetworkMode *NetworkMode `json:"networkMode,omitempty"` - NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` - NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` - NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` - OutboundType *OutboundType `json:"outboundType,omitempty"` - PodCidr *string `json:"podCidr,omitempty"` - PodCidrs *[]string `json:"podCidrs,omitempty"` - ServiceCidr *string `json:"serviceCidr,omitempty"` - ServiceCidrs *[]string `json:"serviceCidrs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go deleted file mode 100644 index 5be387f7c407..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceNetworkProfileKubeProxyConfig struct { - Enabled *bool `json:"enabled,omitempty"` - IPvsConfig *ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig `json:"ipvsConfig,omitempty"` - Mode *Mode `json:"mode,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go deleted file mode 100644 index 96dc155e9d5c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig struct { - Scheduler *IPvsScheduler `json:"scheduler,omitempty"` - TcpFinTimeoutSeconds *int64 `json:"tcpFinTimeoutSeconds,omitempty"` - TcpTimeoutSeconds *int64 `json:"tcpTimeoutSeconds,omitempty"` - UdpTimeoutSeconds *int64 `json:"udpTimeoutSeconds,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshconfiguration.go deleted file mode 100644 index 4bf259bd15d5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceSshConfiguration struct { - PublicKeys []ContainerServiceSshPublicKey `json:"publicKeys"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshpublickey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshpublickey.go deleted file mode 100644 index 7796cdf6a902..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_containerservicesshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerServiceSshPublicKey struct { - KeyData string `json:"keyData"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_creationdata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_creationdata.go deleted file mode 100644 index f2f19907006a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreationData struct { - SourceResourceId *string `json:"sourceResourceId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresult.go deleted file mode 100644 index 7002f56084eb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresults.go deleted file mode 100644 index c572432888e5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_credentialresults.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialResults struct { - Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdependency.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdependency.go deleted file mode 100644 index ae8639b529bb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdependency.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointDependency struct { - DomainName *string `json:"domainName,omitempty"` - EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdetail.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdetail.go deleted file mode 100644 index de73a2e9168f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_endpointdetail.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointDetail struct { - Description *string `json:"description,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *string `json:"protocol,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_guardrailsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_guardrailsprofile.go deleted file mode 100644 index 6875f54cbbe5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_guardrailsprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GuardrailsProfile struct { - ExcludedNamespaces *[]string `json:"excludedNamespaces,omitempty"` - Level Level `json:"level"` - SystemExcludedNamespaces *[]string `json:"systemExcludedNamespaces,omitempty"` - Version string `json:"version"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_iptag.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_iptag.go deleted file mode 100644 index 0aefb50d15f4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPTag struct { - IPTagType *string `json:"ipTagType,omitempty"` - Tag *string `json:"tag,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istiocomponents.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istiocomponents.go deleted file mode 100644 index 0cd74a814a3b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istiocomponents.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IstioComponents struct { - IngressGateways *[]IstioIngressGateway `json:"ingressGateways,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioingressgateway.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioingressgateway.go deleted file mode 100644 index 12832f481147..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioingressgateway.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IstioIngressGateway struct { - Enabled bool `json:"enabled"` - Mode IstioIngressGatewayMode `json:"mode"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioservicemesh.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioservicemesh.go deleted file mode 100644 index 3677b77d2d6d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_istioservicemesh.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IstioServiceMesh struct { - Components *IstioComponents `json:"components,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_kubeletconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_kubeletconfig.go deleted file mode 100644 index 0f4036b4e7c1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_kubeletconfig.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KubeletConfig struct { - AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"` - ContainerLogMaxFiles *int64 `json:"containerLogMaxFiles,omitempty"` - ContainerLogMaxSizeMB *int64 `json:"containerLogMaxSizeMB,omitempty"` - CpuCfsQuota *bool `json:"cpuCfsQuota,omitempty"` - CpuCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` - CpuManagerPolicy *string `json:"cpuManagerPolicy,omitempty"` - FailSwapOn *bool `json:"failSwapOn,omitempty"` - ImageGcHighThreshold *int64 `json:"imageGcHighThreshold,omitempty"` - ImageGcLowThreshold *int64 `json:"imageGcLowThreshold,omitempty"` - PodMaxPids *int64 `json:"podMaxPids,omitempty"` - TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_linuxosconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_linuxosconfig.go deleted file mode 100644 index 431f6faa2aa6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_linuxosconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LinuxOSConfig struct { - SwapFileSizeMB *int64 `json:"swapFileSizeMB,omitempty"` - Sysctls *SysctlConfig `json:"sysctls,omitempty"` - TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"` - TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedcluster.go deleted file mode 100644 index 96f028c8024d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedcluster.go +++ /dev/null @@ -1,23 +0,0 @@ -package managedclusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "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 ManagedCluster struct { - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemOrUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ManagedClusterProperties `json:"properties,omitempty"` - Sku *ManagedClusterSKU `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraadprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraadprofile.go deleted file mode 100644 index 271addb1fd4d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraadprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAADProfile struct { - AdminGroupObjectIDs *[]string `json:"adminGroupObjectIDs,omitempty"` - ClientAppID *string `json:"clientAppID,omitempty"` - EnableAzureRBAC *bool `json:"enableAzureRBAC,omitempty"` - Managed *bool `json:"managed,omitempty"` - ServerAppID *string `json:"serverAppID,omitempty"` - ServerAppSecret *string `json:"serverAppSecret,omitempty"` - TenantID *string `json:"tenantID,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraccessprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraccessprofile.go deleted file mode 100644 index e248b2a253b1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraccessprofile.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedclusters - -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 ManagedClusterAccessProfile struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *AccessProfile `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraddonprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraddonprofile.go deleted file mode 100644 index 7dc1f865d9df..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteraddonprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAddonProfile struct { - Config *map[string]string `json:"config,omitempty"` - Enabled bool `json:"enabled"` - Identity *UserAssignedIdentity `json:"identity,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteragentpoolprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteragentpoolprofile.go deleted file mode 100644 index 747121cce221..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteragentpoolprofile.go +++ /dev/null @@ -1,58 +0,0 @@ -package managedclusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAgentPoolProfile struct { - AvailabilityZones *zones.Schema `json:"availabilityZones,omitempty"` - CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` - Count *int64 `json:"count,omitempty"` - CreationData *CreationData `json:"creationData,omitempty"` - CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` - EnableCustomCATrust *bool `json:"enableCustomCATrust,omitempty"` - EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` - EnableFIPS *bool `json:"enableFIPS,omitempty"` - EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` - EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` - GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` - HostGroupID *string `json:"hostGroupID,omitempty"` - KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` - KubeletDiskType *KubeletDiskType `json:"kubeletDiskType,omitempty"` - LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` - MaxCount *int64 `json:"maxCount,omitempty"` - MaxPods *int64 `json:"maxPods,omitempty"` - MessageOfTheDay *string `json:"messageOfTheDay,omitempty"` - MinCount *int64 `json:"minCount,omitempty"` - Mode *AgentPoolMode `json:"mode,omitempty"` - Name string `json:"name"` - NetworkProfile *AgentPoolNetworkProfile `json:"networkProfile,omitempty"` - NodeImageVersion *string `json:"nodeImageVersion,omitempty"` - NodeLabels *map[string]string `json:"nodeLabels,omitempty"` - NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` - NodeTaints *[]string `json:"nodeTaints,omitempty"` - OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` - OsDiskSizeGB *int64 `json:"osDiskSizeGB,omitempty"` - OsDiskType *OSDiskType `json:"osDiskType,omitempty"` - OsSKU *OSSKU `json:"osSKU,omitempty"` - OsType *OSType `json:"osType,omitempty"` - PodSubnetID *string `json:"podSubnetID,omitempty"` - PowerState *PowerState `json:"powerState,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` - ScaleDownMode *ScaleDownMode `json:"scaleDownMode,omitempty"` - ScaleSetEvictionPolicy *ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` - ScaleSetPriority *ScaleSetPriority `json:"scaleSetPriority,omitempty"` - SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *AgentPoolType `json:"type,omitempty"` - UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` - VMSize *string `json:"vmSize,omitempty"` - VnetSubnetID *string `json:"vnetSubnetID,omitempty"` - WindowsProfile *AgentPoolWindowsProfile `json:"windowsProfile,omitempty"` - WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go deleted file mode 100644 index 69b53ef85a7d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAPIServerAccessProfile struct { - AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` - DisableRunCommand *bool `json:"disableRunCommand,omitempty"` - EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` - EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` - EnableVnetIntegration *bool `json:"enableVnetIntegration,omitempty"` - PrivateDNSZone *string `json:"privateDNSZone,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go deleted file mode 100644 index e43a6df257f1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAutoUpgradeProfile struct { - NodeOSUpgradeChannel *NodeOSUpgradeChannel `json:"nodeOSUpgradeChannel,omitempty"` - UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go deleted file mode 100644 index 8a18140e45a8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAzureMonitorProfile struct { - Metrics *ManagedClusterAzureMonitorProfileMetrics `json:"metrics,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go deleted file mode 100644 index ef0fb9066e28..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAzureMonitorProfileKubeStateMetrics struct { - MetricAnnotationsAllowList *string `json:"metricAnnotationsAllowList,omitempty"` - MetricLabelsAllowlist *string `json:"metricLabelsAllowlist,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go deleted file mode 100644 index 5c173441517a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterAzureMonitorProfileMetrics struct { - Enabled bool `json:"enabled"` - KubeStateMetrics *ManagedClusterAzureMonitorProfileKubeStateMetrics `json:"kubeStateMetrics,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go deleted file mode 100644 index b9f467853876..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterHTTPProxyConfig struct { - EffectiveNoProxy *[]string `json:"effectiveNoProxy,omitempty"` - HTTPProxy *string `json:"httpProxy,omitempty"` - HTTPSProxy *string `json:"httpsProxy,omitempty"` - NoProxy *[]string `json:"noProxy,omitempty"` - TrustedCa *string `json:"trustedCa,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofile.go deleted file mode 100644 index ef54c8e80692..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterIngressProfile struct { - WebAppRouting *ManagedClusterIngressProfileWebAppRouting `json:"webAppRouting,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go deleted file mode 100644 index d45f66de7629..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterIngressProfileWebAppRouting struct { - DnsZoneResourceId *string `json:"dnsZoneResourceId,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Identity *UserAssignedIdentity `json:"identity,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go deleted file mode 100644 index 0d2207851bd1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go +++ /dev/null @@ -1,15 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterLoadBalancerProfile struct { - AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` - BackendPoolType *BackendPoolType `json:"backendPoolType,omitempty"` - EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` - EnableMultipleStandardLoadBalancers *bool `json:"enableMultipleStandardLoadBalancers,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` - OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` - OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go deleted file mode 100644 index b8d24680fed6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { - Count *int64 `json:"count,omitempty"` - CountIPv6 *int64 `json:"countIPv6,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go deleted file mode 100644 index 76893c76d85f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { - PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go deleted file mode 100644 index f0a60f5817e8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterLoadBalancerProfileOutboundIPs struct { - PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go deleted file mode 100644 index ec079b6cdf43..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterManagedOutboundIPProfile struct { - Count *int64 `json:"count,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternatgatewayprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternatgatewayprofile.go deleted file mode 100644 index a7e37699c62a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternatgatewayprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterNATGatewayProfile struct { - EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go deleted file mode 100644 index 1ae3147c2672..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterNodeResourceGroupProfile struct { - RestrictionLevel *RestrictionLevel `json:"restrictionLevel,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go deleted file mode 100644 index b5d3be88f7dc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterOIDCIssuerProfile struct { - Enabled *bool `json:"enabled,omitempty"` - IssuerURL *string `json:"issuerURL,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentity.go deleted file mode 100644 index 3bfb67996454..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentity.go +++ /dev/null @@ -1,13 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentity struct { - BindingSelector *string `json:"bindingSelector,omitempty"` - Identity UserAssignedIdentity `json:"identity"` - Name string `json:"name"` - Namespace string `json:"namespace"` - ProvisioningInfo *ManagedClusterPodIdentityProvisioningInfo `json:"provisioningInfo,omitempty"` - ProvisioningState *ManagedClusterPodIdentityProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityexception.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityexception.go deleted file mode 100644 index 28a710f9b5cc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityexception.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentityException struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - PodLabels map[string]string `json:"podLabels"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprofile.go deleted file mode 100644 index e32db30028af..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentityProfile struct { - AllowNetworkPluginKubenet *bool `json:"allowNetworkPluginKubenet,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - UserAssignedIdentities *[]ManagedClusterPodIdentity `json:"userAssignedIdentities,omitempty"` - UserAssignedIdentityExceptions *[]ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go deleted file mode 100644 index 1fb66d9034f6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentityProvisioningError struct { - Error *ManagedClusterPodIdentityProvisioningErrorBody `json:"error,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go deleted file mode 100644 index db4466f80bfe..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentityProvisioningErrorBody struct { - Code *string `json:"code,omitempty"` - Details *[]ManagedClusterPodIdentityProvisioningErrorBody `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go deleted file mode 100644 index 60464e39c822..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPodIdentityProvisioningInfo struct { - Error *ManagedClusterPodIdentityProvisioningError `json:"error,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go deleted file mode 100644 index 7bafa5df9722..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPoolUpgradeProfile struct { - KubernetesVersion string `json:"kubernetesVersion"` - Name *string `json:"name,omitempty"` - OsType OSType `json:"osType"` - Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesInlined `json:"upgrades,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go deleted file mode 100644 index ccc02dd99577..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPoolUpgradeProfileUpgradesInlined struct { - IsPreview *bool `json:"isPreview,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterproperties.go deleted file mode 100644 index 1679e7e0d4d9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterProperties struct { - AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` - AddonProfiles *map[string]ManagedClusterAddonProfile `json:"addonProfiles,omitempty"` - AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` - ApiServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` - AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` - AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` - AzureMonitorProfile *ManagedClusterAzureMonitorProfile `json:"azureMonitorProfile,omitempty"` - AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty"` - CreationData *CreationData `json:"creationData,omitempty"` - CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty"` - DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` - DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` - DnsPrefix *string `json:"dnsPrefix,omitempty"` - EnableNamespaceResources *bool `json:"enableNamespaceResources,omitempty"` - EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` - EnableRBAC *bool `json:"enableRBAC,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` - GuardrailsProfile *GuardrailsProfile `json:"guardrailsProfile,omitempty"` - HTTPProxyConfig *ManagedClusterHTTPProxyConfig `json:"httpProxyConfig,omitempty"` - IdentityProfile *map[string]UserAssignedIdentity `json:"identityProfile,omitempty"` - IngressProfile *ManagedClusterIngressProfile `json:"ingressProfile,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` - LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` - MaxAgentPools *int64 `json:"maxAgentPools,omitempty"` - NetworkProfile *ContainerServiceNetworkProfile `json:"networkProfile,omitempty"` - NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` - NodeResourceGroupProfile *ManagedClusterNodeResourceGroupProfile `json:"nodeResourceGroupProfile,omitempty"` - OidcIssuerProfile *ManagedClusterOIDCIssuerProfile `json:"oidcIssuerProfile,omitempty"` - PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"` - PowerState *PowerState `json:"powerState,omitempty"` - PrivateFQDN *string `json:"privateFQDN,omitempty"` - PrivateLinkResources *[]PrivateLinkResource `json:"privateLinkResources,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` - ServiceMeshProfile *ServiceMeshProfile `json:"serviceMeshProfile,omitempty"` - ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` - StorageProfile *ManagedClusterStorageProfile `json:"storageProfile,omitempty"` - UpgradeSettings *ClusterUpgradeSettings `json:"upgradeSettings,omitempty"` - WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` - WorkloadAutoScalerProfile *ManagedClusterWorkloadAutoScalerProfile `json:"workloadAutoScalerProfile,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go deleted file mode 100644 index 17fe396efa81..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go +++ /dev/null @@ -1,24 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPropertiesAutoScalerProfile 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofile.go deleted file mode 100644 index aecfd2517c11..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofile.go +++ /dev/null @@ -1,13 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfile struct { - AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` - CustomCATrustCertificates *[]string `json:"customCATrustCertificates,omitempty"` - Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` - ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` - NodeRestriction *ManagedClusterSecurityProfileNodeRestriction `json:"nodeRestriction,omitempty"` - WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go deleted file mode 100644 index c63debde097a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfileDefender struct { - LogAnalyticsWorkspaceResourceId *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` - SecurityMonitoring *ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go deleted file mode 100644 index de84c795fecc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go deleted file mode 100644 index eb3e2ea70073..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfileImageCleaner struct { - Enabled *bool `json:"enabled,omitempty"` - IntervalHours *int64 `json:"intervalHours,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go deleted file mode 100644 index 6730a946379f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfileNodeRestriction struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go deleted file mode 100644 index 84f0312767bb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSecurityProfileWorkloadIdentity struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go deleted file mode 100644 index 2a03beecdcc7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterServicePrincipalProfile struct { - ClientId string `json:"clientId"` - Secret *string `json:"secret,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersku.go deleted file mode 100644 index a4dcf9c50d3d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclustersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSKU struct { - Name *ManagedClusterSKUName `json:"name,omitempty"` - Tier *ManagedClusterSKUTier `json:"tier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofile.go deleted file mode 100644 index 11073ae103dc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterStorageProfile struct { - BlobCSIDriver *ManagedClusterStorageProfileBlobCSIDriver `json:"blobCSIDriver,omitempty"` - DiskCSIDriver *ManagedClusterStorageProfileDiskCSIDriver `json:"diskCSIDriver,omitempty"` - FileCSIDriver *ManagedClusterStorageProfileFileCSIDriver `json:"fileCSIDriver,omitempty"` - SnapshotController *ManagedClusterStorageProfileSnapshotController `json:"snapshotController,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go deleted file mode 100644 index dc0e951be6b5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterStorageProfileBlobCSIDriver struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go deleted file mode 100644 index 5a12e13453f0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterStorageProfileDiskCSIDriver struct { - Enabled *bool `json:"enabled,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go deleted file mode 100644 index 986ece9d9332..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterStorageProfileFileCSIDriver struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go deleted file mode 100644 index d46ee10b6835..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterStorageProfileSnapshotController struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofile.go deleted file mode 100644 index 86274cdb14a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterUpgradeProfile struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ManagedClusterUpgradeProfileProperties `json:"properties"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go deleted file mode 100644 index 4db4b1267606..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterUpgradeProfileProperties struct { - AgentPoolProfiles []ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles"` - ControlPlaneProfile ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterwindowsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterwindowsprofile.go deleted file mode 100644 index 8e3cffdace86..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterwindowsprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername string `json:"adminUsername"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *LicenseType `json:"licenseType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go deleted file mode 100644 index 891a44a0084d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterWorkloadAutoScalerProfile struct { - Keda *ManagedClusterWorkloadAutoScalerProfileKeda `json:"keda,omitempty"` - VerticalPodAutoscaler *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler `json:"verticalPodAutoscaler,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go deleted file mode 100644 index 7115a06bfb3e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterWorkloadAutoScalerProfileKeda struct { - Enabled bool `json:"enabled"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go deleted file mode 100644 index de1c2badc46e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler struct { - ControlledValues ControlledValues `json:"controlledValues"` - Enabled bool `json:"enabled"` - UpdateMode UpdateMode `json:"updateMode"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionprofile.go deleted file mode 100644 index 27b0bbc0c20c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OSOptionProfile struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties OSOptionPropertyList `json:"properties"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionproperty.go deleted file mode 100644 index 4c8a976ae2d2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionproperty.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OSOptionProperty struct { - EnableFipsImage bool `json:"enable-fips-image"` - OsType string `json:"os-type"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionpropertylist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionpropertylist.go deleted file mode 100644 index 5c126250b2cd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_osoptionpropertylist.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OSOptionPropertyList struct { - OsOptionPropertyList []OSOptionProperty `json:"osOptionPropertyList"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_outboundenvironmentendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_outboundenvironmentendpoint.go deleted file mode 100644 index a4f0d234bc80..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_outboundenvironmentendpoint.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundEnvironmentEndpoint struct { - Category *string `json:"category,omitempty"` - Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_portrange.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_portrange.go deleted file mode 100644 index 0a44c59e9c87..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_portrange.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PortRange struct { - PortEnd *int64 `json:"portEnd,omitempty"` - PortStart *int64 `json:"portStart,omitempty"` - Protocol *Protocol `json:"protocol,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_powerstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_powerstate.go deleted file mode 100644 index d5abeb15b66a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_powerstate.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PowerState struct { - Code *Code `json:"code,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_privatelinkresource.go deleted file mode 100644 index 14d827574be5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResource struct { - GroupId *string `json:"groupId,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_resourcereference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_resourcereference.go deleted file mode 100644 index dbb05bb4711d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_resourcereference.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceReference struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandrequest.go deleted file mode 100644 index caa9ae3d0cdc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandrequest.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunCommandRequest struct { - ClusterToken *string `json:"clusterToken,omitempty"` - Command string `json:"command"` - Context *string `json:"context,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandresult.go deleted file mode 100644 index 59cfc374de3d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_runcommandresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunCommandResult struct { - Id *string `json:"id,omitempty"` - Properties *CommandResultProperties `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_servicemeshprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_servicemeshprofile.go deleted file mode 100644 index 781365d16f31..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_servicemeshprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceMeshProfile struct { - Istio *IstioServiceMesh `json:"istio,omitempty"` - Mode ServiceMeshMode `json:"mode"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_sysctlconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_sysctlconfig.go deleted file mode 100644 index 00f3cc50224a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_sysctlconfig.go +++ /dev/null @@ -1,35 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SysctlConfig struct { - FsAioMaxNr *int64 `json:"fsAioMaxNr,omitempty"` - FsFileMax *int64 `json:"fsFileMax,omitempty"` - FsInotifyMaxUserWatches *int64 `json:"fsInotifyMaxUserWatches,omitempty"` - FsNrOpen *int64 `json:"fsNrOpen,omitempty"` - KernelThreadsMax *int64 `json:"kernelThreadsMax,omitempty"` - NetCoreNetdevMaxBacklog *int64 `json:"netCoreNetdevMaxBacklog,omitempty"` - NetCoreOptmemMax *int64 `json:"netCoreOptmemMax,omitempty"` - NetCoreRmemDefault *int64 `json:"netCoreRmemDefault,omitempty"` - NetCoreRmemMax *int64 `json:"netCoreRmemMax,omitempty"` - NetCoreSomaxconn *int64 `json:"netCoreSomaxconn,omitempty"` - NetCoreWmemDefault *int64 `json:"netCoreWmemDefault,omitempty"` - NetCoreWmemMax *int64 `json:"netCoreWmemMax,omitempty"` - NetIPv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"` - NetIPv4NeighDefaultGcThresh1 *int64 `json:"netIpv4NeighDefaultGcThresh1,omitempty"` - NetIPv4NeighDefaultGcThresh2 *int64 `json:"netIpv4NeighDefaultGcThresh2,omitempty"` - NetIPv4NeighDefaultGcThresh3 *int64 `json:"netIpv4NeighDefaultGcThresh3,omitempty"` - NetIPv4TcpFinTimeout *int64 `json:"netIpv4TcpFinTimeout,omitempty"` - NetIPv4TcpKeepaliveProbes *int64 `json:"netIpv4TcpKeepaliveProbes,omitempty"` - NetIPv4TcpKeepaliveTime *int64 `json:"netIpv4TcpKeepaliveTime,omitempty"` - NetIPv4TcpMaxSynBacklog *int64 `json:"netIpv4TcpMaxSynBacklog,omitempty"` - NetIPv4TcpMaxTwBuckets *int64 `json:"netIpv4TcpMaxTwBuckets,omitempty"` - NetIPv4TcpTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"` - NetIPv4TcpkeepaliveIntvl *int64 `json:"netIpv4TcpkeepaliveIntvl,omitempty"` - NetNetfilterNfConntrackBuckets *int64 `json:"netNetfilterNfConntrackBuckets,omitempty"` - NetNetfilterNfConntrackMax *int64 `json:"netNetfilterNfConntrackMax,omitempty"` - VMMaxMapCount *int64 `json:"vmMaxMapCount,omitempty"` - VMSwappiness *int64 `json:"vmSwappiness,omitempty"` - VMVfsCachePressure *int64 `json:"vmVfsCachePressure,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_tagsobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_tagsobject.go deleted file mode 100644 index 69f1454e3b11..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TagsObject struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_upgradeoverridesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_upgradeoverridesettings.go deleted file mode 100644 index d3537c3f2ceb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_upgradeoverridesettings.go +++ /dev/null @@ -1,27 +0,0 @@ -package managedclusters - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpgradeOverrideSettings struct { - ControlPlaneOverrides *[]ControlPlaneUpgradeOverride `json:"controlPlaneOverrides,omitempty"` - Until *string `json:"until,omitempty"` -} - -func (o *UpgradeOverrideSettings) GetUntilAsTime() (*time.Time, error) { - if o.Until == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Until, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeOverrideSettings) SetUntilAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Until = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_userassignedidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_userassignedidentity.go deleted file mode 100644 index b1eecd7085aa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_userassignedidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserAssignedIdentity struct { - ClientId *string `json:"clientId,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_windowsgmsaprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_windowsgmsaprofile.go deleted file mode 100644 index 742f96764d45..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/model_windowsgmsaprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WindowsGmsaProfile struct { - DnsServer *string `json:"dnsServer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - RootDomainName *string `json:"rootDomainName,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/predicates.go deleted file mode 100644 index 9031c4ab52c7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -package managedclusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ManagedClusterOperationPredicate) Matches(input ManagedCluster) 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 -} - -type OutboundEnvironmentEndpointOperationPredicate struct { - Category *string -} - -func (p OutboundEnvironmentEndpointOperationPredicate) Matches(input OutboundEnvironmentEndpoint) bool { - - if p.Category != nil && (input.Category == nil && *p.Category != *input.Category) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/version.go deleted file mode 100644 index 1030eb942412..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclusters - -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 = "2023-02-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedclusters/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md index d6267233e1d2..3396d79ed853 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md @@ -81,7 +81,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := agentpools.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.GetAvailableAgentPoolVersions(ctx, id) if err != nil { @@ -113,7 +113,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := agentpools.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/id_managedcluster.go deleted file mode 100644 index 682444af5ec2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package agentpools - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go index 9cdff78ed4c6..73e49c546708 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type GetAvailableAgentPoolVersionsOperationResponse struct { } // GetAvailableAgentPoolVersions ... -func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id ManagedClusterId) (result GetAvailableAgentPoolVersionsOperationResponse, err error) { +func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id commonids.KubernetesClusterId) (result GetAvailableAgentPoolVersionsOperationResponse, err error) { req, err := c.preparerForGetAvailableAgentPoolVersions(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "agentpools.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id } // preparerForGetAvailableAgentPoolVersions prepares the GetAvailableAgentPoolVersions request. -func (c AgentPoolsClient) preparerForGetAvailableAgentPoolVersions(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c AgentPoolsClient) preparerForGetAvailableAgentPoolVersions(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list_autorest.go index 2dbc9943693c..85002f4ba417 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperation } // List ... -func (c AgentPoolsClient) List(ctx context.Context, id ManagedClusterId) (resp ListOperationResponse, err error) { +func (c AgentPoolsClient) List(ctx context.Context, id commonids.KubernetesClusterId) (resp ListOperationResponse, err error) { req, err := c.preparerForList(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "agentpools.AgentPoolsClient", "List", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c AgentPoolsClient) List(ctx context.Context, id ManagedClusterId) (resp L } // preparerForList prepares the List request. -func (c AgentPoolsClient) preparerForList(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c AgentPoolsClient) preparerForList(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c AgentPoolsClient) responderForList(resp *http.Response) (result ListOper } // ListComplete retrieves all of the results into a single object -func (c AgentPoolsClient) ListComplete(ctx context.Context, id ManagedClusterId) (ListCompleteResult, error) { +func (c AgentPoolsClient) ListComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListCompleteResult, error) { return c.ListCompleteMatchingPredicate(ctx, id, AgentPoolOperationPredicate{}) } // ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c AgentPoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate AgentPoolOperationPredicate) (resp ListCompleteResult, err error) { +func (c AgentPoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate AgentPoolOperationPredicate) (resp ListCompleteResult, err error) { items := make([]AgentPool, 0) page, err := c.List(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md index 82b48428539c..99262c865068 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := maintenanceconfigurations.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.ListByManagedCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByManagedClusterComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_managedcluster.go deleted file mode 100644 index ab6f2309edd0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package maintenanceconfigurations - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go index 5fa46cf3abbe..7463165baacd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListByManagedClusterOperationResponse) LoadMore(ctx context.Context) (re } // ListByManagedCluster ... -func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, id ManagedClusterId) (resp ListByManagedClusterOperationResponse, err error) { +func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, id commonids.KubernetesClusterId) (resp ListByManagedClusterOperationResponse, err error) { req, err := c.preparerForListByManagedCluster(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "maintenanceconfigurations.MaintenanceConfigurationsClient", "ListByManagedCluster", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Contex } // preparerForListByManagedCluster prepares the ListByManagedCluster request. -func (c MaintenanceConfigurationsClient) preparerForListByManagedCluster(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c MaintenanceConfigurationsClient) preparerForListByManagedCluster(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c MaintenanceConfigurationsClient) responderForListByManagedCluster(resp * } // ListByManagedClusterComplete retrieves all of the results into a single object -func (c MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, id ManagedClusterId) (ListByManagedClusterCompleteResult, error) { +func (c MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListByManagedClusterCompleteResult, error) { return c.ListByManagedClusterCompleteMatchingPredicate(ctx, id, MaintenanceConfigurationOperationPredicate{}) } // ListByManagedClusterCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c MaintenanceConfigurationsClient) ListByManagedClusterCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate MaintenanceConfigurationOperationPredicate) (resp ListByManagedClusterCompleteResult, err error) { +func (c MaintenanceConfigurationsClient) ListByManagedClusterCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate MaintenanceConfigurationOperationPredicate) (resp ListByManagedClusterCompleteResult, err error) { items := make([]MaintenanceConfiguration, 0) page, err := c.ListByManagedCluster(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md index fb9e1e9c44b3..42a874307f35 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedCluster{ // ... @@ -53,7 +53,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationO ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.Get(ctx, id) if err != nil { @@ -129,7 +129,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.GetUpgradeProfile(ctx, id) if err != nil { @@ -179,7 +179,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterAdminCredentials(ctx, id, managedclusters.DefaultListClusterAdminCredentialsOperationOptions()) if err != nil { @@ -195,7 +195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterMonitoringUserCredentials(ctx, id, managedclusters.DefaultListClusterMonitoringUserCredentialsOperationOptions()) if err != nil { @@ -211,7 +211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") read, err := client.ListClusterUserCredentials(ctx, id, managedclusters.DefaultListClusterUserCredentialsOperationOptions()) if err != nil { @@ -243,7 +243,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -260,7 +260,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedClusterAADProfile{ // ... @@ -277,7 +277,7 @@ if err := client.ResetAADProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.ManagedClusterServicePrincipalProfile{ // ... @@ -294,7 +294,7 @@ if err := client.ResetServicePrincipalProfileThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { // handle the error @@ -306,7 +306,7 @@ if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { // handle the error @@ -318,7 +318,7 @@ if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.RunCommandRequest{ // ... @@ -335,7 +335,7 @@ if err := client.RunCommandThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -347,7 +347,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -359,7 +359,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedclusters.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") +id := managedclusters.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") payload := managedclusters.TagsObject{ // ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_managedcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_managedcluster.go deleted file mode 100644 index 0288ce671dd1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_managedcluster.go +++ /dev/null @@ -1,127 +0,0 @@ -package managedclusters - -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 = ManagedClusterId{} - -// ManagedClusterId is a struct representing the Resource ID for a Managed Cluster -type ManagedClusterId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterName string -} - -// NewManagedClusterID returns a new ManagedClusterId struct -func NewManagedClusterID(subscriptionId string, resourceGroupName string, managedClusterName string) ManagedClusterId { - return ManagedClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterName: managedClusterName, - } -} - -// ParseManagedClusterID parses 'input' into a ManagedClusterId -func ParseManagedClusterID(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ParseManagedClusterIDInsensitively parses 'input' case-insensitively into a ManagedClusterId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterIDInsensitively(input string) (*ManagedClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(ManagedClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ManagedClusterId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.ManagedClusterName, ok = parsed.Parsed["managedClusterName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", *parsed) - } - - return &id, nil -} - -// ValidateManagedClusterID checks that 'input' can be parsed as a Managed Cluster ID -func ValidateManagedClusterID(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 := ParseManagedClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster ID -func (id ManagedClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster ID -func (id ManagedClusterId) 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterValue"), - } -} - -// String returns a human-readable description of this Managed Cluster ID -func (id ManagedClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), - } - return fmt.Sprintf("Managed Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation_autorest.go index e9aa2dc1e0f6..76ae937e4883 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type AbortLatestOperationOperationResponse struct { } // AbortLatestOperation ... -func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id ManagedClusterId) (result AbortLatestOperationOperationResponse, err error) { +func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id commonids.KubernetesClusterId) (result AbortLatestOperationOperationResponse, err error) { req, err := c.preparerForAbortLatestOperation(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "AbortLatestOperation", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id Mana } // AbortLatestOperationThenPoll performs AbortLatestOperation then polls until it's completed -func (c ManagedClustersClient) AbortLatestOperationThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) AbortLatestOperationThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.AbortLatestOperation(ctx, id) if err != nil { return fmt.Errorf("performing AbortLatestOperation: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) AbortLatestOperationThenPoll(ctx context.Context, } // preparerForAbortLatestOperation prepares the AbortLatestOperation request. -func (c ManagedClustersClient) preparerForAbortLatestOperation(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForAbortLatestOperation(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate_autorest.go index 3bf60ea59122..4118b1d4aa36 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type CreateOrUpdateOperationResponse struct { } // CreateOrUpdate ... -func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (result CreateOrUpdateOperationResponse, err error) { +func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (result CreateOrUpdateOperationResponse, err error) { req, err := c.preparerForCreateOrUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id ManagedClu } // CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id ManagedClusterId, input ManagedCluster) error { +func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) error { result, err := c.CreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdate: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id Ma } // preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c ManagedClustersClient) preparerForCreateOrUpdate(ctx context.Context, id ManagedClusterId, input ManagedCluster) (*http.Request, error) { +func (c ManagedClustersClient) preparerForCreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete_autorest.go index 0255e77f2611..b6a15e70f3bd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -43,7 +44,7 @@ func (o DeleteOperationOptions) toQueryString() map[string]interface{} { } // Delete ... -func (c ManagedClustersClient) Delete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { +func (c ManagedClustersClient) Delete(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { req, err := c.preparerForDelete(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Delete", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c ManagedClustersClient) Delete(ctx context.Context, id ManagedClusterId, } // DeleteThenPoll performs Delete then polls until it's completed -func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) error { +func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) error { result, err := c.Delete(ctx, id, options) if err != nil { return fmt.Errorf("performing Delete: %+v", err) @@ -74,7 +75,7 @@ func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id ManagedClu } // preparerForDelete prepares the Delete request. -func (c ManagedClustersClient) preparerForDelete(ctx context.Context, id ManagedClusterId, options DeleteOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForDelete(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get_autorest.go index c5e08ae898de..dd792998fed2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get_autorest.go @@ -6,6 +6,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ type GetOperationResponse struct { } // Get ... -func (c ManagedClustersClient) Get(ctx context.Context, id ManagedClusterId) (result GetOperationResponse, err error) { +func (c ManagedClustersClient) Get(ctx context.Context, id commonids.KubernetesClusterId) (result GetOperationResponse, err error) { req, err := c.preparerForGet(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Get", nil, "Failure preparing request") @@ -40,7 +41,7 @@ func (c ManagedClustersClient) Get(ctx context.Context, id ManagedClusterId) (re } // preparerForGet prepares the Get request. -func (c ManagedClustersClient) preparerForGet(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForGet(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile_autorest.go index cb70f49aa028..cd10c7215b92 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ type GetUpgradeProfileOperationResponse struct { } // GetUpgradeProfile ... -func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id ManagedClusterId) (result GetUpgradeProfileOperationResponse, err error) { +func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id commonids.KubernetesClusterId) (result GetUpgradeProfileOperationResponse, err error) { req, err := c.preparerForGetUpgradeProfile(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") @@ -41,7 +42,7 @@ func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id Managed } // preparerForGetUpgradeProfile prepares the GetUpgradeProfile request. -func (c ManagedClustersClient) preparerForGetUpgradeProfile(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForGetUpgradeProfile(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go index e14b90ceb4e2..f8024c5b3075 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,7 +43,7 @@ func (o ListClusterAdminCredentialsOperationOptions) toQueryString() map[string] } // ListClusterAdminCredentials ... -func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterAdminCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") @@ -65,7 +66,7 @@ func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, } // preparerForListClusterAdminCredentials prepares the ListClusterAdminCredentials request. -func (c ManagedClustersClient) preparerForListClusterAdminCredentials(ctx context.Context, id ManagedClusterId, options ListClusterAdminCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterAdminCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterAdminCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go index 6065e73fd64c..a7f62d3aff19 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,7 +43,7 @@ func (o ListClusterMonitoringUserCredentialsOperationOptions) toQueryString() ma } // ListClusterMonitoringUserCredentials ... -func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterMonitoringUserCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") @@ -65,7 +66,7 @@ func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context. } // preparerForListClusterMonitoringUserCredentials prepares the ListClusterMonitoringUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterMonitoringUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterMonitoringUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials_autorest.go index 2cd263f9b47e..0c90a5488c66 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials_autorest.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,7 +48,7 @@ func (o ListClusterUserCredentialsOperationOptions) toQueryString() map[string]i } // ListClusterUserCredentials ... -func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { +func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { req, err := c.preparerForListClusterUserCredentials(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") @@ -70,7 +71,7 @@ func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, i } // preparerForListClusterUserCredentials prepares the ListClusterUserCredentials request. -func (c ManagedClustersClient) preparerForListClusterUserCredentials(ctx context.Context, id ManagedClusterId, options ListClusterUserCredentialsOperationOptions) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListClusterUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterUserCredentialsOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go index cdc548f003d0..c3db60df9284 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,7 +39,7 @@ func (r ListOutboundNetworkDependenciesEndpointsOperationResponse) LoadMore(ctx } // ListOutboundNetworkDependenciesEndpoints ... -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id commonids.KubernetesClusterId) (resp ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { req, err := c.preparerForListOutboundNetworkDependenciesEndpoints(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -60,7 +61,7 @@ func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx cont } // preparerForListOutboundNetworkDependenciesEndpoints prepares the ListOutboundNetworkDependenciesEndpoints request. -func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpoints(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForListOutboundNetworkDependenciesEndpoints(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,12 +143,12 @@ func (c ManagedClustersClient) responderForListOutboundNetworkDependenciesEndpoi } // ListOutboundNetworkDependenciesEndpointsComplete retrieves all of the results into a single object -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id ManagedClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { return c.ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx, id, OutboundEnvironmentEndpointOperationPredicate{}) } // ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id ManagedClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (resp ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (resp ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { items := make([]OutboundEnvironmentEndpoint, 0) page, err := c.ListOutboundNetworkDependenciesEndpoints(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile_autorest.go index 8c3bf221bffb..5c43129a602b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type ResetAADProfileOperationResponse struct { } // ResetAADProfile ... -func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { +func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { req, err := c.preparerForResetAADProfile(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id ManagedCl } // ResetAADProfileThenPoll performs ResetAADProfile then polls until it's completed -func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) error { +func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) error { result, err := c.ResetAADProfile(ctx, id, input) if err != nil { return fmt.Errorf("performing ResetAADProfile: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id M } // preparerForResetAADProfile prepares the ResetAADProfile request. -func (c ManagedClustersClient) preparerForResetAADProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterAADProfile) (*http.Request, error) { +func (c ManagedClustersClient) preparerForResetAADProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go index 7830267d6163..874e24031409 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type ResetServicePrincipalProfileOperationResponse struct { } // ResetServicePrincipalProfile ... -func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { +func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { req, err := c.preparerForResetServicePrincipalProfile(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, } // ResetServicePrincipalProfileThenPoll performs ResetServicePrincipalProfile then polls until it's completed -func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) error { +func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) error { result, err := c.ResetServicePrincipalProfile(ctx, id, input) if err != nil { return fmt.Errorf("performing ResetServicePrincipalProfile: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context. } // preparerForResetServicePrincipalProfile prepares the ResetServicePrincipalProfile request. -func (c ManagedClustersClient) preparerForResetServicePrincipalProfile(ctx context.Context, id ManagedClusterId, input ManagedClusterServicePrincipalProfile) (*http.Request, error) { +func (c ManagedClustersClient) preparerForResetServicePrincipalProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates_autorest.go index 83b54e351193..3dbf6a18a04e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RotateClusterCertificatesOperationResponse struct { } // RotateClusterCertificates ... -func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id ManagedClusterId) (result RotateClusterCertificatesOperationResponse, err error) { +func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id commonids.KubernetesClusterId) (result RotateClusterCertificatesOperationResponse, err error) { req, err := c.preparerForRotateClusterCertificates(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id } // RotateClusterCertificatesThenPoll performs RotateClusterCertificates then polls until it's completed -func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.RotateClusterCertificates(ctx, id) if err != nil { return fmt.Errorf("performing RotateClusterCertificates: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Con } // preparerForRotateClusterCertificates prepares the RotateClusterCertificates request. -func (c ManagedClustersClient) preparerForRotateClusterCertificates(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRotateClusterCertificates(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go index f5bf5cc8da57..d0806cb35c67 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RotateServiceAccountSigningKeysOperationResponse struct { } // RotateServiceAccountSigningKeys ... -func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { +func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id commonids.KubernetesClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { req, err := c.preparerForRotateServiceAccountSigningKeys(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RotateServiceAccountSigningKeys", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Conte } // RotateServiceAccountSigningKeysThenPoll performs RotateServiceAccountSigningKeys then polls until it's completed -func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.RotateServiceAccountSigningKeys(ctx, id) if err != nil { return fmt.Errorf("performing RotateServiceAccountSigningKeys: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx conte } // preparerForRotateServiceAccountSigningKeys prepares the RotateServiceAccountSigningKeys request. -func (c ManagedClustersClient) preparerForRotateServiceAccountSigningKeys(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRotateServiceAccountSigningKeys(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand_autorest.go index 4f3eecf77593..91b831bec3f0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type RunCommandOperationResponse struct { } // RunCommand ... -func (c ManagedClustersClient) RunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { +func (c ManagedClustersClient) RunCommand(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { req, err := c.preparerForRunCommand(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "RunCommand", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) RunCommand(ctx context.Context, id ManagedCluster } // RunCommandThenPoll performs RunCommand then polls until it's completed -func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id ManagedClusterId, input RunCommandRequest) error { +func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) error { result, err := c.RunCommand(ctx, id, input) if err != nil { return fmt.Errorf("performing RunCommand: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id Manage } // preparerForRunCommand prepares the RunCommand request. -func (c ManagedClustersClient) preparerForRunCommand(ctx context.Context, id ManagedClusterId, input RunCommandRequest) (*http.Request, error) { +func (c ManagedClustersClient) preparerForRunCommand(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start_autorest.go index e58f11e31c8a..523cd6864891 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type StartOperationResponse struct { } // Start ... -func (c ManagedClustersClient) Start(ctx context.Context, id ManagedClusterId) (result StartOperationResponse, err error) { +func (c ManagedClustersClient) Start(ctx context.Context, id commonids.KubernetesClusterId) (result StartOperationResponse, err error) { req, err := c.preparerForStart(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Start", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) Start(ctx context.Context, id ManagedClusterId) ( } // StartThenPoll performs Start then polls until it's completed -func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.Start(ctx, id) if err != nil { return fmt.Errorf("performing Start: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id ManagedClus } // preparerForStart prepares the Start request. -func (c ManagedClustersClient) preparerForStart(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForStart(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop_autorest.go index 1324f9e0ad44..ecd7e737a40d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type StopOperationResponse struct { } // Stop ... -func (c ManagedClustersClient) Stop(ctx context.Context, id ManagedClusterId) (result StopOperationResponse, err error) { +func (c ManagedClustersClient) Stop(ctx context.Context, id commonids.KubernetesClusterId) (result StopOperationResponse, err error) { req, err := c.preparerForStop(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "Stop", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) Stop(ctx context.Context, id ManagedClusterId) (r } // StopThenPoll performs Stop then polls until it's completed -func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id ManagedClusterId) error { +func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { result, err := c.Stop(ctx, id) if err != nil { return fmt.Errorf("performing Stop: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id ManagedClust } // preparerForStop prepares the Stop request. -func (c ManagedClustersClient) preparerForStop(ctx context.Context, id ManagedClusterId) (*http.Request, error) { +func (c ManagedClustersClient) preparerForStop(ctx context.Context, id commonids.KubernetesClusterId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags_autorest.go index 8786b846f79d..36cc9862f222 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/polling" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,7 +20,7 @@ type UpdateTagsOperationResponse struct { } // UpdateTags ... -func (c ManagedClustersClient) UpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (result UpdateTagsOperationResponse, err error) { +func (c ManagedClustersClient) UpdateTags(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) (result UpdateTagsOperationResponse, err error) { req, err := c.preparerForUpdateTags(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "managedclusters.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") @@ -36,7 +37,7 @@ func (c ManagedClustersClient) UpdateTags(ctx context.Context, id ManagedCluster } // UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id ManagedClusterId, input TagsObject) error { +func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) error { result, err := c.UpdateTags(ctx, id, input) if err != nil { return fmt.Errorf("performing UpdateTags: %+v", err) @@ -50,7 +51,7 @@ func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id Manage } // preparerForUpdateTags prepares the UpdateTags request. -func (c ManagedClustersClient) preparerForUpdateTags(ctx context.Context, id ManagedClusterId, input TagsObject) (*http.Request, error) { +func (c ManagedClustersClient) preparerForUpdateTags(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/id_virtualnetwork.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/id_virtualnetwork.go deleted file mode 100644 index 87dbe94785c3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/id_virtualnetwork.go +++ /dev/null @@ -1,127 +0,0 @@ -package dnsforwardingrulesets - -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) - } - - var ok bool - id := VirtualNetworkId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - 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) - } - - var ok bool - id := VirtualNetworkId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - return &id, 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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/method_listbyvirtualnetwork_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/method_listbyvirtualnetwork_autorest.go index 57e25a954644..4f8de812c137 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/method_listbyvirtualnetwork_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsforwardingrulesets/method_listbyvirtualnetwork_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -62,7 +63,7 @@ func (o ListByVirtualNetworkOperationOptions) toQueryString() map[string]interfa } // ListByVirtualNetwork ... -func (c DnsForwardingRulesetsClient) ListByVirtualNetwork(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (resp ListByVirtualNetworkOperationResponse, err error) { +func (c DnsForwardingRulesetsClient) ListByVirtualNetwork(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (resp ListByVirtualNetworkOperationResponse, err error) { req, err := c.preparerForListByVirtualNetwork(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "dnsforwardingrulesets.DnsForwardingRulesetsClient", "ListByVirtualNetwork", nil, "Failure preparing request") @@ -84,7 +85,7 @@ func (c DnsForwardingRulesetsClient) ListByVirtualNetwork(ctx context.Context, i } // preparerForListByVirtualNetwork prepares the ListByVirtualNetwork request. -func (c DnsForwardingRulesetsClient) preparerForListByVirtualNetwork(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (*http.Request, error) { +func (c DnsForwardingRulesetsClient) preparerForListByVirtualNetwork(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -171,12 +172,12 @@ func (c DnsForwardingRulesetsClient) responderForListByVirtualNetwork(resp *http } // ListByVirtualNetworkComplete retrieves all of the results into a single object -func (c DnsForwardingRulesetsClient) ListByVirtualNetworkComplete(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (ListByVirtualNetworkCompleteResult, error) { +func (c DnsForwardingRulesetsClient) ListByVirtualNetworkComplete(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (ListByVirtualNetworkCompleteResult, error) { return c.ListByVirtualNetworkCompleteMatchingPredicate(ctx, id, options, VirtualNetworkDnsForwardingRulesetOperationPredicate{}) } // ListByVirtualNetworkCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c DnsForwardingRulesetsClient) ListByVirtualNetworkCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions, predicate VirtualNetworkDnsForwardingRulesetOperationPredicate) (resp ListByVirtualNetworkCompleteResult, err error) { +func (c DnsForwardingRulesetsClient) ListByVirtualNetworkCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions, predicate VirtualNetworkDnsForwardingRulesetOperationPredicate) (resp ListByVirtualNetworkCompleteResult, err error) { items := make([]VirtualNetworkDnsForwardingRuleset, 0) page, err := c.ListByVirtualNetwork(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/id_virtualnetwork.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/id_virtualnetwork.go deleted file mode 100644 index 8a5d64f247cd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/id_virtualnetwork.go +++ /dev/null @@ -1,127 +0,0 @@ -package dnsresolvers - -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) - } - - var ok bool - id := VirtualNetworkId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - 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) - } - - var ok bool - id := VirtualNetworkId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) - } - - return &id, 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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - 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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/method_listbyvirtualnetwork_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/method_listbyvirtualnetwork_autorest.go index 30adaef6ad14..ed346b50ee4f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/method_listbyvirtualnetwork_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/dnsresolver/2022-07-01/dnsresolvers/method_listbyvirtualnetwork_autorest.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -62,7 +63,7 @@ func (o ListByVirtualNetworkOperationOptions) toQueryString() map[string]interfa } // ListByVirtualNetwork ... -func (c DnsResolversClient) ListByVirtualNetwork(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (resp ListByVirtualNetworkOperationResponse, err error) { +func (c DnsResolversClient) ListByVirtualNetwork(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (resp ListByVirtualNetworkOperationResponse, err error) { req, err := c.preparerForListByVirtualNetwork(ctx, id, options) if err != nil { err = autorest.NewErrorWithError(err, "dnsresolvers.DnsResolversClient", "ListByVirtualNetwork", nil, "Failure preparing request") @@ -84,7 +85,7 @@ func (c DnsResolversClient) ListByVirtualNetwork(ctx context.Context, id Virtual } // preparerForListByVirtualNetwork prepares the ListByVirtualNetwork request. -func (c DnsResolversClient) preparerForListByVirtualNetwork(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (*http.Request, error) { +func (c DnsResolversClient) preparerForListByVirtualNetwork(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -171,12 +172,12 @@ func (c DnsResolversClient) responderForListByVirtualNetwork(resp *http.Response } // ListByVirtualNetworkComplete retrieves all of the results into a single object -func (c DnsResolversClient) ListByVirtualNetworkComplete(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (ListByVirtualNetworkCompleteResult, error) { +func (c DnsResolversClient) ListByVirtualNetworkComplete(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions) (ListByVirtualNetworkCompleteResult, error) { return c.ListByVirtualNetworkCompleteMatchingPredicate(ctx, id, options, SubResourceOperationPredicate{}) } // ListByVirtualNetworkCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c DnsResolversClient) ListByVirtualNetworkCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkId, options ListByVirtualNetworkOperationOptions, predicate SubResourceOperationPredicate) (resp ListByVirtualNetworkCompleteResult, err error) { +func (c DnsResolversClient) ListByVirtualNetworkCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, options ListByVirtualNetworkOperationOptions, predicate SubResourceOperationPredicate) (resp ListByVirtualNetworkCompleteResult, err error) { items := make([]SubResource, 0) page, err := c.ListByVirtualNetwork(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasource.go new file mode 100644 index 000000000000..d6186f743654 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasource.go @@ -0,0 +1,41 @@ +package outputs + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ OutputDataSource = AzureDataExplorerOutputDataSource{} + +type AzureDataExplorerOutputDataSource struct { + Properties *AzureDataExplorerOutputDataSourceProperties `json:"properties,omitempty"` + + // Fields inherited from OutputDataSource +} + +var _ json.Marshaler = AzureDataExplorerOutputDataSource{} + +func (s AzureDataExplorerOutputDataSource) MarshalJSON() ([]byte, error) { + type wrapper AzureDataExplorerOutputDataSource + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataExplorerOutputDataSource: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataExplorerOutputDataSource: %+v", err) + } + decoded["type"] = "Microsoft.Kusto/clusters/databases" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataExplorerOutputDataSource: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasourceproperties.go new file mode 100644 index 000000000000..5eb4265f95d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_azuredataexploreroutputdatasourceproperties.go @@ -0,0 +1,11 @@ +package outputs + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataExplorerOutputDataSourceProperties struct { + AuthenticationMode *AuthenticationMode `json:"authenticationMode,omitempty"` + Cluster *string `json:"cluster,omitempty"` + Database *string `json:"database,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_outputdatasource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_outputdatasource.go index 1cc019bcd24a..279b7706c837 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_outputdatasource.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs/model_outputdatasource.go @@ -27,6 +27,14 @@ func unmarshalOutputDataSourceImplementation(input []byte) (OutputDataSource, er return nil, nil } + if strings.EqualFold(value, "Microsoft.Kusto/clusters/databases") { + var out AzureDataExplorerOutputDataSource + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataExplorerOutputDataSource: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Microsoft.DataLake/Accounts") { var out AzureDataLakeStoreOutputDataSource if err := json.Unmarshal(input, &out); err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 881c0229da2a..df331d59b792 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -116,7 +116,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.56.0 +# github.com/hashicorp/go-azure-helpers v0.57.0 ## explicit; go 1.19 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates @@ -135,7 +135,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/tags github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20230614.1151152 +# github.com/hashicorp/go-azure-sdk v0.20230622.1085613 ## explicit; go 1.19 github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview @@ -248,7 +248,6 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-p github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/snapshots github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess -github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-02-02-preview/managedclusters github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters