From f88a2fcb572c736c5591e46d216eea7ca8b0a970 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 17 Oct 2023 15:03:34 -0700 Subject: [PATCH] Add Express Route Circuit Subscription Cleaner --- clients/client.go | 104 ++-- dalek/cleaners/subscriptions.go | 1 + ...scriptions_delete_express_route_circuit.go | 142 ++++++ .../README.md | 82 ++++ .../client.go | 26 + .../constants.go | 98 ++++ .../id_authorization.go | 140 ++++++ .../id_expressroutecircuit.go | 127 +++++ .../method_createorupdate.go | 74 +++ .../method_delete.go | 71 +++ .../method_get.go | 51 ++ .../method_list.go | 89 ++++ .../model_authorizationpropertiesformat.go | 10 + .../model_expressroutecircuitauthorization.go | 12 + .../predicates.go | 32 ++ .../version.go | 12 + .../expressroutecircuitconnections/README.md | 82 ++++ .../expressroutecircuitconnections/client.go | 26 + .../constants.go | 101 ++++ .../id_peeringconnection.go | 153 ++++++ .../method_createorupdate.go | 74 +++ .../method_delete.go | 71 +++ .../method_get.go | 51 ++ .../method_list.go | 90 ++++ .../model_expressroutecircuitconnection.go | 12 + ...sroutecircuitconnectionpropertiesformat.go | 14 + .../model_ipv6circuitconnectionconfig.go | 9 + .../model_subresource.go | 8 + .../predicates.go | 32 ++ .../expressroutecircuitconnections/version.go | 12 + .../expressroutecircuitpeerings/README.md | 82 ++++ .../expressroutecircuitpeerings/client.go | 26 + .../expressroutecircuitpeerings/constants.go | 274 +++++++++++ .../id_expressroutecircuit.go | 127 +++++ .../method_createorupdate.go | 75 +++ .../method_delete.go | 72 +++ .../expressroutecircuitpeerings/method_get.go | 52 ++ .../method_list.go | 89 ++++ .../model_expressroutecircuitconnection.go | 12 + ...sroutecircuitconnectionpropertiesformat.go | 14 + .../model_expressroutecircuitpeering.go | 12 + .../model_expressroutecircuitpeeringconfig.go | 13 + ...ressroutecircuitpeeringpropertiesformat.go | 27 ++ .../model_expressroutecircuitstats.go | 11 + .../model_expressrouteconnectionid.go | 8 + .../model_ipv6circuitconnectionconfig.go | 9 + ...el_ipv6expressroutecircuitpeeringconfig.go | 12 + ...model_peerexpressroutecircuitconnection.go | 12 + ...sroutecircuitconnectionpropertiesformat.go | 14 + .../model_subresource.go | 8 + .../expressroutecircuitpeerings/predicates.go | 32 ++ .../expressroutecircuitpeerings/version.go | 12 + .../2023-05-01/expressroutecircuits/README.md | 120 +++++ .../2023-05-01/expressroutecircuits/client.go | 26 + .../expressroutecircuits/constants.go | 450 ++++++++++++++++++ .../id_expressroutecircuit.go | 127 +++++ .../method_createorupdate.go | 74 +++ .../expressroutecircuits/method_delete.go | 71 +++ .../expressroutecircuits/method_get.go | 51 ++ .../expressroutecircuits/method_list.go | 90 ++++ .../expressroutecircuits/method_listall.go | 90 ++++ .../expressroutecircuits/method_updatetags.go | 55 +++ .../model_authorizationpropertiesformat.go | 10 + .../model_expressroutecircuit.go | 15 + .../model_expressroutecircuitauthorization.go | 12 + .../model_expressroutecircuitconnection.go | 12 + ...sroutecircuitconnectionpropertiesformat.go | 14 + .../model_expressroutecircuitpeering.go | 12 + .../model_expressroutecircuitpeeringconfig.go | 13 + ...ressroutecircuitpeeringpropertiesformat.go | 27 ++ ...del_expressroutecircuitpropertiesformat.go | 23 + ...ssroutecircuitserviceproviderproperties.go | 10 + .../model_expressroutecircuitsku.go | 10 + .../model_expressroutecircuitstats.go | 11 + .../model_expressrouteconnectionid.go | 8 + .../model_ipv6circuitconnectionconfig.go | 9 + ...el_ipv6expressroutecircuitpeeringconfig.go | 12 + ...model_peerexpressroutecircuitconnection.go | 12 + ...sroutecircuitconnectionpropertiesformat.go | 14 + .../expressroutecircuits/model_subresource.go | 8 + .../expressroutecircuits/model_tagsobject.go | 8 + .../expressroutecircuits/predicates.go | 37 ++ .../expressroutecircuits/version.go | 12 + vendor/modules.txt | 4 + 84 files changed, 4212 insertions(+), 34 deletions(-) create mode 100644 dalek/cleaners/subscriptions_delete_express_route_circuit.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/version.go diff --git a/clients/client.go b/clients/client.go index efa911f..6e6eac9 100644 --- a/clients/client.go +++ b/clients/client.go @@ -13,6 +13,10 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits" "github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces" paloAltoNetworks "github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29" resourceGraph "github.com/hashicorp/go-azure-sdk/resource-manager/resourcegraph/2022-10-01/resources" @@ -42,23 +46,27 @@ type MicrosoftGraphClient struct { } type ResourceManagerClient struct { - DataProtection *dataProtection.Client - LocksClient *managementlocks.ManagementLocksClient - MachineLearningWorkspacesClient *workspaces.WorkspacesClient - ManagedHSMsClient *managedhsms.ManagedHsmsClient - ManagementClient *managementgroups.ManagementGroupsClient - NetAppAccountClient *netappaccounts.NetAppAccountsClient - NetAppCapacityPoolClient *capacitypools.CapacityPoolsClient - NetAppVolumeClient *volumes.VolumesClient - NetAppVolumeReplicationClient *volumesreplication.VolumesReplicationClient - NotificationHubNamespaceClient *namespaces.NamespacesClient - PaloAlto *paloAltoNetworks.Client - ResourceGraphClient *resourceGraph.ResourcesClient - ResourcesGroupsClient *resourcegroups.ResourceGroupsClient - ServiceBus *serviceBus.Client - StorageSyncClient *storagesyncservicesresource.StorageSyncServicesResourceClient - StorageSyncGroupClient *syncgroupresource.SyncGroupResourceClient - StorageSyncCloudEndpointClient *cloudendpointresource.CloudEndpointResourceClient + DataProtection *dataProtection.Client + ExpressRouteCircuitsClient *expressroutecircuits.ExpressRouteCircuitsClient + ExpressRouteCircuitAuthorizationsClient *expressroutecircuitauthorizations.ExpressRouteCircuitAuthorizationsClient + ExpressRouteCircuitConnectionsClient *expressroutecircuitconnections.ExpressRouteCircuitConnectionsClient + ExpressRouteCircuitPeeringsClient *expressroutecircuitpeerings.ExpressRouteCircuitPeeringsClient + LocksClient *managementlocks.ManagementLocksClient + MachineLearningWorkspacesClient *workspaces.WorkspacesClient + ManagedHSMsClient *managedhsms.ManagedHsmsClient + ManagementClient *managementgroups.ManagementGroupsClient + NetAppAccountClient *netappaccounts.NetAppAccountsClient + NetAppCapacityPoolClient *capacitypools.CapacityPoolsClient + NetAppVolumeClient *volumes.VolumesClient + NetAppVolumeReplicationClient *volumesreplication.VolumesReplicationClient + NotificationHubNamespaceClient *namespaces.NamespacesClient + PaloAlto *paloAltoNetworks.Client + ResourceGraphClient *resourceGraph.ResourcesClient + ResourcesGroupsClient *resourcegroups.ResourceGroupsClient + ServiceBus *serviceBus.Client + StorageSyncClient *storagesyncservicesresource.StorageSyncServicesResourceClient + StorageSyncGroupClient *syncgroupresource.SyncGroupResourceClient + StorageSyncCloudEndpointClient *cloudendpointresource.CloudEndpointResourceClient } type Credentials struct { @@ -167,6 +175,30 @@ func buildResourceManagerClient(ctx context.Context, creds auth.Credentials, env c.Authorizer = resourceManagerAuthorizer }) + expressRouteCircuitsClient, err := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI(environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building Express Route Circuits client: %+v", err) + } + expressRouteCircuitsClient.Client.Authorizer = resourceManagerAuthorizer + + expressRouteCircuitAuthorizationsClient, err := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building Express Route Circuit Authorizations client: %+v", err) + } + expressRouteCircuitAuthorizationsClient.Client.Authorizer = resourceManagerAuthorizer + + expressRouteCircuitConnectionsClient, err := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI(environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building Express Route Circuit Connections client: %+v", err) + } + expressRouteCircuitConnectionsClient.Client.Authorizer = resourceManagerAuthorizer + + expressRouteCircuitPeeringsClient, err := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI(environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building Express Route Circuit Peerings client: %+v", err) + } + expressRouteCircuitPeeringsClient.Client.Authorizer = resourceManagerAuthorizer + locksClient, err := managementlocks.NewManagementLocksClientWithBaseURI(environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building ManagementLocks client: %+v", err) @@ -263,22 +295,26 @@ func buildResourceManagerClient(ctx context.Context, creds auth.Credentials, env storageSyncCloudEndpointClient.Client.Authorizer = resourceManagerAuthorizer return &ResourceManagerClient{ - DataProtection: dataProtectionClient, - LocksClient: locksClient, - MachineLearningWorkspacesClient: workspacesClient, - ManagedHSMsClient: managedHsmsClient, - ManagementClient: managementClient, - NetAppAccountClient: netAppAccountClient, - NetAppCapacityPoolClient: netAppCapacityPoolClient, - NetAppVolumeClient: netAppVolumeClient, - NetAppVolumeReplicationClient: netAppVolumeReplicationClient, - NotificationHubNamespaceClient: notificationHubNamespacesClient, - PaloAlto: paloAltoClient, - ResourceGraphClient: resourceGraphClient, - ResourcesGroupsClient: resourcesClient, - ServiceBus: serviceBusClient, - StorageSyncClient: storageSyncClient, - StorageSyncGroupClient: storageSyncGroupClient, - StorageSyncCloudEndpointClient: storageSyncCloudEndpointClient, + DataProtection: dataProtectionClient, + ExpressRouteCircuitsClient: expressRouteCircuitsClient, + ExpressRouteCircuitAuthorizationsClient: expressRouteCircuitAuthorizationsClient, + ExpressRouteCircuitConnectionsClient: expressRouteCircuitConnectionsClient, + ExpressRouteCircuitPeeringsClient: expressRouteCircuitPeeringsClient, + LocksClient: locksClient, + MachineLearningWorkspacesClient: workspacesClient, + ManagedHSMsClient: managedHsmsClient, + ManagementClient: managementClient, + NetAppAccountClient: netAppAccountClient, + NetAppCapacityPoolClient: netAppCapacityPoolClient, + NetAppVolumeClient: netAppVolumeClient, + NetAppVolumeReplicationClient: netAppVolumeReplicationClient, + NotificationHubNamespaceClient: notificationHubNamespacesClient, + PaloAlto: paloAltoClient, + ResourceGraphClient: resourceGraphClient, + ResourcesGroupsClient: resourcesClient, + ServiceBus: serviceBusClient, + StorageSyncClient: storageSyncClient, + StorageSyncGroupClient: storageSyncGroupClient, + StorageSyncCloudEndpointClient: storageSyncCloudEndpointClient, }, nil } diff --git a/dalek/cleaners/subscriptions.go b/dalek/cleaners/subscriptions.go index 1552ae4..bb6de33 100644 --- a/dalek/cleaners/subscriptions.go +++ b/dalek/cleaners/subscriptions.go @@ -9,6 +9,7 @@ import ( ) var SubscriptionCleaners = []SubscriptionCleaner{ + deleteExpressRouteCircuitsSubscriptionCleaner{}, deleteNetAppSubscriptionCleaner{}, deleteStorageSyncSubscriptionCleaner{}, deleteResourceGroupsInSubscriptionCleaner{}, diff --git a/dalek/cleaners/subscriptions_delete_express_route_circuit.go b/dalek/cleaners/subscriptions_delete_express_route_circuit.go new file mode 100644 index 0000000..537bc62 --- /dev/null +++ b/dalek/cleaners/subscriptions_delete_express_route_circuit.go @@ -0,0 +1,142 @@ +package cleaners + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits" + "github.com/tombuildsstuff/azurerm-dalek/clients" + "github.com/tombuildsstuff/azurerm-dalek/dalek/options" +) + +type deleteExpressRouteCircuitsSubscriptionCleaner struct{} + +var _ SubscriptionCleaner = deleteExpressRouteCircuitsSubscriptionCleaner{} + +func (p deleteExpressRouteCircuitsSubscriptionCleaner) Name() string { + return "Removing Express Route Circuit" +} + +func (p deleteExpressRouteCircuitsSubscriptionCleaner) Cleanup(ctx context.Context, subscriptionId commonids.SubscriptionId, client *clients.AzureClient, opts options.Options) error { + expressRouteCircuitsClient := client.ResourceManager.ExpressRouteCircuitsClient + expressRouteCircuitAuthorizationsClient := client.ResourceManager.ExpressRouteCircuitAuthorizationsClient + expressRouteCircuitConnectionsClient := client.ResourceManager.ExpressRouteCircuitConnectionsClient + expressRouteCircuitPeeringsClient := client.ResourceManager.ExpressRouteCircuitPeeringsClient + + expressRouteCircuits, err := expressRouteCircuitsClient.ListAllComplete(ctx, subscriptionId) + if err != nil { + return fmt.Errorf("listing Express Route Circuits for %s: %+v", subscriptionId, err) + } + + for _, expressRouteCircuit := range expressRouteCircuits.Items { + if expressRouteCircuit.Id == nil { + continue + } + + expressRouteCircuitIdForAuthorizations, err := expressroutecircuitauthorizations.ParseExpressRouteCircuitID(*expressRouteCircuit.Id) + if err != nil { + return err + } + + authorizations, err := expressRouteCircuitAuthorizationsClient.ListComplete(ctx, *expressRouteCircuitIdForAuthorizations) + if err != nil { + return fmt.Errorf("listing Express Route Circuit Authorizations for %s: %+v", expressRouteCircuitIdForAuthorizations, err) + } + + for _, authorization := range authorizations.Items { + if authorization.Id == nil { + continue + } + + authorizationId, err := expressroutecircuitauthorizations.ParseAuthorizationID(*authorization.Id) + if err != nil { + return err + } + + if !opts.ActuallyDelete { + log.Printf("[DEBUG] Would have deleted %s..", authorizationId) + continue + } + + if err = expressRouteCircuitAuthorizationsClient.DeleteThenPoll(ctx, *authorizationId); err != nil { + log.Printf("[DEBUG] Unable to delete %s: %+v", authorizationId, err) + } + } + + expressRouteCircuitIdForPeerings, err := expressroutecircuitpeerings.ParseExpressRouteCircuitID(*expressRouteCircuit.Id) + if err != nil { + return err + } + + peerings, err := expressRouteCircuitPeeringsClient.ListComplete(ctx, *expressRouteCircuitIdForPeerings) + if err != nil { + return fmt.Errorf("listing Express Route Circuit Peerings for %s: %+v", expressRouteCircuitIdForPeerings, err) + } + + for _, peering := range peerings.Items { + if peering.Id == nil { + continue + } + + peeringId, err := commonids.ParseExpressRouteCircuitPeeringID(*peering.Id) + if err != nil { + return err + } + + connections, err := expressRouteCircuitConnectionsClient.ListComplete(ctx, *peeringId) + if err != nil { + return fmt.Errorf("listing express route circuit connections for %s: %+v", peeringId, err) + } + + for _, connection := range connections.Items { + if connection.Id == nil { + continue + } + + connectionid, err := expressroutecircuitconnections.ParsePeeringConnectionID(*connection.Id) + if err != nil { + return err + } + + if !opts.ActuallyDelete { + log.Printf("[DEBUG] Would have deleted %s..", connectionid) + continue + } + + if err = expressRouteCircuitConnectionsClient.DeleteThenPoll(ctx, *connectionid); err != nil { + log.Printf("[DEBUG] Unable to delete %s: %+v", connectionid, err) + } + } + + if !opts.ActuallyDelete { + log.Printf("[DEBUG] Would have deleted %s..", peeringId) + continue + } + + if err = expressRouteCircuitPeeringsClient.DeleteThenPoll(ctx, *peeringId); err != nil { + log.Printf("[DEBUG] Unable to delete %s: %+v", peeringId, err) + } + } + + expressRouteCircuitId, err := expressroutecircuits.ParseExpressRouteCircuitID(*expressRouteCircuit.Id) + if err != nil { + return err + } + + if !opts.ActuallyDelete { + log.Printf("[DEBUG] Would have deleted %s..", expressRouteCircuitId) + continue + } + + if err = expressRouteCircuitsClient.DeleteThenPoll(ctx, *expressRouteCircuitId); err != nil { + log.Printf("[DEBUG] Unable to delete %s: %+v", expressRouteCircuitId, err) + } + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md new file mode 100644 index 0000000..c56db3c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations` Documentation + +The `expressroutecircuitauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations" +``` + + +### Client Initialization + +```go +client := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +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: `ExpressRouteCircuitAuthorizationsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +// 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 +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go new file mode 100644 index 0000000..8060a80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go @@ -0,0 +1,26 @@ +package expressroutecircuitauthorizations + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitAuthorizationsClient struct { + Client *resourcemanager.Client +} + +func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitAuthorizationsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitauthorizations", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ExpressRouteCircuitAuthorizationsClient: %+v", err) + } + + return &ExpressRouteCircuitAuthorizationsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go new file mode 100644 index 0000000..052d235 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go @@ -0,0 +1,98 @@ +package expressroutecircuitauthorizations + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizationUseStatus string + +const ( + AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" + AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" +) + +func PossibleValuesForAuthorizationUseStatus() []string { + return []string{ + string(AuthorizationUseStatusAvailable), + string(AuthorizationUseStatusInUse), + } +} + +func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthorizationUseStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { + vals := map[string]AuthorizationUseStatus{ + "available": AuthorizationUseStatusAvailable, + "inuse": AuthorizationUseStatusInUse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthorizationUseStatus(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go new file mode 100644 index 0000000..614f157 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go @@ -0,0 +1,140 @@ +package expressroutecircuitauthorizations + +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 = AuthorizationId{} + +// AuthorizationId is a struct representing the Resource ID for a Authorization +type AuthorizationId struct { + SubscriptionId string + ResourceGroupName string + ExpressRouteCircuitName string + AuthorizationName string +} + +// NewAuthorizationID returns a new AuthorizationId struct +func NewAuthorizationID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, authorizationName string) AuthorizationId { + return AuthorizationId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ExpressRouteCircuitName: expressRouteCircuitName, + AuthorizationName: authorizationName, + } +} + +// ParseAuthorizationID parses 'input' into a AuthorizationId +func ParseAuthorizationID(input string) (*AuthorizationId, error) { + parser := resourceids.NewParserFromResourceIdType(AuthorizationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AuthorizationId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + if id.AuthorizationName, ok = parsed.Parsed["authorizationName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", *parsed) + } + + return &id, nil +} + +// ParseAuthorizationIDInsensitively parses 'input' case-insensitively into a AuthorizationId +// note: this method should only be used for API response data and not user input +func ParseAuthorizationIDInsensitively(input string) (*AuthorizationId, error) { + parser := resourceids.NewParserFromResourceIdType(AuthorizationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AuthorizationId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + if id.AuthorizationName, ok = parsed.Parsed["authorizationName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", *parsed) + } + + return &id, nil +} + +// ValidateAuthorizationID checks that 'input' can be parsed as a Authorization ID +func ValidateAuthorizationID(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 := ParseAuthorizationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Authorization ID +func (id AuthorizationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/authorizations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.AuthorizationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Authorization ID +func (id AuthorizationId) 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("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), + resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), + resourceids.UserSpecifiedSegment("authorizationName", "authorizationValue"), + } +} + +// String returns a human-readable description of this Authorization ID +func (id AuthorizationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), + fmt.Sprintf("Authorization Name: %q", id.AuthorizationName), + } + return fmt.Sprintf("Authorization (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go new file mode 100644 index 0000000..502b311 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go @@ -0,0 +1,127 @@ +package expressroutecircuitauthorizations + +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 = ExpressRouteCircuitId{} + +// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit +type ExpressRouteCircuitId struct { + SubscriptionId string + ResourceGroupName string + ExpressRouteCircuitName string +} + +// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct +func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { + return ExpressRouteCircuitId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ExpressRouteCircuitName: expressRouteCircuitName, + } +} + +// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId +func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId +// note: this method should only be used for API response data and not user input +func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID +func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Express Route Circuit ID +func (id ExpressRouteCircuitId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID +func (id ExpressRouteCircuitId) 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("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), + } +} + +// String returns a human-readable description of this Express Route Circuit ID +func (id ExpressRouteCircuitId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), + } + return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go new file mode 100644 index 0000000..c92e38b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go @@ -0,0 +1,74 @@ +package expressroutecircuitauthorizations + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateThenPoll(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go new file mode 100644 index 0000000..b2c01bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go @@ -0,0 +1,71 @@ +package expressroutecircuitauthorizations + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, id AuthorizationId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ExpressRouteCircuitAuthorizationsClient) DeleteThenPoll(ctx context.Context, id AuthorizationId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go new file mode 100644 index 0000000..eceb10c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go @@ -0,0 +1,51 @@ +package expressroutecircuitauthorizations + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExpressRouteCircuitAuthorization +} + +// Get ... +func (c ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, id AuthorizationId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go new file mode 100644 index 0000000..6c95caf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go @@ -0,0 +1,89 @@ +package expressroutecircuitauthorizations + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ExpressRouteCircuitAuthorization +} + +type ListCompleteResult struct { + Items []ExpressRouteCircuitAuthorization +} + +// List ... +func (c ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/authorizations", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ExpressRouteCircuitAuthorization `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ExpressRouteCircuitAuthorizationsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitAuthorizationOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ExpressRouteCircuitAuthorizationsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitAuthorizationOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ExpressRouteCircuitAuthorization, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go new file mode 100644 index 0000000..e3d3f2b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go @@ -0,0 +1,10 @@ +package expressroutecircuitauthorizations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizationPropertiesFormat struct { + AuthorizationKey *string `json:"authorizationKey,omitempty"` + AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go new file mode 100644 index 0000000..b4b0843 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go @@ -0,0 +1,12 @@ +package expressroutecircuitauthorizations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitAuthorization struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go new file mode 100644 index 0000000..3533e80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go @@ -0,0 +1,32 @@ +package expressroutecircuitauthorizations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitAuthorizationOperationPredicate struct { + Etag *string + Id *string + Name *string + Type *string +} + +func (p ExpressRouteCircuitAuthorizationOperationPredicate) Matches(input ExpressRouteCircuitAuthorization) bool { + + if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go new file mode 100644 index 0000000..9bda385 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitauthorizations + +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-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitauthorizations/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md new file mode 100644 index 0000000..12e529e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections` Documentation + +The `expressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections" +``` + + +### Client Initialization + +```go +client := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +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: `ExpressRouteCircuitConnectionsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +// 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 +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go new file mode 100644 index 0000000..333eff0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go @@ -0,0 +1,26 @@ +package expressroutecircuitconnections + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnectionsClient struct { + Client *resourcemanager.Client +} + +func NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitConnectionsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitconnections", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ExpressRouteCircuitConnectionsClient: %+v", err) + } + + return &ExpressRouteCircuitConnectionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go new file mode 100644 index 0000000..8bfeb33 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go @@ -0,0 +1,101 @@ +package expressroutecircuitconnections + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CircuitConnectionStatus string + +const ( + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" +) + +func PossibleValuesForCircuitConnectionStatus() []string { + return []string{ + string(CircuitConnectionStatusConnected), + string(CircuitConnectionStatusConnecting), + string(CircuitConnectionStatusDisconnected), + } +} + +func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCircuitConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { + vals := map[string]CircuitConnectionStatus{ + "connected": CircuitConnectionStatusConnected, + "connecting": CircuitConnectionStatusConnecting, + "disconnected": CircuitConnectionStatusDisconnected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CircuitConnectionStatus(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go new file mode 100644 index 0000000..4bdac2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go @@ -0,0 +1,153 @@ +package expressroutecircuitconnections + +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 = PeeringConnectionId{} + +// PeeringConnectionId is a struct representing the Resource ID for a Peering Connection +type PeeringConnectionId struct { + SubscriptionId string + ResourceGroupName string + ExpressRouteCircuitName string + PeeringName string + ConnectionName string +} + +// NewPeeringConnectionID returns a new PeeringConnectionId struct +func NewPeeringConnectionID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, connectionName string) PeeringConnectionId { + return PeeringConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ExpressRouteCircuitName: expressRouteCircuitName, + PeeringName: peeringName, + ConnectionName: connectionName, + } +} + +// ParsePeeringConnectionID parses 'input' into a PeeringConnectionId +func ParsePeeringConnectionID(input string) (*PeeringConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(PeeringConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PeeringConnectionId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "peeringName", *parsed) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "connectionName", *parsed) + } + + return &id, nil +} + +// ParsePeeringConnectionIDInsensitively parses 'input' case-insensitively into a PeeringConnectionId +// note: this method should only be used for API response data and not user input +func ParsePeeringConnectionIDInsensitively(input string) (*PeeringConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(PeeringConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PeeringConnectionId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "peeringName", *parsed) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "connectionName", *parsed) + } + + return &id, nil +} + +// ValidatePeeringConnectionID checks that 'input' can be parsed as a Peering Connection ID +func ValidatePeeringConnectionID(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 := ParsePeeringConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Peering Connection ID +func (id PeeringConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/connections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.ConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Peering Connection ID +func (id PeeringConnectionId) 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("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), + resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), + resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), + resourceids.StaticSegment("staticConnections", "connections", "connections"), + resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), + } +} + +// String returns a human-readable description of this Peering Connection ID +func (id PeeringConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), + fmt.Sprintf("Peering Name: %q", id.PeeringName), + fmt.Sprintf("Connection Name: %q", id.ConnectionName), + } + return fmt.Sprintf("Peering Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go new file mode 100644 index 0000000..b06791a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go @@ -0,0 +1,74 @@ +package expressroutecircuitconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go new file mode 100644 index 0000000..1d81333 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go @@ -0,0 +1,71 @@ +package expressroutecircuitconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, id PeeringConnectionId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ExpressRouteCircuitConnectionsClient) DeleteThenPoll(ctx context.Context, id PeeringConnectionId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go new file mode 100644 index 0000000..daae7f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go @@ -0,0 +1,51 @@ +package expressroutecircuitconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExpressRouteCircuitConnection +} + +// Get ... +func (c ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, id PeeringConnectionId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go new file mode 100644 index 0000000..53452b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go @@ -0,0 +1,90 @@ +package expressroutecircuitconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ExpressRouteCircuitConnection +} + +type ListCompleteResult struct { + Items []ExpressRouteCircuitConnection +} + +// List ... +func (c ExpressRouteCircuitConnectionsClient) List(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/connections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ExpressRouteCircuitConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitConnectionOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ExpressRouteCircuitConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, predicate ExpressRouteCircuitConnectionOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ExpressRouteCircuitConnection, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go new file mode 100644 index 0000000..689bf9a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go @@ -0,0 +1,12 @@ +package expressroutecircuitconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnection struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go new file mode 100644 index 0000000..a1bf981 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go @@ -0,0 +1,14 @@ +package expressroutecircuitconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnectionPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AuthorizationKey *string `json:"authorizationKey,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` + ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` + IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` + PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go new file mode 100644 index 0000000..580b8a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go @@ -0,0 +1,9 @@ +package expressroutecircuitconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6CircuitConnectionConfig struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go new file mode 100644 index 0000000..d6673ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go @@ -0,0 +1,8 @@ +package expressroutecircuitconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go new file mode 100644 index 0000000..6c65b4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go @@ -0,0 +1,32 @@ +package expressroutecircuitconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnectionOperationPredicate struct { + Etag *string + Id *string + Name *string + Type *string +} + +func (p ExpressRouteCircuitConnectionOperationPredicate) Matches(input ExpressRouteCircuitConnection) bool { + + if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go new file mode 100644 index 0000000..caf7c8e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitconnections + +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-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitconnections/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md new file mode 100644 index 0000000..cbb764b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings` Documentation + +The `expressroutecircuitpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings" +``` + + +### Client Initialization + +```go +client := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +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: `ExpressRouteCircuitPeeringsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +// 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 +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go new file mode 100644 index 0000000..63ac4da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go @@ -0,0 +1,26 @@ +package expressroutecircuitpeerings + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringsClient struct { + Client *resourcemanager.Client +} + +func NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitPeeringsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitpeerings", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ExpressRouteCircuitPeeringsClient: %+v", err) + } + + return &ExpressRouteCircuitPeeringsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go new file mode 100644 index 0000000..98d21da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go @@ -0,0 +1,274 @@ +package expressroutecircuitpeerings + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CircuitConnectionStatus string + +const ( + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" +) + +func PossibleValuesForCircuitConnectionStatus() []string { + return []string{ + string(CircuitConnectionStatusConnected), + string(CircuitConnectionStatusConnecting), + string(CircuitConnectionStatusDisconnected), + } +} + +func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCircuitConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { + vals := map[string]CircuitConnectionStatus{ + "connected": CircuitConnectionStatusConnected, + "connecting": CircuitConnectionStatusConnecting, + "disconnected": CircuitConnectionStatusDisconnected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CircuitConnectionStatus(input) + return &out, nil +} + +type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string + +const ( + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" +) + +func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { + return []string{ + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), + } +} + +func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { + vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ + "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, + "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, + "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, + "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) + return &out, nil +} + +type ExpressRouteCircuitPeeringState string + +const ( + ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" +) + +func PossibleValuesForExpressRouteCircuitPeeringState() []string { + return []string{ + string(ExpressRouteCircuitPeeringStateDisabled), + string(ExpressRouteCircuitPeeringStateEnabled), + } +} + +func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitPeeringState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { + vals := map[string]ExpressRouteCircuitPeeringState{ + "disabled": ExpressRouteCircuitPeeringStateDisabled, + "enabled": ExpressRouteCircuitPeeringStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitPeeringState(input) + return &out, nil +} + +type ExpressRoutePeeringState string + +const ( + ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" +) + +func PossibleValuesForExpressRoutePeeringState() []string { + return []string{ + string(ExpressRoutePeeringStateDisabled), + string(ExpressRoutePeeringStateEnabled), + } +} + +func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRoutePeeringState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { + vals := map[string]ExpressRoutePeeringState{ + "disabled": ExpressRoutePeeringStateDisabled, + "enabled": ExpressRoutePeeringStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRoutePeeringState(input) + return &out, nil +} + +type ExpressRoutePeeringType string + +const ( + ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" +) + +func PossibleValuesForExpressRoutePeeringType() []string { + return []string{ + string(ExpressRoutePeeringTypeAzurePrivatePeering), + string(ExpressRoutePeeringTypeAzurePublicPeering), + string(ExpressRoutePeeringTypeMicrosoftPeering), + } +} + +func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRoutePeeringType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { + vals := map[string]ExpressRoutePeeringType{ + "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, + "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, + "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRoutePeeringType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go new file mode 100644 index 0000000..80bd7e6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go @@ -0,0 +1,127 @@ +package expressroutecircuitpeerings + +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 = ExpressRouteCircuitId{} + +// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit +type ExpressRouteCircuitId struct { + SubscriptionId string + ResourceGroupName string + ExpressRouteCircuitName string +} + +// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct +func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { + return ExpressRouteCircuitId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ExpressRouteCircuitName: expressRouteCircuitName, + } +} + +// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId +func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId +// note: this method should only be used for API response data and not user input +func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID +func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Express Route Circuit ID +func (id ExpressRouteCircuitId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID +func (id ExpressRouteCircuitId) 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("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), + } +} + +// String returns a human-readable description of this Express Route Circuit ID +func (id ExpressRouteCircuitId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), + } + return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go new file mode 100644 index 0000000..9fd584f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go @@ -0,0 +1,75 @@ +package expressroutecircuitpeerings + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go new file mode 100644 index 0000000..241c45f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go @@ -0,0 +1,72 @@ +package expressroutecircuitpeerings + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ExpressRouteCircuitPeeringsClient) DeleteThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go new file mode 100644 index 0000000..0a712bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go @@ -0,0 +1,52 @@ +package expressroutecircuitpeerings + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExpressRouteCircuitPeering +} + +// Get ... +func (c ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go new file mode 100644 index 0000000..928c768 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go @@ -0,0 +1,89 @@ +package expressroutecircuitpeerings + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ExpressRouteCircuitPeering +} + +type ListCompleteResult struct { + Items []ExpressRouteCircuitPeering +} + +// List ... +func (c ExpressRouteCircuitPeeringsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/peerings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ExpressRouteCircuitPeering `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ExpressRouteCircuitPeeringsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitPeeringOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ExpressRouteCircuitPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitPeeringOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ExpressRouteCircuitPeering, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go new file mode 100644 index 0000000..f0bf621 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnection struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go new file mode 100644 index 0000000..f89ab3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go @@ -0,0 +1,14 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnectionPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AuthorizationKey *string `json:"authorizationKey,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` + ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` + IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` + PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go new file mode 100644 index 0000000..5e47a7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeering struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go new file mode 100644 index 0000000..67b5752 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go @@ -0,0 +1,13 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringConfig struct { + AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` + AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` + AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` + CustomerASN *int64 `json:"customerASN,omitempty"` + LegacyMode *int64 `json:"legacyMode,omitempty"` + RoutingRegistryName *string `json:"routingRegistryName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go new file mode 100644 index 0000000..a54ef38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go @@ -0,0 +1,27 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringPropertiesFormat struct { + AzureASN *int64 `json:"azureASN,omitempty"` + Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` + ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` + GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` + IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + PeerASN *int64 `json:"peerASN,omitempty"` + PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` + PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` + PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + RouteFilter *SubResource `json:"routeFilter,omitempty"` + SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` + State *ExpressRoutePeeringState `json:"state,omitempty"` + Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` + VlanId *int64 `json:"vlanId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go new file mode 100644 index 0000000..8239e62 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go @@ -0,0 +1,11 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitStats struct { + PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` + PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` + SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` + SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go new file mode 100644 index 0000000..f06a355 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go @@ -0,0 +1,8 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteConnectionId struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go new file mode 100644 index 0000000..ae00db3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go @@ -0,0 +1,9 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6CircuitConnectionConfig struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go new file mode 100644 index 0000000..93ee020 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6ExpressRouteCircuitPeeringConfig struct { + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + RouteFilter *SubResource `json:"routeFilter,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go new file mode 100644 index 0000000..bc9218f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerExpressRouteCircuitConnection struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go new file mode 100644 index 0000000..72eba9f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go @@ -0,0 +1,14 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerExpressRouteCircuitConnectionPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AuthResourceGuid *string `json:"authResourceGuid,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` + ConnectionName *string `json:"connectionName,omitempty"` + ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` + PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go new file mode 100644 index 0000000..3143d87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go @@ -0,0 +1,8 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go new file mode 100644 index 0000000..1e725c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go @@ -0,0 +1,32 @@ +package expressroutecircuitpeerings + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringOperationPredicate struct { + Etag *string + Id *string + Name *string + Type *string +} + +func (p ExpressRouteCircuitPeeringOperationPredicate) Matches(input ExpressRouteCircuitPeering) bool { + + if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go new file mode 100644 index 0000000..a236570 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +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-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitpeerings/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/README.md new file mode 100644 index 0000000..9a6a719 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/README.md @@ -0,0 +1,120 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits` Documentation + +The `expressroutecircuits` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits" +``` + + +### Client Initialization + +```go +client := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +payload := expressroutecircuits.ExpressRouteCircuit{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +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: `ExpressRouteCircuitsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `ExpressRouteCircuitsClient.ListAll` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.UpdateTags` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +payload := expressroutecircuits.TagsObject{ + // ... +} + + +read, err := client.UpdateTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/client.go new file mode 100644 index 0000000..cd12ab1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/client.go @@ -0,0 +1,26 @@ +package expressroutecircuits + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitsClient struct { + Client *resourcemanager.Client +} + +func NewExpressRouteCircuitsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuits", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ExpressRouteCircuitsClient: %+v", err) + } + + return &ExpressRouteCircuitsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/constants.go new file mode 100644 index 0000000..017902f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/constants.go @@ -0,0 +1,450 @@ +package expressroutecircuits + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizationUseStatus string + +const ( + AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" + AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" +) + +func PossibleValuesForAuthorizationUseStatus() []string { + return []string{ + string(AuthorizationUseStatusAvailable), + string(AuthorizationUseStatusInUse), + } +} + +func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthorizationUseStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { + vals := map[string]AuthorizationUseStatus{ + "available": AuthorizationUseStatusAvailable, + "inuse": AuthorizationUseStatusInUse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthorizationUseStatus(input) + return &out, nil +} + +type CircuitConnectionStatus string + +const ( + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" +) + +func PossibleValuesForCircuitConnectionStatus() []string { + return []string{ + string(CircuitConnectionStatusConnected), + string(CircuitConnectionStatusConnecting), + string(CircuitConnectionStatusDisconnected), + } +} + +func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCircuitConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { + vals := map[string]CircuitConnectionStatus{ + "connected": CircuitConnectionStatusConnected, + "connecting": CircuitConnectionStatusConnecting, + "disconnected": CircuitConnectionStatusDisconnected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CircuitConnectionStatus(input) + return &out, nil +} + +type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string + +const ( + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" +) + +func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { + return []string{ + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), + string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), + } +} + +func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { + vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ + "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, + "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, + "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, + "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) + return &out, nil +} + +type ExpressRouteCircuitPeeringState string + +const ( + ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" +) + +func PossibleValuesForExpressRouteCircuitPeeringState() []string { + return []string{ + string(ExpressRouteCircuitPeeringStateDisabled), + string(ExpressRouteCircuitPeeringStateEnabled), + } +} + +func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitPeeringState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { + vals := map[string]ExpressRouteCircuitPeeringState{ + "disabled": ExpressRouteCircuitPeeringStateDisabled, + "enabled": ExpressRouteCircuitPeeringStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitPeeringState(input) + return &out, nil +} + +type ExpressRouteCircuitSkuFamily string + +const ( + ExpressRouteCircuitSkuFamilyMeteredData ExpressRouteCircuitSkuFamily = "MeteredData" + ExpressRouteCircuitSkuFamilyUnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" +) + +func PossibleValuesForExpressRouteCircuitSkuFamily() []string { + return []string{ + string(ExpressRouteCircuitSkuFamilyMeteredData), + string(ExpressRouteCircuitSkuFamilyUnlimitedData), + } +} + +func (s *ExpressRouteCircuitSkuFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitSkuFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitSkuFamily(input string) (*ExpressRouteCircuitSkuFamily, error) { + vals := map[string]ExpressRouteCircuitSkuFamily{ + "metereddata": ExpressRouteCircuitSkuFamilyMeteredData, + "unlimiteddata": ExpressRouteCircuitSkuFamilyUnlimitedData, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitSkuFamily(input) + return &out, nil +} + +type ExpressRouteCircuitSkuTier string + +const ( + ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" + ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" + ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" + ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" +) + +func PossibleValuesForExpressRouteCircuitSkuTier() []string { + return []string{ + string(ExpressRouteCircuitSkuTierBasic), + string(ExpressRouteCircuitSkuTierLocal), + string(ExpressRouteCircuitSkuTierPremium), + string(ExpressRouteCircuitSkuTierStandard), + } +} + +func (s *ExpressRouteCircuitSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRouteCircuitSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRouteCircuitSkuTier(input string) (*ExpressRouteCircuitSkuTier, error) { + vals := map[string]ExpressRouteCircuitSkuTier{ + "basic": ExpressRouteCircuitSkuTierBasic, + "local": ExpressRouteCircuitSkuTierLocal, + "premium": ExpressRouteCircuitSkuTierPremium, + "standard": ExpressRouteCircuitSkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRouteCircuitSkuTier(input) + return &out, nil +} + +type ExpressRoutePeeringState string + +const ( + ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" +) + +func PossibleValuesForExpressRoutePeeringState() []string { + return []string{ + string(ExpressRoutePeeringStateDisabled), + string(ExpressRoutePeeringStateEnabled), + } +} + +func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRoutePeeringState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { + vals := map[string]ExpressRoutePeeringState{ + "disabled": ExpressRoutePeeringStateDisabled, + "enabled": ExpressRoutePeeringStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRoutePeeringState(input) + return &out, nil +} + +type ExpressRoutePeeringType string + +const ( + ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" +) + +func PossibleValuesForExpressRoutePeeringType() []string { + return []string{ + string(ExpressRoutePeeringTypeAzurePrivatePeering), + string(ExpressRoutePeeringTypeAzurePublicPeering), + string(ExpressRoutePeeringTypeMicrosoftPeering), + } +} + +func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpressRoutePeeringType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { + vals := map[string]ExpressRoutePeeringType{ + "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, + "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, + "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExpressRoutePeeringType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type ServiceProviderProvisioningState string + +const ( + ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" + ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" + ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" + ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" +) + +func PossibleValuesForServiceProviderProvisioningState() []string { + return []string{ + string(ServiceProviderProvisioningStateDeprovisioning), + string(ServiceProviderProvisioningStateNotProvisioned), + string(ServiceProviderProvisioningStateProvisioned), + string(ServiceProviderProvisioningStateProvisioning), + } +} + +func (s *ServiceProviderProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceProviderProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceProviderProvisioningState(input string) (*ServiceProviderProvisioningState, error) { + vals := map[string]ServiceProviderProvisioningState{ + "deprovisioning": ServiceProviderProvisioningStateDeprovisioning, + "notprovisioned": ServiceProviderProvisioningStateNotProvisioned, + "provisioned": ServiceProviderProvisioningStateProvisioned, + "provisioning": ServiceProviderProvisioningStateProvisioning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceProviderProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go new file mode 100644 index 0000000..76f0cad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go @@ -0,0 +1,127 @@ +package expressroutecircuits + +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 = ExpressRouteCircuitId{} + +// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit +type ExpressRouteCircuitId struct { + SubscriptionId string + ResourceGroupName string + ExpressRouteCircuitName string +} + +// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct +func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { + return ExpressRouteCircuitId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ExpressRouteCircuitName: expressRouteCircuitName, + } +} + +// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId +func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId +// note: this method should only be used for API response data and not user input +func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitId{} + + 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.ExpressRouteCircuitName, ok = parsed.Parsed["expressRouteCircuitName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", *parsed) + } + + return &id, nil +} + +// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID +func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Express Route Circuit ID +func (id ExpressRouteCircuitId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID +func (id ExpressRouteCircuitId) 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("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), + } +} + +// String returns a human-readable description of this Express Route Circuit ID +func (id ExpressRouteCircuitId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), + } + return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go new file mode 100644 index 0000000..4463c16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go @@ -0,0 +1,74 @@ +package expressroutecircuits + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ExpressRouteCircuitsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go new file mode 100644 index 0000000..91f8aa5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go @@ -0,0 +1,71 @@ +package expressroutecircuits + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ExpressRouteCircuitsClient) Delete(ctx context.Context, id ExpressRouteCircuitId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ExpressRouteCircuitsClient) DeleteThenPoll(ctx context.Context, id ExpressRouteCircuitId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go new file mode 100644 index 0000000..2e4d336 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go @@ -0,0 +1,51 @@ +package expressroutecircuits + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExpressRouteCircuit +} + +// Get ... +func (c ExpressRouteCircuitsClient) Get(ctx context.Context, id ExpressRouteCircuitId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go new file mode 100644 index 0000000..0f3277d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go @@ -0,0 +1,90 @@ +package expressroutecircuits + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ExpressRouteCircuit +} + +type ListCompleteResult struct { + Items []ExpressRouteCircuit +} + +// List ... +func (c ExpressRouteCircuitsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ExpressRouteCircuit `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ExpressRouteCircuitsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ExpressRouteCircuitsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRouteCircuitOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ExpressRouteCircuit, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go new file mode 100644 index 0000000..1689bd1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go @@ -0,0 +1,90 @@ +package expressroutecircuits + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAllOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ExpressRouteCircuit +} + +type ListAllCompleteResult struct { + Items []ExpressRouteCircuit +} + +// ListAll ... +func (c ExpressRouteCircuitsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ExpressRouteCircuit `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListAllComplete retrieves all the results into a single object +func (c ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { + return c.ListAllCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) +} + +// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ExpressRouteCircuitsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteCircuitOperationPredicate) (result ListAllCompleteResult, err error) { + items := make([]ExpressRouteCircuit, 0) + + resp, err := c.ListAll(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListAllCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go new file mode 100644 index 0000000..6e2d55e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go @@ -0,0 +1,55 @@ +package expressroutecircuits + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateTagsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExpressRouteCircuit +} + +// UpdateTags ... +func (c ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, id ExpressRouteCircuitId, input TagsObject) (result UpdateTagsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go new file mode 100644 index 0000000..a539b0f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go @@ -0,0 +1,10 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizationPropertiesFormat struct { + AuthorizationKey *string `json:"authorizationKey,omitempty"` + AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go new file mode 100644 index 0000000..a74493f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go @@ -0,0 +1,15 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuit struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` + Sku *ExpressRouteCircuitSku `json:"sku,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/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go new file mode 100644 index 0000000..2942811 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitAuthorization struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go new file mode 100644 index 0000000..901ef50 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnection struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go new file mode 100644 index 0000000..897f772 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go @@ -0,0 +1,14 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitConnectionPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AuthorizationKey *string `json:"authorizationKey,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` + ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` + IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` + PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go new file mode 100644 index 0000000..d743119 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeering struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go new file mode 100644 index 0000000..836b1d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go @@ -0,0 +1,13 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringConfig struct { + AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` + AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` + AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` + CustomerASN *int64 `json:"customerASN,omitempty"` + LegacyMode *int64 `json:"legacyMode,omitempty"` + RoutingRegistryName *string `json:"routingRegistryName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go new file mode 100644 index 0000000..87a88e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go @@ -0,0 +1,27 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPeeringPropertiesFormat struct { + AzureASN *int64 `json:"azureASN,omitempty"` + Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` + ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` + GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` + IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + PeerASN *int64 `json:"peerASN,omitempty"` + PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` + PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` + PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + RouteFilter *SubResource `json:"routeFilter,omitempty"` + SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` + State *ExpressRoutePeeringState `json:"state,omitempty"` + Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` + VlanId *int64 `json:"vlanId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go new file mode 100644 index 0000000..89faee5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go @@ -0,0 +1,23 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPropertiesFormat struct { + AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` + AuthorizationKey *string `json:"authorizationKey,omitempty"` + AuthorizationStatus *string `json:"authorizationStatus,omitempty"` + Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` + BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` + CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` + ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` + GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` + GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` + Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ServiceKey *string `json:"serviceKey,omitempty"` + ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` + ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` + ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` + Stag *int64 `json:"stag,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go new file mode 100644 index 0000000..432cdaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go @@ -0,0 +1,10 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitServiceProviderProperties struct { + BandwidthInMbps *int64 `json:"bandwidthInMbps,omitempty"` + PeeringLocation *string `json:"peeringLocation,omitempty"` + ServiceProviderName *string `json:"serviceProviderName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go new file mode 100644 index 0000000..186629b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go @@ -0,0 +1,10 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitSku struct { + Family *ExpressRouteCircuitSkuFamily `json:"family,omitempty"` + Name *string `json:"name,omitempty"` + Tier *ExpressRouteCircuitSkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go new file mode 100644 index 0000000..ca8cd2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go @@ -0,0 +1,11 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitStats struct { + PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` + PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` + SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` + SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go new file mode 100644 index 0000000..70b79aa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go @@ -0,0 +1,8 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteConnectionId struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go new file mode 100644 index 0000000..49a4217 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go @@ -0,0 +1,9 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6CircuitConnectionConfig struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go new file mode 100644 index 0000000..02e4a94 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6ExpressRouteCircuitPeeringConfig struct { + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + RouteFilter *SubResource `json:"routeFilter,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go new file mode 100644 index 0000000..e52a6b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerExpressRouteCircuitConnection struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go new file mode 100644 index 0000000..804baee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go @@ -0,0 +1,14 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerExpressRouteCircuitConnectionPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AuthResourceGuid *string `json:"authResourceGuid,omitempty"` + CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` + ConnectionName *string `json:"connectionName,omitempty"` + ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` + PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go new file mode 100644 index 0000000..daf852a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go @@ -0,0 +1,8 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go new file mode 100644 index 0000000..585eaab --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go @@ -0,0 +1,8 @@ +package expressroutecircuits + +// 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/network/2023-05-01/expressroutecircuits/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/predicates.go new file mode 100644 index 0000000..3fdbc04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/predicates.go @@ -0,0 +1,37 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p ExpressRouteCircuitOperationPredicate) Matches(input ExpressRouteCircuit) bool { + + if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil || *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/version.go new file mode 100644 index 0000000..5273955 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits/version.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +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-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuits/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 85aee12..c1878ec 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -53,6 +53,10 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypoo github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication +github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations +github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections +github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings +github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29 github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack